examples: update for newer API.
authorwhitequark <cz@m-labs.hk>
Sat, 26 Jan 2019 16:25:05 +0000 (16:25 +0000)
committerwhitequark <cz@m-labs.hk>
Sat, 26 Jan 2019 16:25:05 +0000 (16:25 +0000)
examples/arst.py
examples/cdc.py
examples/ctr_ce.py
examples/por.py
examples/tbuf.py

index 22972f3d1045935f3566264aceb843a5ee3b778e..405857bcf94fcd548352274009ea65b77f0d1fae 100644 (file)
@@ -15,7 +15,7 @@ class ClockDivisor:
 
 
 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])
index 80b335e6bfc20862f5e5f35ea00c6ad0adf536bf..4f2dfad5fabf17232d6bc81f1b7e91b844604e25 100644 (file)
@@ -7,4 +7,4 @@ m = Module()
 m.submodules += MultiReg(i, o)
 
 if __name__ == "__main__":
-    main(m.lower(platform=None), ports=[i, o])
+    main(m, ports=[i, o])
index 6a7a0957c33f05380b90455cb9a68245c6040e1b..ebf1db02bde0cf097471c59aaec08049062698b4 100644 (file)
@@ -15,13 +15,11 @@ class Counter:
         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:
index 6c3c40f5ff308fb6f350a6eb2875dd863cf70ebf..28e860c5af3ffff3b25bc000d22f91c32b828faf 100644 (file)
@@ -16,4 +16,4 @@ m.d.comb += [
 ]
 
 if __name__ == "__main__":
-    main(m.lower(platform=None), ports=[cd_por.clk])
+    main(m, ports=[cd_por.clk])
index 4e19af0a0047b533530096675162c68c731285cb..5d3566fa4db9bca070b8751298614b1664e15862 100644 (file)
@@ -9,4 +9,4 @@ m = Module()
 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])