Skip to content

Commit

Permalink
fhdl/verilog: do not use initial begin in _printinit (not accepted by…
Browse files Browse the repository at this point in the history
… all synthesis tools ex: Synplify Pro does not accept it)
  • Loading branch information
enjoy-digital committed Mar 16, 2015
1 parent b5a9909 commit e946f6e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions migen/fhdl/verilog.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,19 @@ def _printinit(f, ios, ns):
- ios \
- list_targets(f) \
- list_special_ios(f, False, True, True)
wires = (_list_comb_wires(f) | list_special_ios(f, True, False, False)) \
- ios \
- list_targets(f) \
- list_special_ios(f, False, True, True)
if signals:
r += "initial begin\n"
for s in sorted(signals, key=lambda x: x.huid):
r += "\t" + ns.get_name(s) + " <= " + _printexpr(ns, s.reset)[0] + ";\n"
r += "end\n\n"
if s in wires:
r += "assign" + ns.get_name(s) + " = " + _printexpr(ns, s.reset)[0] + ";\n"
r += "always @(*) begin\n"
for s in sorted(signals, key=lambda x: x.huid):
if s not in wires:
r += "\t" + ns.get_name(s) + " <= " + _printexpr(ns, s.reset)[0] + ";\n"
r += "end\n"
return r

def convert(f, ios=None, name="top",
Expand Down

0 comments on commit e946f6e

Please sign in to comment.