examples: update for newer API.
This commit is contained in:
parent
b133eb735f
commit
7acea8f3ce
|
@ -15,7 +15,7 @@ class ClockDivisor:
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
ctr = ClockDivisor(factor=16)
|
ctr = ClockDivisor(factor=16)
|
||||||
frag = ctr.elaborate(platform=None)
|
m = ctr.elaborate(platform=None)
|
||||||
frag.add_domains(ClockDomain("sync", async_reset=True))
|
m.domains += ClockDomain("sync", async_reset=True)
|
||||||
main(frag, ports=[ctr.o])
|
main(m, ports=[ctr.o])
|
||||||
|
|
|
@ -7,4 +7,4 @@ m = Module()
|
||||||
m.submodules += MultiReg(i, o)
|
m.submodules += MultiReg(i, o)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(m.lower(platform=None), ports=[i, o])
|
main(m, ports=[i, o])
|
||||||
|
|
|
@ -15,13 +15,11 @@ class Counter:
|
||||||
return CEInserter(self.ce)(m.lower(platform))
|
return CEInserter(self.ce)(m.lower(platform))
|
||||||
|
|
||||||
|
|
||||||
ctr = Counter(width=16)
|
ctr = Counter(width=16)
|
||||||
frag = ctr.elaborate(platform=None)
|
|
||||||
|
|
||||||
# print(rtlil.convert(frag, ports=[ctr.o, ctr.ce]))
|
print(verilog.convert(ctr, ports=[ctr.o, ctr.ce]))
|
||||||
print(verilog.convert(frag, ports=[ctr.o, ctr.ce]))
|
|
||||||
|
|
||||||
with pysim.Simulator(frag,
|
with pysim.Simulator(ctr,
|
||||||
vcd_file=open("ctrl.vcd", "w"),
|
vcd_file=open("ctrl.vcd", "w"),
|
||||||
gtkw_file=open("ctrl.gtkw", "w"),
|
gtkw_file=open("ctrl.gtkw", "w"),
|
||||||
traces=[ctr.ce, ctr.v, ctr.o]) as sim:
|
traces=[ctr.ce, ctr.v, ctr.o]) as sim:
|
||||||
|
|
|
@ -16,4 +16,4 @@ m.d.comb += [
|
||||||
]
|
]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(m.lower(platform=None), ports=[cd_por.clk])
|
main(m, ports=[cd_por.clk])
|
||||||
|
|
|
@ -9,4 +9,4 @@ m = Module()
|
||||||
m.submodules += pin_t.get_tristate(pin)
|
m.submodules += pin_t.get_tristate(pin)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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])
|
||||||
|
|
Loading…
Reference in a new issue