reading and writing MIF files
Project description
mif
mif
is a Python module to read and write Memory Initialization
Files, used by Quartus to interact with memory blocks on Intel
FPGAs. They are similar to Intel HEX files, except they support
arbitrary memory widths as first-class citizens.
Installation
Install via pip
:
pip install mif
Basic Use
Use with load
/ loads
and dump
/ dumps
, similar to the json
module:
with open('memory.mif') as f:
mem = mif.load(f)
print(mif.dumps(mem))
The resulting mem
is a numpy array of unpacked bits, where the first
dimension is the address in memory, and the second are the bits in
little-endian order. For example, to access the least significant bit
at address 0x12
:
mem[0x12][0]
For more detailed information, please read the documentation.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.