URL
https://opencores.org/ocsvn/a-z80/a-z80/trunk
[/] [a-z80/] [trunk/] [resources/] [connotate-fuse.py] - Diff between revs 3 and 8
Show entire file |
Details |
Blame |
View Log
Rev 3 |
Rev 8 |
Line 1... |
Line 1... |
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
#
|
#
|
# This script connotates fuse test files with Z80 opcode strings.
|
# This script connotates fuse test files with Z80 opcode strings.
|
# Run it once to convert original fuse files to a new, connotated format.
|
# Run it once to convert original fuse files to a new, connotated format.
|
#
|
#
|
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
Line 40... |
Line 40... |
load("opcodes-ed-xx.txt")
|
load("opcodes-ed-xx.txt")
|
load("opcodes-fd-cb.txt")
|
load("opcodes-fd-cb.txt")
|
load("opcodes-fd-xx.txt")
|
load("opcodes-fd-xx.txt")
|
|
|
if len(sys.argv)!=2:
|
if len(sys.argv)!=2:
|
print "Usage: " + sys.argv[0] + " <fuse-test-file>"
|
print ("Usage:", sys.argv[0], "<fuse-test-file>")
|
exit(0)
|
exit(0)
|
file = sys.argv[1]
|
file = sys.argv[1]
|
|
|
with open(file) as f, open(file+".out", "wt") as f2:
|
with open(file) as f, open(file+".out", "wt") as f2:
|
for line in f:
|
for line in f:
|
Line 55... |
Line 55... |
if len(parts)==1 and parts[0]!="-1":
|
if len(parts)==1 and parts[0]!="-1":
|
index = parts[0].split("_")[0].upper()
|
index = parts[0].split("_")[0].upper()
|
if index in op:
|
if index in op:
|
note = " " + " "*(7-len(parts[0])) + op[index.upper()]
|
note = " " + " "*(7-len(parts[0])) + op[index.upper()]
|
f2.write(line + note + "\n")
|
f2.write(line + note + "\n")
|
print line + note
|
print (line + note)
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.