if __name__ == "__main__":
- ctr = ClockDivisor(factor=16)
- frag = ctr.elaborate(platform=None)
- frag.add_domains(ClockDomain("sync", async_reset=True))
- main(frag, ports=[ctr.o])
+ ctr = ClockDivisor(factor=16)
+ m = ctr.elaborate(platform=None)
+ m.domains += ClockDomain("sync", async_reset=True)
+ main(m, ports=[ctr.o])
m.submodules += MultiReg(i, o)
if __name__ == "__main__":
- main(m.lower(platform=None), ports=[i, o])
+ main(m, ports=[i, o])
return CEInserter(self.ce)(m.lower(platform))
-ctr = Counter(width=16)
-frag = ctr.elaborate(platform=None)
+ctr = Counter(width=16)
-# print(rtlil.convert(frag, ports=[ctr.o, ctr.ce]))
-print(verilog.convert(frag, ports=[ctr.o, ctr.ce]))
+print(verilog.convert(ctr, ports=[ctr.o, ctr.ce]))
-with pysim.Simulator(frag,
+with pysim.Simulator(ctr,
vcd_file=open("ctrl.vcd", "w"),
gtkw_file=open("ctrl.gtkw", "w"),
traces=[ctr.ce, ctr.v, ctr.o]) as sim:
]
if __name__ == "__main__":
- main(m.lower(platform=None), ports=[cd_por.clk])
+ main(m, ports=[cd_por.clk])
m.submodules += pin_t.get_tristate(pin)
if __name__ == "__main__":
- main(m.lower(platform=None), ports=[pin, pin_t.oe, pin_t.i, pin_t.o])
+ main(m, ports=[pin, pin_t.oe, pin_t.i, pin_t.o])