From cdf3de0ceb7e41a0fae8ae7aa874035aa8ac27f6 Mon Sep 17 00:00:00 2001 From: Simon Kirkby Date: Tue, 4 Jun 2019 08:32:07 +0800 Subject: [PATCH] fix global , and allow easy subclassing of Platform --- nmigen/build/plat.py | 6 ++++++ nmigen/vendor/board/tinyfpga_bx.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nmigen/build/plat.py b/nmigen/build/plat.py index fe8d32b3..c3bac998 100644 --- a/nmigen/build/plat.py +++ b/nmigen/build/plat.py @@ -85,6 +85,12 @@ def __init__(self): self._prepared = False + self.extend() + + def extend(self): + "add resources and config in subclass" + pass + def add_file(self, filename, content): if not isinstance(filename, str): raise TypeError("File name must be a string") diff --git a/nmigen/vendor/board/tinyfpga_bx.py b/nmigen/vendor/board/tinyfpga_bx.py index 2c821464..9afb1dcd 100644 --- a/nmigen/vendor/board/tinyfpga_bx.py +++ b/nmigen/vendor/board/tinyfpga_bx.py @@ -13,7 +13,7 @@ class TinyFPGABXPlatform(TinyProgrammerMixin, LatticeICE40Platform): ] resources = [ Resource("clk16", 0, Pins("B2", dir="i"), - extras={"GLOBAL": 1, "IO_STANDARD": "SB_LVCMOS33"}), + extras={"GLOBAL": "1", "IO_STANDARD": "SB_LVCMOS33"}), Resource("user_led", 0, Pins("B3", dir="o"), extras={"IO_STANDARD": "SB_LVCMOS33"}),