예제 #1
0
 def __init__(self):
     self.msg1fifo = gs.msgfifo("receiver")
     self.msg2fifo = gs.msgfifo()
     self.msg3fifo = gs.msgfifo("second_rx")
     gs.spawn(self.sender)
     gs.spawn(self.receiver)
     gs.spawn(self.internal)
     gs.spawn(self.rx2)
     gs.end_of_simulation(self.cb, args=("end-of-sim",))
     gs.end_of_elaboration(self.cb, args=("end-of-elab",))
     gs.start_of_simulation(self.cb, args=("start-of-sim",))
     tmp = no_process()
     print tmp.name, tmp.full_name
     tmp1 = no_process()
     print tmp1.name, tmp1.full_name
     tmp2 = no_process()
     print tmp2.name, tmp2.full_name
예제 #2
0
파일: simple.py 프로젝트: sernc11/greenlib
    print "loop starts"
    for i in range(40):
      print 'p',
      for j in range(1000): pass
    print
    print "signal is now", mysig.read()


if use_wind:  gs.use_winpdb()

gs.spawn(lambda : f(100, "slow"), debug = to_debug[0])
gs.spawn(lambda : f(55, "fast"), "fast", to_debug[1], time_unit = gs.MS)
gs.spawn(g, "faster", to_debug[2], time_unit = gs.MS)

def hello():
  print "hello there at end of elab"
  print "and start of sim"
gs.end_of_elaboration(hello)
gs.start_of_simulation(hello)

def goodbye():
  print "goodbye at end of sim"
gs.end_of_simulation(goodbye)

print "processes declared"

if gs.__standalone__:
  gs.start(1,gs.US)
  gs.stop()