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/nmigen-boards
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ec6316eb3341
Choose a base ref
...
head repository: m-labs/nmigen-boards
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c6e28e8cd43b
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Jun 5, 2019

  1. Simplify after changes in nmigen.

    whitequark committed Jun 5, 2019
    Copy the full SHA
    c6e28e8 View commit details
Showing with 8 additions and 8 deletions.
  1. +5 −5 nmigen_boards/_blinky.py
  2. +1 −1 nmigen_boards/ice40_hx1k_blink_evn.py
  3. +1 −1 nmigen_boards/icestick.py
  4. +1 −1 nmigen_boards/tinyfpga_bx.py
10 changes: 5 additions & 5 deletions nmigen_boards/_blinky.py
Original file line number Diff line number Diff line change
@@ -5,14 +5,14 @@


class Blinky(Elaboratable):
def __init__(self, clk_name, clk_freq):
def __init__(self, clk_name):
self.clk_name = clk_name
self.clk_freq = clk_freq

def elaborate(self, platform):
m = Module()

clk = platform.request(self.clk_name)
clk_freq = platform.get_clock_constraint(clk)
m.domains.sync = ClockDomain()
m.d.comb += ClockSignal().eq(clk.i)

@@ -24,7 +24,7 @@ def elaborate(self, platform):
break
leds = Cat(led.o for led in leds)

ctr = Signal(max=int(self.clk_freq//2), reset=int(self.clk_freq//2) - 1)
ctr = Signal(max=int(clk_freq//2), reset=int(clk_freq//2) - 1)
with m.If(ctr == 0):
m.d.sync += ctr.eq(ctr.reset)
m.d.sync += leds.eq(~leds)
@@ -34,5 +34,5 @@ def elaborate(self, platform):
return m


def build_and_program(platform_cls, clk_name, clk_freq, **kwargs):
platform_cls().build(Blinky(clk_name, clk_freq), do_program=True, **kwargs)
def build_and_program(platform_cls, clk_name, **kwargs):
platform_cls().build(Blinky(clk_name), do_program=True, **kwargs)
2 changes: 1 addition & 1 deletion nmigen_boards/ice40_hx1k_blink_evn.py
Original file line number Diff line number Diff line change
@@ -49,4 +49,4 @@ def toolchain_program(self, products, name):

if __name__ == "__main__":
from ._blinky import build_and_program
build_and_program(ICE40HX1KBlinkEVNPlatform, "clk3p3", 3.3e6)
build_and_program(ICE40HX1KBlinkEVNPlatform, "clk3p3")
2 changes: 1 addition & 1 deletion nmigen_boards/icestick.py
Original file line number Diff line number Diff line change
@@ -62,4 +62,4 @@ def toolchain_program(self, products, name):

if __name__ == "__main__":
from ._blinky import build_and_program
build_and_program(ICEStickPlatform, "clk12", 12e6)
build_and_program(ICEStickPlatform, "clk12")
2 changes: 1 addition & 1 deletion nmigen_boards/tinyfpga_bx.py
Original file line number Diff line number Diff line change
@@ -62,4 +62,4 @@ def toolchain_program(self, products, name):

if __name__ == "__main__":
from ._blinky import build_and_program
build_and_program(TinyFPGABXPlatform, "clk16", 16e6)
build_and_program(TinyFPGABXPlatform, "clk16")