Demo entry 6663285

event-driven simulation

   

Submitted by anonymous on Nov 29, 2017 at 20:50
Language: Python. Code size: 254 Bytes.

for i in xrange( cycle_to_simulate ):
  Q = deque( [ list of posedge triggered blocks ] )
  while not Q.empty():
    block = Queue.popleft()
    block()
    if some_value_changed:
      for b in triggered_blocks:
      Q.push( triggered_blocks )

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).