Skip to content

Commit

Permalink
Make hw.triggered argument list optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
fzi-hielscher committed Jul 9, 2024
1 parent 2e17355 commit 4045730
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/circt/Dialect/HW/HWStructure.td
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def TriggeredOp : HWOp<"triggered", [
let results = (outs);

let assemblyFormat = [{
$event $trigger `(` $inputs `)` `:` type($inputs) $body attr-dict
$event $trigger (`(` $inputs^ `)` `:` type($inputs))? $body attr-dict
}];

let extraClassDeclaration = [{
Expand Down
10 changes: 10 additions & 0 deletions test/Conversion/HWToSV/test_trigger.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ hw.module @foo(in %trigger : i1, in %in : i32) {
"some.user" (%arg0) : (i32) -> ()
}
}

hw.module @bar(in %trigger : i1) {
// CHECK: sv.always posedge %trigger {
// CHECK-NEXT: "some.user"() : () -> ()
// CHECK-NEXT: }
hw.triggered posedge %trigger {
"some.user"() : () -> ()
}

}

0 comments on commit 4045730

Please sign in to comment.