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
464 B
Python

3 years ago
#!/usr/bin/python3
# gtkwave process filter
#
# return left 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[0:32],2):08X}{int(line[32:65],2):08X}\n')
except:
fo.write('\n')
fo.flush()
if __name__ == '__main__':
sys.exit(main())