revert fhdl/verilog: avoid reg initialization in printheader when reset is not an...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 19:47:55 +0000 (21:47 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 19:47:55 +0000 (21:47 +0200)
migen/fhdl/verilog.py

index 4cc657b38da8c1aacc7a6825e3a984cab09b239e..5d5f5896e393e88d311180caea36f91bbb9605db 100644 (file)
@@ -178,11 +178,7 @@ def _printheader(f, ios, name, ns):
         if sig in wires:
             r += "wire " + _printsig(ns, sig) + ";\n"
         else:
-            if isinstance(sig.reset, int):
-                resetexpr = " = " + _printexpr(ns, sig.reset)[0]
-            else:
-                resetexpr = ""
-            r += "reg " + _printsig(ns, sig) + resetexpr + ";\n"
+            r += "reg " + _printsig(ns, sig) + " = " + _printexpr(ns, sig.reset)[0] + ";\n"
     r += "\n"
     return r