|
10 | 10 | // declarations.
|
11 | 11 | //
|
12 | 12 | //===----------------------------------------------------------------------===//
|
| 13 | +include "circt/Dialect/LTL/LTLTypes.td" |
13 | 14 |
|
14 | 15 | /// Immediate assertions, like `assert`.
|
15 | 16 | def ImmediateAssert: I32EnumAttrCase<"Immediate", 0, "immediate">;
|
@@ -159,3 +160,56 @@ def CoverConcurrentOp : ConcurrentVerifOp<"cover.concurrent",
|
159 | 160 | section 16.5 of the SystemVerilog 2017 specification.
|
160 | 161 | }];
|
161 | 162 | }
|
| 163 | + |
| 164 | + |
| 165 | +/// Property Assertions/Assumptions/Cover analogous to SVA property verification ops. |
| 166 | +class PropertyVerifOp<string mnemonic, list<Trait> traits = [AttrSizedOperandSegments]> : |
| 167 | + SVOp<mnemonic, traits> { |
| 168 | + let arguments = (ins |
| 169 | + LTLAnyPropertyType:$property, |
| 170 | + OptionalAttr<EventControlAttr>:$event, Optional<I1>:$clock, |
| 171 | + Optional<I1>:$disable, |
| 172 | + OptionalAttr<StrAttr>:$label); |
| 173 | + |
| 174 | + let assemblyFormat = [{ |
| 175 | + $property (`on` $event^)? ($clock^)? (`disable_iff` $disable^)? |
| 176 | + (`label` $label^)? attr-dict `:` type($property) |
| 177 | + }]; |
| 178 | + |
| 179 | + let builders = [ |
| 180 | + // no clock or event |
| 181 | + OpBuilder<(ins "mlir::Value":$property, |
| 182 | + "mlir::Value":$disable, |
| 183 | + CArg<"StringAttr","StringAttr()">: $label), |
| 184 | + [{ build(odsBuilder, odsState, property, EventControlAttr{}, Value(), disable, label); }]> |
| 185 | + ]; |
| 186 | + |
| 187 | + let hasVerifier = true; |
| 188 | +} |
| 189 | + |
| 190 | +def AssertPropertyOp : PropertyVerifOp<"assert_property"> { |
| 191 | + let summary = "property assertion -- can be disabled and clocked"; |
| 192 | + let description = [{ |
| 193 | + Assert that a given SVA-style property holds. This is only checked when |
| 194 | + the disable signal is low and a clock event occurs. This is analogous to |
| 195 | + the verif.assert operation, but with a flipped enable polarity. |
| 196 | + }]; |
| 197 | +} |
| 198 | + |
| 199 | +def AssumePropertyOp : PropertyVerifOp<"assume_property"> { |
| 200 | + let summary = "property assumption -- can be disabled and clocked"; |
| 201 | + let description = [{ |
| 202 | + Assume that a given SVA-style property holds. This is only considered when |
| 203 | + the disable signal is low and a clock event occurs. This is analogous to |
| 204 | + the verif.assume operation, but with a flipped enable polarity. |
| 205 | + }]; |
| 206 | +} |
| 207 | + |
| 208 | +def CoverPropertyOp : PropertyVerifOp<"cover_property"> { |
| 209 | + let summary = "property cover point -- can be disabled and clocked"; |
| 210 | + let description = [{ |
| 211 | + Cover when a given SVA-style property holds. This is only checked when |
| 212 | + the disable signal is low and a clock event occurs. This is analogous to |
| 213 | + the verif.cover operation, but with a flipped enable polarity. |
| 214 | + }]; |
| 215 | +} |
0 commit comments