You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
469 B
Python
33 lines
469 B
Python
2 years ago
|
#!/usr/bin/python3
|
||
|
# gtkwave process filter
|
||
|
#
|
||
|
# return right 64 of binary
|
||
|
|
||
|
import sys
|
||
|
|
||
|
fi = sys.stdin
|
||
|
fo = sys.stdout
|
||
|
fe = sys.stderr
|
||
|
|
||
|
def dbg(m):
|
||
|
fe.write(m + '\n')
|
||
|
fe.flush()
|
||
|
|
||
|
def main():
|
||
|
|
||
|
while True:
|
||
|
|
||
|
line = fi.readline()
|
||
|
if not line:
|
||
|
return 0
|
||
|
|
||
|
try:
|
||
|
fo.write(f'{int(line[-65:-33],2):08X}{int(line[-33:-1],2):08X}\n')
|
||
|
except:
|
||
|
fo.write('\n')
|
||
|
|
||
|
fo.flush()
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
sys.exit(main())
|