Mapinfo Interchange File: altera


For Altera products, there is a way to create initial content for arrays. This way is trough MIF files which are text files. The MIF file content is loaded into the array in compilation time.

MIF file definition


Protocol

% Memory depth and width are required %
% DEPTH and WIDTH should be entered as decimal numbers %
DEPTH = 32;	 	% DEPTH is the number of addresses %
WIDTH = 14;		% WIDTH is the number of bits of data per word %

% Address and value radixes are required %
% valid mnemonics are: BIN, DEC, HEX, OCT%
ADDRESS_RADIX = HEX;		% Addresses in hexadecimal format %
DATA_RADIX = HEX;		% Data in hexadecimal format %

%Specify values for addresses, which can be single address or range
CONTENT
BEGIN
[0..F]: 3FFF;		% Range. At every address from 0 to F the content is 3FFF %
6 : F;			% Single addres %
8 : F E 5;		% Range starting from specific address %
			% Addr[8] = F %
			% Addr[9] = E %
			% Addr[A] = 5 %
END;


Cargar

type mem_t is array(0 to 255) of unsigned(7 downto 0);
signal ram : mem_t;
attribute ram_init_file : string;
attribute ram_init_file of ram : signal is "my_init_file.mif";


Example


Se require de un programa que cargue el contenido de un archivo .mif y lo muestr mediante leds. El contenido del archivo es el siguiente.

Images to .mif


Python programs were written to implement the conversión.

.png a .mif

Donwload the png2mif.png here