diff --git a/include/circt/Dialect/HW/HWStructure.td b/include/circt/Dialect/HW/HWStructure.td index d038eb60cfa1..07d92fc3b1ab 100644 --- a/include/circt/Dialect/HW/HWStructure.td +++ b/include/circt/Dialect/HW/HWStructure.td @@ -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 = [{ diff --git a/test/Conversion/HWToSV/test_trigger.mlir b/test/Conversion/HWToSV/test_trigger.mlir index a9cfb1334652..5c942f3f2c67 100644 --- a/test/Conversion/HWToSV/test_trigger.mlir +++ b/test/Conversion/HWToSV/test_trigger.mlir @@ -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"() : () -> () + } + +}