Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
language:migrate [2020/08/03 11:38] – [Loops] rajit | language:migrate [2022/05/13 15:23] (current) – [Canonical names] rajit | ||
---|---|---|---|
Line 8: | Line 8: | ||
^ Purpose | ^ Purpose | ||
- | | Replicating ACT body constructs | (; i : range : items ) | (i : range : items ) | | + | | Replicating ACT body constructs | (; i : range : items ) // |
| Replicating ACT body or PRS | (: i : range : items ) | (i : range : items ) | | | Replicating ACT body or PRS | (: i : range : items ) | (i : range : items ) | | ||
- | | AND and OR PRS expressions | (: < | + | | AND and OR PRS expressions | (: < |
- | (Note: OR refers to the " | ||
==== Channel and data type bodies ==== | ==== Channel and data type bodies ==== | ||
- | The old ACT had channel and data type bodies for send/ | + | The old ACT had channel and data type bodies for send/ |
Line 22: | Line 21: | ||
The old ACT only had single-assignment parameters. So | The old ACT only had single-assignment parameters. So | ||
- | < | + | < |
pint x; | pint x; | ||
Line 29: | Line 28: | ||
</ | </ | ||
would result in an error. This was sometimes used to implement assertions. For example, if a parameter '' | would result in an error. This was sometimes used to implement assertions. For example, if a parameter '' | ||
- | < | + | < |
x=2*y; | x=2*y; | ||
</ | </ | ||
Line 35: | Line 34: | ||
The new ACT supports [[language: | The new ACT supports [[language: | ||
- | < | + | < |
{x=2*y}; | {x=2*y}; | ||
</ | </ | ||
If a more meaningful message is required, the following syntax is also supported: | If a more meaningful message is required, the following syntax is also supported: | ||
- | < | + | < |
{x=2*y : "This assertion failed" | {x=2*y : "This assertion failed" | ||
</ | </ | ||
Line 47: | Line 46: | ||
In the previous version of ACT, one could do the following: | In the previous version of ACT, one could do the following: | ||
- | < | + | < |
bool x[2][2]; | bool x[2][2]; | ||
bool y[2]; | bool y[2]; | ||
Line 53: | Line 52: | ||
x[0] = y; | x[0] = y; | ||
</ | </ | ||
- | Here, '' | + | Here, '' |
- | While this functionality is still useful, the new ACT will complain about the connection specified by saying | + | While this functionality is still useful, the new ACT will complain about the connection specified |
< | < | ||
Mismatch in array dimensions (1 v/s 2): x[0] | Mismatch in array dimensions (1 v/s 2): x[0] | ||
</ | </ | ||
Instead, you can get the same effect by saying: | Instead, you can get the same effect by saying: | ||
- | < | + | < |
x[0][0..1] = y; | x[0][0..1] = y; | ||
</ | </ | ||
With this syntax, the fact that '' | With this syntax, the fact that '' | ||
+ | |||
+ | ==== Canonical names ==== | ||
+ | |||
+ | When two signals are connected to each other, ACT picks one of them to be the canonical name for the signal and tracks the other names as aliases. In older versions, the canonical name was selected as the //outer most, shortest// name. Here, //outer most// means the name accessible with the fewest dots. So, for example, if you had an '' | ||
+ | <code act> | ||
+ | defproc test (e1of2 x) | ||
+ | { | ||
+ | bool y; | ||
+ | x.t = y; | ||
+ | } | ||
+ | </ | ||
+ | then the canonical Booleans would be '' | ||
+ | |||
+ | This could sometimes make port lists for processes hard to understand especially for tools that did not track all the aliases of a name. A much-requested feature was that names in the port list take precedence over internal signal names. In this particular example, that would mean that '' | ||
+ | |||
+ | The new ACT library now implements a different way to select the canonical name for a signal. In a particular process, there are three signal categories: globals, ports, and local signals. These are given priority during canonical name selection: a global has the highest priority, followed by ports, followed by local signal names. Arrays have higher priority than non-arrays (in an attempt to keep array structures unfragmented), | ||
+ | |||