Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
language:langs:refine [2022/06/23 19:35] rajit created |
language:langs:refine [2022/09/16 08:54] rajit |
||
---|---|---|---|
Line 9: | Line 9: | ||
</ | </ | ||
- | This is used to provide an implementation of a process that replaces the CHP, dataflow, HSE, or PRS body. | + | This is used to provide an implementation of a process that replaces the CHP, dataflow, HSE, or PRS body. For example, imagine you had a process defined at the CHP level |
+ | <code act> | ||
+ | defproc example (...) | ||
+ | { | ||
+ | int x; | ||
+ | chp { | ||
+ | *[ L?x; R!x ] | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | You can include its production-rule level description in the same process definition, as follows: | ||
+ | |||
+ | <code act> | ||
+ | defproc example (...) | ||
+ | { | ||
+ | ... | ||
+ | chp { | ||
+ | *[ L?x; R!x ] | ||
+ | } | ||
+ | prs { | ||
+ | // circuit goes here | ||
+ | } | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Now imagine that instead of writing the production rules directly, you'd like to instantiate a set of gates to implement the circuit. If you wrote: | ||
+ | <code act> | ||
+ | defproc example(...) | ||
+ | { | ||
+ | ... | ||
+ | chp { | ||
+ | *[ L?x; R!x ] | ||
+ | } | ||
+ | inst1 i1; | ||
+ | inst2 i2; | ||
+ | // the other instances and connctions... | ||
+ | } | ||
+ | </ | ||
+ | then this means that the process has a CHP definition, and //in addition// it has the specified instances! This is not what was intended; we'd like to use the CHP definition //or// the instances. To provide support for this, the '' | ||
+ | <code act> | ||
+ | defproc example(...) | ||
+ | { | ||
+ | ... | ||
+ | chp { | ||
+ | *[ L?x; R!x ] | ||
+ | } | ||
+ | refine { | ||
+ | inst1 i1; | ||
+ | inst2 i2; | ||
+ | // the other instances and connctions... | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | Now you can //pick// the refined version of the process by using the ACT command-line option '' |