diff --git a/asiclib/rename.py b/asiclib/rename.py deleted file mode 100644 index 4fac5ae..0000000 --- a/asiclib/rename.py +++ /dev/null @@ -1,8 +0,0 @@ -import glob -import re -import os -file_list = glob.glob('*.v') -for item in file_list: - newfile = item.replace("oh_", "asic_") - print (item, newfile) - os.rename(item, newfile) diff --git a/asiclib/scripts/rename.py b/asiclib/scripts/rename.py new file mode 100644 index 0000000..135f5e1 --- /dev/null +++ b/asiclib/scripts/rename.py @@ -0,0 +1,17 @@ +import glob +import re +import os + +file_list = glob.glob('*.v') +for item in file_list: + f = open(item, "r") + newfile = item+".tmp" + f2 = open(newfile, "w") + for line in f: + if re.search(r'module\s+(\w+)', line) : + line = line.rstrip() + " #(parameter PROP = \"DEFAULT\")" + f2.write(line) + print(line) + f.close() + f2.close() + os.rename(newfile, item)