Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tools:chp2prs [2025/10/14 02:33] – [Dynamic Array Accesses] karthi | tools:chp2prs [2025/11/04 03:06] (current) – [External Constants] karthi | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| i.e. a (possibly empty) semi-colon separated list of initializations to a subset of variables used in the CHP, followed by an infinite repetition of an arbitrary CHP program P. The values '' | i.e. a (possibly empty) semi-colon separated list of initializations to a subset of variables used in the CHP, followed by an infinite repetition of an arbitrary CHP program P. The values '' | ||
| + | |||
| + | ===== Synthesis Commands ===== | ||
| + | The standard synthesis steps to produce a bundled-data circuit looks like this: | ||
| + | < | ||
| + | synth2 -F decomp -p proc -o mid.act in.act | ||
| + | synth2 -F ring -ref=1 -C bd -p decomp_proc -o out.act mid.act | ||
| + | </ | ||
| + | You can then simulate at PRS-level with: | ||
| + | < | ||
| + | actsim -ref=2 out.act ring_decomp_proc | ||
| + | </ | ||
| + | |||
| + | Note that user-defined channel-types are not allowed for synthesis. Only the built-in '' | ||
| + | If your CHP has no nested loops or multiple-channel accesses (more about this below), then you can (optionally) skip the first step and directly do: | ||
| + | < | ||
| + | synth2 -F ring -C bd -p proc -o out.act in.act | ||
| + | </ | ||
| + | and simulate at PRS-level with: | ||
| + | < | ||
| + | actsim -ref=1 out.act ring_proc | ||
| + | </ | ||
| + | |||
| + | This two-step process will soon be integrated into one command (TODO). To know more about what the '' | ||
| ===== Program Structure ===== | ===== Program Structure ===== | ||
| Line 74: | Line 97: | ||
| < | < | ||
| - | [ c -> y: | + | [ c -> y: |
| []else -> y:=0 | []else -> y:=0 | ||
| ] | ] | ||
| Line 162: | Line 185: | ||
| ===== External Constants ===== | ===== External Constants ===== | ||
| - | To Do... | + | Maelstrom allows Booleans as input ports to any process to facilitate chip-level configuration bits. These booleans are assumed to be constant for the entire runtime of the circuit, i.e. these are set to a certain value before or during chip reset and never changed after that. Hence, these Booleans are also not latched, the values on the wires are used directly as if they are logical constants, such as '' |
| + | |||
| + | These are useful for global configuration. For example, consider a neuromorphic core where the state-update functions of all the neurons need to be set to something. Instead of sending a config bit to each of the potentially thousands of neurons, one can simply use a '' | ||
| + | |||
| + | < | ||
| + | defproc neuron ( ... ; bool model[2] ) | ||
| + | { | ||
| + | ... | ||
| + | chp | ||
| + | { | ||
| + | *[ | ||
| + | ... | ||
| + | [ ~model[0] & ~model[1] -> state := lif(state) | ||
| + | []~model[0] & model[1] -> state := aif(state) | ||
| + | [] model[0] & ~model[1] -> state := hodg_hux(state) | ||
| + | [] model[0] & model[1] -> state := izhikevich(state) | ||
| + | ]; | ||
| + | ... | ||
| + | ] | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| ===== Nested Loop Constructs ===== | ===== Nested Loop Constructs ===== | ||