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:
parent
9e41b55f22
commit
df731e4e13
@ -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
17
asiclib/scripts/rename.py
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user