1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-17 20:02:53 +08:00

Adding asiclib scripts directory

This commit is contained in:
aolofsson 2021-07-28 08:48:15 -04:00
parent 9e41b55f22
commit df731e4e13
2 changed files with 17 additions and 8 deletions

View File

@ -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)

17
asiclib/scripts/rename.py Normal file
View File

@ -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)