-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed instructions for setting parameters from a table
- Loading branch information
1 parent
949897f
commit a191911
Showing
3 changed files
with
9 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
target C; | ||
preamble {= | ||
int table[] = {4, 3, 2, 1}; | ||
=} | ||
reactor A(bank_index:int = 0, value:int = 0) { | ||
reaction (startup) {= | ||
printf("bank_index: %d, value: %d\n", self->bank_index, self->value); | ||
=} | ||
} | ||
main reactor { | ||
a = new[4] A(value = {= table[bank_index] =}); | ||
main reactor( | ||
table: int[] = {4, 3, 2, 1} | ||
) { | ||
a = new[4] A(value = {= self->table[bank_index] =}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
target Python; | ||
preamble {= | ||
table = [4, 3, 2, 1] | ||
=} | ||
reactor A(bank_index = 0, value = 0) { | ||
reaction (startup) {= | ||
print("bank_index: {:d}, value: {:d}".format(self.bank_index, self.value)) | ||
=} | ||
} | ||
main reactor { | ||
a = new[4] A(value = {= table[bank_index] =}) | ||
main reactor( | ||
table = [4, 3, 2, 1] | ||
) { | ||
a = new[4] A(value = {= self.table[bank_index] =}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters