Skip to content

Commit 8d18250

Browse files
committedFeb 3, 2023
CI: add an end-to-end test for Verilog conversion.
1 parent 6f68600 commit 8d18250

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
 

‎.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
run: |
4646
pip install dist/amaranth_yosys-*.whl
4747
python -m amaranth_yosys --help
48+
python -m amaranth_yosys \
49+
-p "read_ilang tests/inverter.il" \
50+
-p "proc -nomux" \
51+
-p "memory_collect" \
52+
-p "write_verilog"
4853
- name: Print ccache statistics
4954
run: |
5055
ccache -s

‎tests/inverter.il

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
attribute \generator "Amaranth"
2+
attribute \top 1
3+
attribute \amaranth.hierarchy "top"
4+
module \top
5+
attribute \src "<stdin>:1"
6+
wire width 1 input 0 \i
7+
attribute \init 1'0
8+
attribute \src "<stdin>:1"
9+
wire width 1 output 1 \o
10+
attribute \src "<stdin>:1"
11+
wire width 1 \o$next
12+
attribute \src "/home/whitequark/Projects/amaranth/amaranth/hdl/ir.py:527"
13+
wire width 1 input 2 \clk
14+
attribute \src "/home/whitequark/Projects/amaranth/amaranth/hdl/ir.py:527"
15+
wire width 1 input 3 \rst
16+
attribute \src "<stdin>:1"
17+
wire width 1 $1
18+
attribute \src "<stdin>:1"
19+
cell $not $2
20+
parameter \A_SIGNED 0
21+
parameter \A_WIDTH 1
22+
parameter \Y_WIDTH 1
23+
connect \A \i
24+
connect \Y $1
25+
end
26+
process $group_0
27+
assign \o$next \o
28+
assign \o$next $1
29+
attribute \src "/home/whitequark/Projects/amaranth/amaranth/hdl/xfrm.py:516"
30+
switch \rst
31+
case 1'1
32+
assign \o$next 1'0
33+
end
34+
end
35+
cell $dff $3
36+
parameter \CLK_POLARITY 1
37+
parameter \WIDTH 1
38+
connect \CLK \clk
39+
connect \D \o$next
40+
connect \Q \o
41+
end
42+
end

0 commit comments

Comments
 (0)