From 0a790b815c6860d0946ea59fbaef0c29baea0b70 Mon Sep 17 00:00:00 2001 From: occheung Date: Fri, 7 Aug 2020 21:12:15 +0800 Subject: [PATCH] humpback: added eem1 resources --- .cargo/config | 2 +- nmigen/humpback.py | 20 +++++++++++++++++--- shell.nix | 1 - 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.cargo/config b/.cargo/config index 86b3292..c0ce242 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,5 +1,5 @@ [target.thumbv7em-none-eabihf] -runner = "gdb -q -x gdb_config/openocd.gdb" +runner = "gdb -q -x gdb_config/fpga_config.gdb" rustflags = [ "-C", "link-arg=-Tlink.x", ] diff --git a/nmigen/humpback.py b/nmigen/humpback.py index f8d9c25..add03b0 100644 --- a/nmigen/humpback.py +++ b/nmigen/humpback.py @@ -295,6 +295,19 @@ class HumpbackPlatform(LatticeICE40Platform): }), ] + eem_to_urukul = [ + Resource("eem", 1, + Subsignal("sclk", DiffPairs("L6", "L3", dir="o", conn=("eem", 1))), + Subsignal("mosi", DiffPairs("H6", "F1", dir="o", conn=("eem", 1))), + Subsignal("miso", DiffPairs("H4", "G2", dir="i", conn=("eem", 1)), + Attrs(IO_STANDARD="SB_LVDS_INPUT")), + Subsignal("cs", DiffPairs("J4 J2 K1", "H2 J1 K3", dir="o", conn=("eem", 1))), + Subsignal("io_update", DiffPairs("L4", "L1", dir="o", conn=("eem", 1))), + Subsignal("sync_out", DiffPairs("K4", "M1", dir="o", conn=("emm", 1))), + Attrs(IO_STANDARD="SB_LVCMOS") + ) + ] + # tool chain setup, using default ICE40 HX8K evaluation code def toolchain_program(self, products, name): iceprog = os.environ.get("ICEPROG", "iceprog") @@ -302,7 +315,8 @@ class HumpbackPlatform(LatticeICE40Platform): subprocess.check_call([iceprog, "-S", bitstream_filename]) if __name__ == "__main__": - from nmigen_boards.test.blinky import * - HumpbackPlatform().build(Blinky(), do_program=False) - + from nmigen_boards.test.blinky import * + platform = HumpbackPlatform() + platform.add_resources(platform.eem_to_urukul) + platform.build(Blinky(), do_program=False) diff --git a/shell.nix b/shell.nix index aed53eb..b6189d7 100644 --- a/shell.nix +++ b/shell.nix @@ -71,7 +71,6 @@ in name = "nix-shell"; buildInputs = with rustPlatform.rust; [ (pkgs.python3.withPackages(ps: [nmigen nmigen-boards])) - pkgs.python3Packages.pandas pkgs.yosys pkgs.nextpnr pkgs.icestorm