Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:chp2prs [2025/10/14 02:54] – [Conditionals and Ternaries] karthitools: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 ''vi'' must evaluate to constants. There are no restrictions on ''P'', but some forms of ''P'' will lead to circuits that are much more expensive compared to others, as we will see later. Further, the channel implementation leads to all receives being passive and all sends being active. This means that (currently) only the receiving side may probe a channel. At the process level, the ports of a process may only be channels or Booleans (see section below on external constants for usage). 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 ''vi'' must evaluate to constants. There are no restrictions on ''P'', but some forms of ''P'' will lead to circuits that are much more expensive compared to others, as we will see later. Further, the channel implementation leads to all receives being passive and all sends being active. This means that (currently) only the receiving side may probe a channel. At the process level, the ports of a process may only be channels or Booleans (see section below on external constants for usage).
 +
 +===== Synthesis Commands =====
 +The standard synthesis steps to produce a bundled-data circuit looks like this:
 + <code>
 +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 
 +</code>
 +You can then simulate at PRS-level with:
 +<code>
 +actsim -ref=2 out.act ring_decomp_proc
 +</code>
 +
 +Note that user-defined channel-types are not allowed for synthesis. Only the built-in ''chan'' type is supported. The implementation of the channel is chosen during synthesis with the ''-C'' flag that chooses the datapath type. 
 +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:
 + <code>
 +synth2 -F ring -C bd -p proc -o out.act in.act 
 +</code>
 +and simulate at PRS-level with:
 +<code>
 +actsim -ref=1 out.act ring_proc
 +</code>
 +
 +This two-step process will soon be integrated into one command (TODO). To know more about what the ''-ref=n'' flags mean, please see this page: [[language:langs:refine|Refinement]].
  
 ===== Program Structure ===== ===== Program Structure =====
Line 167: Line 190:
  
 <code> <code>
-defproc neuron ( ... bool model[2] ) +defproc neuron ( ... bool model[2] ) 
 { {
 ... ...