2016-03-21 16:31:42 +01:00
|
|
|
from myhdl import block, Signal
|
2003-02-05 22:07:33 +00:00
|
|
|
|
2016-03-21 16:31:42 +01:00
|
|
|
from ClkDriver import ClkDriver
|
|
|
|
from Hello import Hello
|
2005-12-09 17:01:07 +00:00
|
|
|
|
|
|
|
|
2016-03-21 16:31:42 +01:00
|
|
|
@block
|
|
|
|
def Greetings():
|
2003-02-05 22:07:33 +00:00
|
|
|
|
|
|
|
clk1 = Signal(0)
|
|
|
|
clk2 = Signal(0)
|
|
|
|
|
2016-03-21 16:31:42 +01:00
|
|
|
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
|
2003-02-05 22:07:33 +00:00
|
|
|
|
2016-03-21 16:31:42 +01:00
|
|
|
return clkdriver_1, clkdriver_2, hello_1, hello_2
|
2003-06-30 14:24:23 +00:00
|
|
|
|
2003-02-05 22:07:33 +00:00
|
|
|
|
2016-03-21 16:31:42 +01:00
|
|
|
inst = Greetings()
|
|
|
|
inst.run_sim(50)
|