Skip to content

Commit 01b819e

Browse files
committed
Add test to verilog
1 parent ecf1b14 commit 01b819e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: circt-opt -convert-fsm-to-sv -lower-seq-to-sv -export-verilog %s -o /dev/null | FileCheck %s
2+
3+
// Smoke test to verify single state lowering to verilog is supported.
4+
// CHECK: module top
5+
6+
fsm.machine @FSM(%arg0: i1, %arg1: i1) -> (i8) attributes {initialState = "A"} {
7+
%c_0 = hw.constant 0 : i8
8+
fsm.state @A output {
9+
fsm.output %c_0 : i8
10+
} transitions {
11+
fsm.transition @A
12+
}
13+
}
14+
15+
hw.module @top(in %arg0: i1, in %arg1: i1, in %clk : !seq.clock, in %rst : i1, out out: i8) {
16+
%out = fsm.hw_instance "fsm_inst" @FSM(%arg0, %arg1), clock %clk, reset %rst : (i1, i1) -> (i8)
17+
hw.output %out : i8
18+
}
19+

0 commit comments

Comments
 (0)