beepo/tests/adding/mem.py

7 lines
258 B
Python
Raw Normal View History

2023-11-17 02:02:40 -06:00
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)