Altera_Forum
Honored Contributor
13 years agoMIF following
I need a program which runs over a MIF and gets out is data. anybody knows how to do that ? thank you for help...
I would recommend using Intel .hex file format. Its easy to generate using C code, and easy to parse in a testbench directly.
Wikipedia has the format of .hex files. http://en.wikipedia.org/wiki/intel_hex Use the Altera tools to generate a couple of example files, and you'll see the format they expect. For example, here's a few lines from the start and the end of a MAX II UFM memory contents file:
:020000000000FE
:020001000403F6
:0200020060019B
:020003000400F7
:020004004B802F
:02000500001CDD
:020006000200F6
...
:0201FD00FFFF02
:0201FE00FFFF01
:0201FF00FFFF00
:00000001FF
You can use the Wikipedia page to 'decode' these bytes. Here's the C-code data to help you decoding the bytes
/* FTDI FT245BM USB-to-Serial with serial number SERIAL01 */
static int usb_to_serial01_data = {
0x0000, 0x0403, 0x6001, 0x0400, 0x4B80, 0x001C, 0x0200, 0x0A94,
0x329E, 0x12D0, 0x030A, 0x0046, 0x0054, 0x0044, 0x0049, 0x0332,
0x0055, 0x0053, 0x0042, 0x0020, 0x003C, 0x002D, 0x003E, 0x0020,
0x0053, 0x0065, 0x0072, 0x0069, 0x0061, 0x006C, 0x0020, 0x0043,
0x006F, 0x006E, 0x0076, 0x0065, 0x0072, 0x0074, 0x0065, 0x0072,
0x0312, 0x0053, 0x0045, 0x0052, 0x0049, 0x0041, 0x004C, 0x0030,
0x0031, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x896F
};
Cheers, Dave