1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00
myhdl/example/manual/hello2.py

21 lines
377 B
Python
Raw Normal View History

2003-01-30 23:04:36 +00:00
from __future__ import generators
from myhdl import Signal, delay, posedge, now, Simulation
clk = Signal(0)
def clkGen():
while 1:
yield delay(10)
clk.next = 1
yield delay(10)
clk.next = 0
def sayHello():
while 1:
yield posedge(clk)
print "%s Hello World!" % now()
sim = Simulation(clkGen(), sayHello())
2003-02-01 00:11:13 +00:00
sim.run(50)
2003-01-30 23:04:36 +00:00