Created
January 11, 2012 04:29
-
-
Save buhii/1593025 to your computer and use it in GitHub Desktop.
verilog file's correct tool
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
import re | |
import sys | |
re_v = re.compile('(\s+)(reg|wire)(\s+)(\w+)\s*(\[\d+:0\]);') | |
for line in sys.stdin: | |
line = line[:-1] # to remove new line | |
result = re_v.search(line) | |
if result: | |
g = result.groups() | |
print "%s%s\t%s\t%s;" % (g[0], g[1], g[4], g[3]) | |
else: | |
print line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment