mirror of https://github.com/efabless/caravel.git
Corrected the set_user_id.py script to (1) reverse the position of
characters in the user_id_textblock layout, which was backwards, and (2) add a path reference to "hexdigits" for each new character layout encountered in the file, so that the text block layouts are found even if "addpath hexdigits" has not been specified. There were some other corrections to handling gzipped files that probably does not apply in practice, where "make uncompress" has been run prior to the set_user_id.py script.
This commit is contained in:
parent
5896df50a8
commit
6482c1e011
|
@ -306,14 +306,20 @@ if __name__ == '__main__':
|
||||||
# Keep a copy of the original
|
# Keep a copy of the original
|
||||||
if not os.path.isfile(gdsbak):
|
if not os.path.isfile(gdsbak):
|
||||||
if file_zipped:
|
if file_zipped:
|
||||||
os.rename(gdsfilegz, gdsbakgz)
|
if os.path.isfile(gdsfilegz):
|
||||||
|
os.rename(gdsfilegz, gdsbakgz)
|
||||||
|
else:
|
||||||
|
os.rename(gdsfile, gdsbak)
|
||||||
|
subprocess.run(['gzip', gdsbak, '-n', '--best'],
|
||||||
|
stdout = subprocess.DEVNULL,
|
||||||
|
stderr = subprocess.DEVNULL)
|
||||||
else:
|
else:
|
||||||
os.rename(gdsfile, gdsbak)
|
os.rename(gdsfile, gdsbak)
|
||||||
|
|
||||||
with open(gdsfile, 'wb') as ofile:
|
with open(gdsfile, 'wb') as ofile:
|
||||||
ofile.write(gdsdata)
|
ofile.write(gdsdata)
|
||||||
if file_zipped:
|
if file_zipped:
|
||||||
subprocess.run(['gzip', gdsdata, '-n', '--best'],
|
subprocess.run(['gzip', gdsfile, '-n', '--best'],
|
||||||
stdout = subprocess.DEVNULL,
|
stdout = subprocess.DEVNULL,
|
||||||
stderr = subprocess.DEVNULL)
|
stderr = subprocess.DEVNULL)
|
||||||
|
|
||||||
|
@ -354,11 +360,17 @@ if __name__ == '__main__':
|
||||||
maglines = ifile.read().splitlines()
|
maglines = ifile.read().splitlines()
|
||||||
outlines = []
|
outlines = []
|
||||||
digit = 0
|
digit = 0
|
||||||
|
wasseen = {}
|
||||||
for line in maglines:
|
for line in maglines:
|
||||||
if 'alphaX_' in line:
|
if 'alphaX_' in line:
|
||||||
dchar = user_id_value[digit].upper()
|
dchar = user_id_value[7 - digit].upper()
|
||||||
oline = re.sub('alpha_[0-9A-F]', 'alpha_' + dchar, line)
|
oline = re.sub('alpha_[0-9A-F]', 'alpha_' + dchar, line)
|
||||||
|
# Add path reference if cell was not previously found in the file
|
||||||
|
if dchar not in wasseen:
|
||||||
|
if 'hexdigits' not in oline:
|
||||||
|
oline += ' hexdigits'
|
||||||
outlines.append(oline)
|
outlines.append(oline)
|
||||||
|
wasseen[dchar] = True
|
||||||
digit += 1
|
digit += 1
|
||||||
else:
|
else:
|
||||||
outlines.append(line)
|
outlines.append(line)
|
||||||
|
|
Loading…
Reference in New Issue