Advertisement
Guest User

Untitled

a guest
Mar 14th, 2020
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. from nmigen import *
  2. from nmigen_boards import ecp5_5g_evn as FPGA
  3.  
  4. class Test(Elaboratable):
  5.     def __init__(self, out=Signal()):
  6.         self.out = out
  7.         self.ports = [
  8.             self.out,
  9.         ]
  10.  
  11.     def elaborate(self, platform):
  12.         m = Module()
  13.         m.d.sync += self.out.eq(~self.out)
  14.         return m
  15.  
  16. class MCVE(Elaboratable):
  17.     def elaborate(self, platform):
  18.         m = Module()
  19.        
  20.         s = Signal(4)
  21.         for i in range(0, 4):
  22.             m.submodules += Test(s[i])
  23.        
  24.         return m
  25. FPGA.ECP55GEVNPlatform().build(MCVE(), do_program=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement