Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 10th, 2013  |  syntax: None  |  size: 0.44 KB  |  views: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. lrclk = Signal()
  2. bclk = Signal()
  3. data = Signal()
  4.  
  5. def counter():
  6.     for i in range(1000):
  7.         yield Token("source", {"value": i})
  8.  
  9. source = SimActor(counter(), ("source", Source, [("value", 16)]))
  10. conv = DownConverter(16, 1)
  11. i2s = I2S(1, lrclk, bclk, data)
  12.  
  13. g = DataFlowGraph()
  14. g.add_connection(source, conv)
  15. g.add_connection(conv, i2s)
  16. comp = CompositeActor(g)
  17. sim = Simulator(comp.get_fragment(), TopLevel("my.vcd"))
  18. sim.run(500)