3

std_logic_vector(4096 downto 0) 信号があり、以下のように初期化したい:

architecture Behavioral of test is

    type ram_type is array(4095 downto 0) of std_logic_vector(15 downto 0);
    signal ram : ram_type;
    ram(0) := "0010000000000100";   
    ram(1) := "0001000000000101";
    ram(2) := "0011000000000110";
    ram(3) := "0111000000000001";
    ram(4) := "0000000000001100";
    ram(5) := "0000000000000011";
    ram(6) := "0000000000000000";
    ram(4095 downto 7) := (others => (others => '0'));
    begin
   "some code"
end behavioral

何らかの理由で、これらの値で初期化する必要があります(これらの値をそれに割り当てることはできません。初期化する必要があります)それを行う方法はありますか? 上記のコードを試しましたが、うまくいきませんでした

4

1 に答える 1

4

は次のramように初期化できます。

architecture Behavioral of test is
    type ram_type is array(4095 downto 0) of std_logic_vector(15 downto 0);
    signal ram : ram_type := (0 => "0010000000000100",
                              1 => "0001000000000101",
                              2 => "0011000000000110",
                              3 => "0111000000000001",
                              4 => "0000000000001100",
                              5 => "0000000000000011",
                              6 => "0000000000000000",
                              others => (others => '0'));
begin
  -- Concurrent code
end Behavioral;

ただし、特定の FPGA およびツール機能を調べて、合成ツールが RAM を正しくマップできるように初期化値を RAM に与える特定の方法があるかどうかを確認することをお勧めします。

于 2015-05-18T09:48:53.247 に答える