Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| language:langs:refine [2024/08/11 10:21] – rajit | language:langs:refine [2025/07/21 19:47] (current) – [Multiple refinement options] rajit | ||
|---|---|---|---|
| Line 73: | Line 73: | ||
| ===== Nested refinements ===== | ===== Nested refinements ===== | ||
| + | Since '' | ||
| + | Hence, you can say: | ||
| + | |||
| + | <code act> | ||
| + | refine { | ||
| + | inst i1; | ||
| + | chp { ... } | ||
| + | refine { inst i2; } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | When ACT selects the outer refinement block for the process, it decrements the refinement level before proceeding; the level is restored at the end of the refinement block. Hence, if '' | ||
| + | the block: | ||
| + | <code act> | ||
| + | inst i1; | ||
| + | chp { ... } | ||
| + | refine { inst i2; } | ||
| + | </ | ||
| + | would be processed with the refinement level set to zero; hence, the '' | ||
| + | not the nested refinement. To replace the CHP with the nested refinement block, use '' | ||
| + | | ||
| ===== Multiple refinement options ===== | ===== Multiple refinement options ===== | ||
| + | While the nested refinement approach works nicely when designs are recursively refined, it may not | ||
| + | be suitable for transformations where an existing refinement block needs to be completely replaced. | ||
| + | ACT has a mechanism to support this in the following manner: | ||
| + | |||
| + | <code act> | ||
| + | refine { | ||
| + | inst i1; | ||
| + | chp { ... } | ||
| + | } | ||
| + | refine< | ||
| + | inst j1; | ||
| + | prs { ... } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | In this case, the '' | ||
| + | instance '' | ||
| + | |||
| + | ===== Refinement overrides ===== | ||
| + | |||
| + | Sometimes a refinement body needs to [[language: | ||
| + | |||
| + | The syntax for providing refinement overrides is below: | ||
| + | |||
| + | <code act> | ||
| + | refine< | ||
| + | inst1 i1; | ||
| + | ... | ||
| + | } | ||
| + | </ | ||
| + | This will apply the refinement override for '' | ||