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

15 lines
217 B
Python
Raw Normal View History

2016-03-21 16:31:42 +01:00
from myhdl import block, delay, always, now
2003-02-04 22:32:10 +00:00
2016-03-21 16:31:42 +01:00
@block
2005-12-06 22:14:55 +00:00
def HelloWorld():
2005-12-11 16:30:52 +00:00
2016-03-21 16:31:42 +01:00
@always(delay(10))
def say_hello():
2016-03-15 18:31:58 -04:00
print("%s Hello World!" % now())
2003-02-04 22:32:10 +00:00
2016-03-21 16:31:42 +01:00
return say_hello
2003-06-30 14:24:23 +00:00
2003-02-04 22:32:10 +00:00
2016-03-21 16:31:42 +01:00
inst = HelloWorld()
inst.run_sim(30)