[myhdl-list] ResetSignal.pulse() proposal
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2013-02-28 13:22:06
|
I understand this may not be considered until 0.9dev. Since we have the /ResetSignal/ type I think it would be useful to add a /pulse/ function. This function would be for simulation only and would handle the *toggling* of the reset, example: reset = ResetSignal(0, active=0, async=True) ... @instance def tb_stimulus(): yield reset.pulse(10) Couple reasons why I think this would be useful. One it simplifies the test code, we have a /ResetSignal/ object might as well have additional simulation utility. Two, the /@always_seq/ and /ResetSignal/ allow a user to arbitrarily modify the reset type. If they do this they have to go change the simulation code, manually modify the stimulus. The /pulse/ function will automatically reflect the /active/ parameter (possibly the /async/ also). I was thinking it would be something like: reset = ResetSignal(0, active=0, async=False) # ... yield reset.pulse(10) # reset.next = False # yield delay(10) # reset.next = True yield reset.pulse(10, 9) # reset.next = False # yield delay(10) # reset.next = True # yield delay(9) yield reset.pulse(8, 10, 9) # yield delay(8) # reset.next = False # yield delay(10) # reset.next = True # yield delay(9) Or it might be better to have a single argument /pulse(waits)/ and have it be a tuple, then it signifies the values are related? /pulse((8,10,9)/. I can supply a patch if we think this is a worthwhile addition. Regards, Chris |