Skip to content

Commit

Permalink
fhdl.verilog: fix nondeterminism in _printcomb.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed May 25, 2018
1 parent 0aa76fa commit 2423404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migen/fhdl/verilog.py
Expand Up @@ -271,11 +271,11 @@ def _printcomb(f, ns,
if display_run:
r += "\t$display(\"Running comb block #" + str(n) + "\");\n"
if blocking_assign:
for t in g[0]:
for t in sorted(g[0], key=lambda x: x.duid):
r += "\t" + ns.get_name(t) + " = " + _printexpr(ns, t.reset)[0] + ";\n"
r += _printnode(ns, _AT_BLOCKING, 1, g[1])
else:
for t in g[0]:
for t in sorted(g[0], key=lambda x: x.duid):
r += "\t" + ns.get_name(t) + " <= " + _printexpr(ns, t.reset)[0] + ";\n"
r += _printnode(ns, _AT_NONBLOCKING, 1, g[1])
if dummy_signal:
Expand Down

0 comments on commit 2423404

Please sign in to comment.