From b2975db7602be29830511c0e1f60a0bab037f945 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 13 Nov 2021 19:45:57 +0000 Subject: [PATCH] add clock/reset to dummy platform, now sync domain exists --- src/spec/testing_stage1.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/spec/testing_stage1.py b/src/spec/testing_stage1.py index 2b26424..7de2ef2 100644 --- a/src/spec/testing_stage1.py +++ b/src/spec/testing_stage1.py @@ -55,6 +55,10 @@ def create_resources(pinset): ios.append(Subsignal(pname, Pins(pname, assert_width=1))) resources.append(Resource.family(periph, 0, default_name="gpio", ios=ios)) + + # add clock and reset + resources.append(Resource("clk", 0, Pins("sys_clk", dir="i"))) + resources.append(Resource("rst", 0, Pins("sys_rst", dir="i"))) return resources @@ -80,7 +84,7 @@ class Blinker(Elaboratable): def elaborate(self, platform): m = Module() count = Signal(5) - m.d.comb += count.eq(5) + m.d.sync += count.eq(5) print ("resources", platform.resources.items()) gpio = platform.request("gpio", 0) print (gpio, gpio.layout, gpio.fields) @@ -126,6 +130,8 @@ class DummyPlatform(TemplatedPlatform): """, } toolchain = None + default_clk = "clk" # should be picked up / overridden by platform sys.clk + default_rst = "rst" # should be picked up / overridden by platform sys.rst def __init__(self, resources): super().__init__() self.add_resources(resources) -- 2.30.2