Advertisement
Guest User

Untitled

a guest
Aug 6th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. from migen import *
  2. from migen.build.platforms import papilio_pro
  3.  
  4. from misoc.cores.uart.core import RS232PHY
  5.  
  6. import wishbonebridge
  7.  
  8. platform = papilio_pro.Platform()
  9.  
  10. class WBTest(Module):
  11.     def __init__(self):
  12.         counter = Signal(32)
  13.         self.sync += counter.eq(counter +1)
  14.         led = platform.request("user_led")
  15.         self.comb += led.eq(counter[25])
  16.  
  17.  
  18.         self.submodules.phy = RS232PHY(platform.request("serial"), 32000000, 115200)
  19.         self.submodules.bridge = wishbonebridge.WishboneStreamingBridge(self.submodules.phy, 32000000)
  20.         self.comb += [
  21.             self.bridge.wishbone.ack.eq(self.bridge.wishbone.stb),
  22.             self.bridge.wishbone.dat_r.eq(0xdeadbeef)
  23.         ]
  24.  
  25.  
  26. if __name__ == "__main__":
  27.  
  28.     top = WBTest()
  29.     platform.build(top, build_dir="wbtest")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement