mirror of
https://github.com/myhdl/myhdl.git
synced 2024-12-14 07:44:38 +08:00
21 lines
377 B
Python
21 lines
377 B
Python
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())
|
|
sim.run(50)
|
|
|