インテルのみ表示可能 — GUID: mwh1409959588216
Ixiasoft
インテルのみ表示可能 — GUID: mwh1409959588216
Ixiasoft
1.4.1.9. 混合幅デュアルポートRAM
Verilog-1995は、異なるリード幅、書き込み幅、またはその両方をモデル化するための多次元配列がないため、混合幅RAMをサポートしていません。 Verilog-2001は、このタイプのロジックが複数のパック・ディメンションを必要とするため、混合幅RAMをサポートしません。異なる合成ツールは、これらのメモリーのサポートが異なる場合があります。このセクションでは、 インテル® Quartus® Primeプロ・エディション合成の推論規則について説明します。
多次元パック配列の最初の次元は、幅の広いポートと幅の狭いポートの比率を表します。 2番目の次元は、より狭いポート幅を表します。リードおよびライト・ポートの幅は、ターゲットデバイスのメモリーブロックでサポートされるリードまたはライトの比率を指定する必要があります。それ以外の場合、合成ツールはRAMを推論しません。
サポートされているリード幅と書き込み幅の組み合わせを備えたパラメーター化された例について詳しくは インテル® Quartus® Prime HDLテンプレートを参照してください 。また、2つの混合幅リード・ポートと2つの混合幅ライト・ポートを備えた真のデュアルポートRAMの例を見つけることができます。
SystemVerilog Mixed-Width RAM with Read Width Smaller than Write Width
module mixed_width_ram // 256x32 write and 1024x8 read ( input [7:0] waddr, input [31:0] wdata, input we, clk, input [9:0] raddr, output logic [7:0] q ); logic [3:0][7:0] ram[0:255]; always_ff@(posedge clk) begin if(we) ram[waddr] <= wdata; q <= ram[raddr / 4][raddr % 4]; end endmodule : mixed_width_ram
SystemVerilog Mixed-Width RAM with Read Width Larger than Write Width
module mixed_width_ram // 1024x8 write and 256x32 read ( input [9:0] waddr, input [31:0] wdata, input we, clk, input [7:0] raddr, output logic [9:0] q ); logic [3:0][7:0] ram[0:255]; always_ff@(posedge clk) begin if(we) ram[waddr / 4][waddr % 4] <= wdata; q <= ram[raddr]; end endmodule : mixed_width_ram
VHDL Mixed-Width RAM with Read Width Smaller than Write Width
library ieee; use ieee.std_logic_1164.all; package ram_types is type word_t is array (0 to 3) of std_logic_vector(7 downto 0); type ram_t is array (0 to 255) of word_t; end ram_types; library ieee; use ieee.std_logic_1164.all; library work; use work.ram_types.all; entity mixed_width_ram is port ( we, clk : in std_logic; waddr : in integer range 0 to 255; wdata : in word_t; raddr : in integer range 0 to 1023; q : out std_logic_vector(7 downto 0)); end mixed_width_ram; architecture rtl of mixed_width_ram is signal ram : ram_t; begin -- rtl process(clk, we) begin if(rising_edge(clk)) then if(we = '1') then ram(waddr) <= wdata; end if; q <= ram(raddr / 4 )(raddr mod 4); end if; end process; end rtl;
VHDL Mixed-Width RAM with Read Width Larger than Write Width
library ieee; use ieee.std_logic_1164.all; package ram_types is type word_t is array (0 to 3) of std_logic_vector(7 downto 0); type ram_t is array (0 to 255) of word_t; end ram_types; library ieee; use ieee.std_logic_1164.all; library work; use work.ram_types.all; entity mixed_width_ram is port ( we, clk : in std_logic; waddr : in integer range 0 to 1023; wdata : in std_logic_vector(7 downto 0); raddr : in integer range 0 to 255; q : out word_t); end mixed_width_ram; architecture rtl of mixed_width_ram is signal ram : ram_t; begin -- rtl process(clk, we) begin if(rising_edge(clk)) then if(we = '1') then ram(waddr / 4)(waddr mod 4) <= wdata; end if; q <= ram(raddr); end if; end process; end rtl;