2 from nmigen
.cli
import rtlil
5 class ADD(Elaboratable
):
6 def __init__(self
, width
):
11 def elaborate(self
, platform
):
13 m
.d
.sync
+= self
.f
.eq(self
.a
+ self
.b
)
18 #sram = Instance("SPBlock_512W64B8W", i_a=a, o_q=q, i_d=d, i_we=we)
23 def create_ilang(dut
, ports
, test_name
):
24 vl
= rtlil
.convert(dut
, name
=test_name
, ports
=ports
)
25 with
open("%s.il" % test_name
, "w") as f
:
28 if __name__
== "__main__":
30 create_ilang(alu
, [alu
.a
, alu
.b
, alu
.f
], "memory")