Created
September 22, 2019 04:02
-
-
Save liangfu/eddaf21bef499040b2b35db54428893f to your computer and use it in GitHub Desktop.
Strip Comment Sections in Chisel Generated Verilog files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os, sys | |
out = "" | |
with open(sys.argv[1], 'r') as fp: | |
lines = fp.readlines() | |
for idx, line in enumerate(lines): | |
end = line.find(" // @[") | |
line = line[:end] + '\n' | |
out += line | |
with open(sys.argv[1], 'w') as fp: | |
fp.write(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment