Поясню для ясности
Имеется ввиду инициализация внутренней памяти FPGA, чтобы после включения эту информацию можно было использовать.
Для Xilinx делалось следующим образом
Код
Инициализация блочной памяти
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
entity init_mem is
Port ( clk : in STD_LOGIC;
addr : std_logic_vector (4 downto 0);
we : in STD_LOGIC;
data_in : in STD_LOGIC_VECTOR (3 downto 0);
data : out STD_LOGIC_VECTOR (3 downto 0));
end init_mem;
architecture Behavioral of init_mem is
type initmem is array(0 to 31) of bit_vector(3 downto 0);
impure function InitRamFromFile (InitRamFile : in string) return initmem is
FILE ram_file : text is in InitRamFile;
variable line_ram : line;
variable ram : initmem;
begin
for I in initmem'range loop
readline (ram_file, line_ram);
read (line_ram, ram(I));
end loop;
return ram;
end function;
signal ram : initmem := InitRamFromFile("ram_file.txt");
signal mem_data : std_logic_vector (3 downto 0);
attribute RAM_STYLE : string;
attribute RAM_STYLE of ram : signal is "BLOCK";
begin
process (clk, ram, mem_data)
begin
if clk'event and clk = '1' then
if we = '1' then
ram(conv_integer(addr)) <= to_bitvector(data_in);
end if;
mem_data <=to_stdlogicvector(ram(conv_integer(addr)));
end if;
data <= mem_data;
end process;
end Behavioral;
Содержание файла «ram_file.txt», который должен находиться в каталоге проекта.
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
1011
1100
1101
1110
1111
1111
1111
Интересует подобное для Actel
If it doesn't work in simulation, it won't work on the board.
"Ты живешь в своих поступках, а не в теле. Ты — это твои действия, и нет другого тебя" Антуан де Сент-Экзюпери повесть "Маленький принц"