remove working code, shrink "fail" case
[soclayout.git] / experiments2 / part_sig_add.py
1 from nmigen.cli import rtlil
2 from test_partsig import TestAddMod2
3 import subprocess
4 import os
5 from nmigen import Signal
6
7 def test():
8 width = 16
9 pmask = Signal(3) # divide into 4-bits
10 module = TestAddMod2(width, pmask)
11 sim = create_ilang(module,
12 [pmask,
13 module.a.sig,
14 module.b.sig,
15 module.add_output,
16 module.ls_output,
17 module.sub_output,
18 module.carry_in,
19 module.add_carry_out,
20 module.sub_carry_out,
21 module.neg_output,
22 ],
23 "part_sig_add")
24
25 def create_ilang(dut, ports, test_name):
26 vl = rtlil.convert(dut, name=test_name, ports=ports)
27 with open("%s.il" % test_name, "w") as f:
28 f.write(vl)
29
30 if __name__ == "__main__":
31 test()