Created
May 8, 2014 13:27
-
-
Save cfelton/a0dbd2c12070a649bb56 to your computer and use it in GitHub Desktop.
MyHDL signal delay argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from myhdl import * | |
import myhdl_tools as mt | |
def m_add(a, b, c): | |
@always_comb | |
def rtl(): | |
c.next = a and b | |
return rtl | |
def test(): | |
a = Signal(bool(0), delay=10) | |
b = Signal(bool(0), delay=1) | |
c = Signal(bool(0)) | |
def _test(): | |
tbdut = m_add(a, b, c) | |
@instance | |
def tbstim(): | |
yield delay(100) | |
a.next = True | |
b.next = True | |
yield delay(100) | |
return tbdut, tbstim | |
g = traceSignals(_test) | |
Simulation(g).run() | |
fig,ax = mt.vcd.parse_and_plot('_test.vcd') | |
fig.savefig('signal_delay.png') | |
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment