Skip to content

Commit

Permalink
[FIRRTL][NFC] Use underscores in documentation. (llvm#6860)
Browse files Browse the repository at this point in the history
In the only supported mechanism for using intrinsics,
the name must be an identifier so just document that.

Periods are nice, we can adjust the FIRRTL grammar / syntax
to allow this in the future if we miss them.
  • Loading branch information
dtzSiFive authored and cepheus69 committed Apr 22, 2024
1 parent a5a34c5 commit 1ed8e74
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions docs/Dialects/FIRRTL/FIRRTLIntrinsics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Intrinsics provide an implementation-specific way to extend the FIRRTL language
with new operations.

Intrinsics are currently implemented as annotated external modules. We expect
that native FIRRTL support for intrinsics will be added to the language.
Intrinsics are currently implemented as `intmodule`'s.

## Motivation

Expand All @@ -15,15 +14,8 @@ and type checking.

## Supported Intrinsics

Annotations here are written in their JSON format. A "reference target"
indicates that the annotation could target any object in the hierarchy,
although there may be further restrictions in the annotation.

We also accept the `intmodule` version of any of these annotation strings used
as the intrinsic name. To work with the requirement of the intrinsic name being
an identifier, replace any period is with an underscore in the intrinsic name.

### circt.sizeof
### circt_sizeof

Returns the size of a type. The input port is not read from and may be any
type, including uninferred types.
Expand All @@ -36,7 +28,7 @@ type, including uninferred types.
| i | input | Any | value whose type is to be returned |
| size | output | UInt<32> | Size of type of i |

### circt.isX
### circt_isX

Tests if the value is a literal `x`. FIRRTL doesn't have a notion of 'x per-se,
but x can come in to the system from external modules and from SV constructs.
Expand All @@ -50,7 +42,7 @@ Verification constructs need to explicitly test for 'x.
| i | input | Any | value test |
| found | output | UInt<1> | i is `x` |

### circt.plusargs.value
### circt_plusargs_value

Tests and extracts a value from simulator command line options with SystemVerilog
`$value$plusargs`. This is described in SystemVerilog 2012 section 21.6.
Expand All @@ -67,7 +59,7 @@ type of the result.
| found | output | UInt<1> | found in args |
| result | output | AnyType | found in args |

### circt.plusargs.test
### circt_plusargs_test

Tests simulator command line options with SystemVerilog `$test$plusargs`. This
is described in SystemVerilog 2012 section 21.6.
Expand All @@ -80,7 +72,7 @@ is described in SystemVerilog 2012 section 21.6.
| ---------- | --------- | -------- | ----------------------------------- |
| found | output | UInt<1> | found in args |

### circt.clock_gate
### circt_clock_gate

Enables and disables a clock safely, without glitches, based on a boolean enable value. If the enable input is 1, the output clock produced by the clock gate is identical to the input clock. If the enable input is 0, the output clock is a constant zero.

Expand All @@ -95,7 +87,7 @@ The enable input is sampled at the rising edge of the input clock; any changes o
| en | input | UInt<1> | enable for the output clock |
| out | output | Clock | gated output clock |

### circt.chisel_assert
### circt_chisel_assert

Generate a clocked SV assert statement, with optional formatted error message.

Expand All @@ -118,7 +110,7 @@ wire _GEN = ~enable | cond;
assert__label: assert property (@(posedge clock) _GEN) else $error("message");
```

### circt.chisel_ifelsefatal
### circt_chisel_ifelsefatal

Generate a particular Verilog sequence that's similar to an assertion.

Expand Down Expand Up @@ -152,7 +144,7 @@ Example SV output:
`endif // not def SYNTHESIS
```

### circt.chisel_assume
### circt_chisel_assume

Generate a clocked SV assume statement, with optional formatted error message.

Expand All @@ -175,7 +167,7 @@ Example SV output:
assume__label: assume property (@(posedge clock) ~enable | cond) else $error("message");
```

### circt.chisel_cover
### circt_chisel_cover

Generate a clocked SV cover statement.

Expand All @@ -195,7 +187,7 @@ Example SV output:
cover__label: cover property (@(posedge clock) enable & cond);
```

### circt.unclocked_assume
### circt_unclocked_assume

Generate a SV assume statement whose predicate is used in a sensitivity list of the enclosing always block.

Expand Down

0 comments on commit 1ed8e74

Please sign in to comment.