From 18315d8efc4b2d0569ff1abf19a92f495de7745d Mon Sep 17 00:00:00 2001 From: WRansohoff Date: Sun, 22 Mar 2020 21:14:44 -0400 Subject: Add Upduino v1/v2. --- nmigen_boards/upduino_v2.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 nmigen_boards/upduino_v2.py (limited to 'nmigen_boards/upduino_v2.py') diff --git a/nmigen_boards/upduino_v2.py b/nmigen_boards/upduino_v2.py new file mode 100644 index 0000000..aebb04c --- /dev/null +++ b/nmigen_boards/upduino_v2.py @@ -0,0 +1,30 @@ +import os +import subprocess + +from nmigen.build import * +from nmigen.vendor.lattice_ice40 import * +from .resources import * +from .upduino_v1 import UpduinoV1Platform + + +__all__ = ["UpduinoV2Platform"] + + +class UpduinoV2Platform(UpduinoV1Platform): + # Mostly identical to the V1 board, but it has an integrated + # programmer and a 12MHz oscillator which is NC by default. + resources = UpduinoV1Platform.resources + [ + # Solder pin 12 to the adjacent 'J8' osc_out pin to enable. + Resource("clk12", 0, Pins("12", dir="i"), + Clock(12e6), Attrs(IO_STANDARD="SB_LVCMOS")), + ] + + def toolchain_program(self, products, name): + iceprog = os.environ.get("ICEPROG", "iceprog") + with products.extract("{}.bin".format(name)) as bitstream_filename: + subprocess.check_call([iceprog, bitstream_filename]) + + +if __name__ == "__main__": + from .test.blinky import * + UpduinoV2Platform().build(Blinky(), do_program=True) -- cgit v1.2.3