1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00
myhdl/example/manual/greetings.py
2016-03-22 18:09:38 +01:00

23 lines
520 B
Python

from myhdl import block, Signal
from ClkDriver import ClkDriver
from Hello import Hello
@block
def Greetings():
clk1 = Signal(0)
clk2 = Signal(0)
clkdriver_1 = ClkDriver(clk1) # positional and default association
clkdriver_2 = ClkDriver(clk=clk2, period=19) # named association
hello_1 = Hello(clk=clk1) # named and default association
hello_2 = Hello(to="MyHDL", clk=clk2) # named association
return clkdriver_1, clkdriver_2, hello_1, hello_2
inst = Greetings()
inst.run_sim(50)