Skip to content

Commit

Permalink
Remove @static from docs (#1911)
Browse files Browse the repository at this point in the history
* language reference

* clarification

* tell static is deprecated
  • Loading branch information
calebmkim authored Feb 12, 2024
1 parent d94ce93 commit 46b0f77
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions docs/lang/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ cells {

#### **Group Attributes**
```
group cond<"static"=1> {
group cond<"promotable"=1> {
...
}
```

#### **Control Attributes**
```
control {
@static(3) seq {
@static(1) A;
@static(2) B;
@promotable(3) seq {
@promotable(1) A;
@promotable(2) B;
}
}
```
Expand Down Expand Up @@ -70,14 +70,26 @@ It has two meanings:
2. If the cell is a memory and has an `external` attribute on it, the Verilog backend (`-b verilog`) generates code to read `<cell_name>.dat` to initialize the memory state and dumps out its final value after execution.

### `static(n)`
Can be attached to components, groups, and control statements. They indicate how
many cycles a component, group, or control statement will take to run and are used
by `-p static-timing` to generate more efficient control FSMs.

The `go` and `done` attributes are, in particular, used by the `infer-static-timing` pass to configure which ports are used like
`go` and `done` signals.
Along with the `static(n)` attribute, this allows the pass to calculate when
a particular done signal of a primitive will be high.
This is now deprecated. See the [promotable][promotable] and [interval][interval]
attributes.

### `promotable(n)`
Can be attached to groups, control, and `@go` ports of components.
This tells the compiler how long the group/control would take if it were promoted
to static.
This is just a hint, and is free to be ignored by the compiler.
However, the compiler may use it in the `static-promotion` pass to upgrade dynamic
constructs to `static<n>` ones.

### `interval(n)`
This can be attached to the `@go` ports of dynamic components (both primitives or
Calyx-defined components).
This tells the compiler that if you assert the `@go` port for cycles `[0,n)`, then
the done signal will be asserted on cycle `n`.
This is different from `@promotable` since it provides a guarantee rather than a hint.
Attach `@interval` to `@go` ports essentially means that the component can serve
"double duty": it can be used in both static and dynamic contexts.
This is common for things like registers.

### `inline`
Used by the `inline` pass on cell definitions. Instructs the pass to completely
Expand Down Expand Up @@ -202,4 +214,6 @@ Since the value `'x` can be replaced with anything.

[datapath-components]: https://github.com/calyxir/calyx/issues/1169
[builder]: https://docs.rs/calyx-ir/latest/calyx_ir/struct.Builder.html
[externalize]: https://docs.rs/calyx-opt/latest/calyx_opt/passes/struct.Externalize.html
[externalize]: https://docs.rs/calyx-opt/latest/calyx_opt/passes/struct.Externalize.html
[promotable]: #promotable(n)
[interval]: #interval(n)

0 comments on commit 46b0f77

Please sign in to comment.