Advertisement
Guest User

Untitled

a guest
May 9th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. from nmigen import *
  2. from nmigen.build import Platform
  3. from numato_mimas_v2 import *
  4.  
  5. class TestLEDModule(Elaboratable):
  6.   def __init__(self):
  7.     self.count = Signal(32, reset = 0)
  8.  
  9.   def elaborate(self, platform: Platform) -> Module:
  10.     m = Module()
  11.     m.d.sync += self.count.eq(self.count + 1)
  12.     if platform is not None:
  13.       led = platform.request('led', 1)
  14.       m.d.comb += led.o.eq(self.count[20])
  15.  
  16.     return m
  17.  
  18. if __name__ == "__main__":
  19.   NumatoMimasV2Platform().build(TestLEDModule())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement