Пример #1
0
 def internal(self):
   gs.wait(3,gs.NS)
   tmp = no_process("py_no_process")
   tmp.debug = test_debug
   gs.wait(35,gs.NS)
   m = gs.findReceiver("gs_module.py_no_process")
   # can use "tmp" directly of course #
   for i in range(10):
     ms = gs.message()
     ms["fish"] = i*i
     m.nb_write(ms)
     gs.wait(5,gs.NS)
   gs.stop()
Пример #2
0
    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()