vendor.ice40_hx1k_blink_evn: implement.

This commit is contained in:
whitequark 2019-06-01 16:47:47 +00:00
parent eab372383a
commit ba0fcddb2c
2 changed files with 47 additions and 0 deletions

21
examples/blinky.py Normal file
View file

@ -0,0 +1,21 @@
from nmigen import *
from nmigen.vendor.ice40_hx1k_blink_evn import *
class Blinky(Elaboratable):
def elaborate(self, platform):
clk3p3 = platform.request("clk3p3", 0)
user_led = platform.request("user_led", 0)
counter = Signal(20)
m = Module()
m.domains.sync = ClockDomain()
m.d.comb += ClockSignal().eq(clk3p3.i)
m.d.sync += counter.eq(counter + 1)
m.d.comb += user_led.o.eq(counter[-1])
return m
if __name__ == "__main__":
platform = ICE40HX1KBlinkEVNPlatform()
platform.build(Blinky(), do_program=True)