mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
verilog: comb reset
This commit is contained in:
parent
4d6be55e9f
commit
8a394f9159
1 changed files with 10 additions and 0 deletions
|
@ -119,6 +119,16 @@ def _printcomb(f, ns):
|
|||
r += syn_on + "\n"
|
||||
|
||||
r += "always @(*) begin\n"
|
||||
to_reset = list_targets(f.comb)
|
||||
# do not reset signals with obvious unconditional assignments
|
||||
for s in f.comb.l:
|
||||
if isinstance(s, _Assign) and isinstance(s.l, Signal):
|
||||
try:
|
||||
to_reset.remove(s.l)
|
||||
except KeyError:
|
||||
pass
|
||||
for t in to_reset:
|
||||
r += "\t" + ns.get_name(t) + " <= " + str(t.reset) + ";\n"
|
||||
r += _printnode(ns, False, 1, f.comb)
|
||||
r += syn_off
|
||||
r += "\t" + ns.get_name(dummy_d) + " <= " + ns.get_name(dummy_s) + ";\n"
|
||||
|
|
Loading…
Reference in a new issue