aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-07-21 17:24:24 +0200
committerClifford Wolf <clifford@clifford.at>2015-07-21 17:24:24 +0200
commit828291051abd97536ef7204abfb634ac797d11a2 (patch)
treeeeca3bc509a91213d7b228324eec21a89d28e195
parent219232f97ff023d205513f1b63d0a98edc88c6e3 (diff)
downloadicestorm-828291051abd97536ef7204abfb634ac797d11a2.tar.gz
icestorm-828291051abd97536ef7204abfb634ac797d11a2.tar.bz2
icestorm-828291051abd97536ef7204abfb634ac797d11a2.zip
Bugfix in icebox_vlog -s
-rwxr-xr-xicebox/icebox_vlog.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/icebox/icebox_vlog.py b/icebox/icebox_vlog.py
index 05a8197..11207f9 100755
--- a/icebox/icebox_vlog.py
+++ b/icebox/icebox_vlog.py
@@ -817,22 +817,30 @@ print("module %s (%s);\n" % (modname, ", ".join(text_ports)))
new_text_wires = list()
new_text_regs = list()
+new_text_raw = list()
for line in text_wires:
match = re.match(r"wire ([^ ;]+)(.*)", line)
+ if match:
+ if strip_comments:
+ if match.group(1) in wire_to_reg:
+ new_text_regs.append(match.group(1))
+ else:
+ new_text_wires.append(match.group(1))
+ continue
+ else:
+ if match.group(1) in wire_to_reg:
+ line = "reg " + match.group(1) + " = 0" + match.group(2)
if strip_comments:
- if match and match.group(1) in wire_to_reg:
- new_text_regs.append(match.group(1))
- elif match:
- new_text_wires.append(match.group(1))
+ new_text_raw.append(line)
else:
- if match and match.group(1) in wire_to_reg:
- line = "reg " + match.group(1) + " = 0" + match.group(2)
print(line)
for names in [new_text_wires[x:x+10] for x in range(0, len(new_text_wires), 10)]:
print("wire %s;" % ", ".join(names))
for names in [new_text_regs[x:x+10] for x in range(0, len(new_text_regs), 10)]:
print("reg %s = 0;" % " = 0, ".join(names))
if strip_comments:
+ for line in new_text_raw:
+ print(line)
print()
for line in text_func: