beepo/tests/adding/mem.py
2023-11-17 03:02:40 -05:00

7 lines
258 B
Python

with open("adding.bin", "rb") as f:
content = f.read()
length_bits = len(content) * 8
mash = "".join([hex(int(i))[2:].zfill(2) for i in content])
shadow = f"reg [0:{length_bits-1}] mem = {length_bits}'h{mash}; // generated"
print(shadow)