diff options
| author | whitequark <whitequark@whitequark.org> | 2019-09-23 08:16:07 +0000 |
|---|---|---|
| committer | whitequark <whitequark@whitequark.org> | 2019-09-23 08:16:07 +0000 |
| commit | 52bcf5f6faa09e2ac74a4c446090215e89a8e0fa (patch) | |
| tree | 87d6190b1432b7194f58f4ee31e2dad651ca4676 /nmigen_boards/_blinky.py | |
| parent | dd87f472af92a73d18b3ef363603f20bd071306e (diff) | |
_blinky→test.blinky
Expose blinky as a stable component, to make writing out-of-tree
board files a bit nicer.
Diffstat (limited to 'nmigen_boards/_blinky.py')
| -rw-r--r-- | nmigen_boards/_blinky.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/nmigen_boards/_blinky.py b/nmigen_boards/_blinky.py deleted file mode 100644 index 4a173d4..0000000 --- a/nmigen_boards/_blinky.py +++ /dev/null @@ -1,27 +0,0 @@ -import itertools - -from nmigen import * -from nmigen.build import ResourceError - - -class Blinky(Elaboratable): - def elaborate(self, platform): - m = Module() - - leds = [] - for n in itertools.count(): - try: - leds.append(platform.request("led", n)) - except ResourceError: - break - leds = Cat(led.o for led in leds) - - clk_freq = platform.default_clk_frequency - 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) - with m.Else(): - m.d.sync += ctr.eq(ctr - 1) - - return m |
