Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/migen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 199800e8fcef
Choose a base ref
...
head repository: m-labs/migen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7427eeed394a
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 17, 2016

  1. platforms: add Lattice iCE40-HX8K-B-EVN.

    whitequark committed Oct 17, 2016
    Copy the full SHA
    41c4920 View commit details
  2. lattice: add IceStormProgrammer.load_bitstream.

    whitequark committed Oct 17, 2016
    Copy the full SHA
    7427eee View commit details
Showing with 45 additions and 2 deletions.
  1. +5 −2 migen/build/lattice/programmer.py
  2. +40 −0 migen/build/platforms/ice40_hx8k_b_evn.py
7 changes: 5 additions & 2 deletions migen/build/lattice/programmer.py
Original file line number Diff line number Diff line change
@@ -57,5 +57,8 @@ def load_bitstream(self, bitstream_file):
class IceStormProgrammer(GenericProgrammer):
needs_bitreverse = False

def flash(self, address, data_file):
subprocess.call(["iceprog", "-o", str(address), data_file])
def flash(self, address, bitstream_file):
subprocess.call(["iceprog", "-o", str(address), bitstream_file])

def load_bitstream(self, bitstream_file):
subprocess.call(["iceprog", "-S", bitstream_file])
40 changes: 40 additions & 0 deletions migen/build/platforms/ice40_hx8k_b_evn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from migen.build.generic_platform import *
from migen.build.lattice import LatticePlatform
from migen.build.lattice.programmer import IceStormProgrammer


_io = [
("user_led", 0, Pins("B5"), IOStandard("LVCMOS33")),
("user_led", 1, Pins("B4"), IOStandard("LVCMOS33")),
("user_led", 2, Pins("A2"), IOStandard("LVCMOS33")),
("user_led", 3, Pins("A1"), IOStandard("LVCMOS33")),
("user_led", 4, Pins("C5"), IOStandard("LVCMOS33")),
("user_led", 5, Pins("C4"), IOStandard("LVCMOS33")),
("user_led", 6, Pins("B3"), IOStandard("LVCMOS33")),
("user_led", 7, Pins("C3"), IOStandard("LVCMOS33")),

("serial", 0,
Subsignal("rx", Pins("B10")),
Subsignal("tx", Pins("B12"), Misc("PULLUP")),
Subsignal("rts", Pins("B13"), Misc("PULLUP")),
Subsignal("cts", Pins("A15"), Misc("PULLUP")),
Subsignal("dtr", Pins("A16"), Misc("PULLUP")),
Subsignal("dsr", Pins("B14"), Misc("PULLUP")),
Subsignal("dcd", Pins("B15"), Misc("PULLUP")),
IOStandard("LVCMOS33"),
),

("clk12", 0, Pins("J3"), IOStandard("LVCMOS33"))
]


class Platform(LatticePlatform):
default_clk_name = "clk12"
default_clk_period = 83.333

def __init__(self):
LatticePlatform.__init__(self, "ice40-8k-ct256", _io,
toolchain="icestorm")

def create_programmer(self):
return IceStormProgrammer()