Skip to content
Snippets Groups Projects
Commit 058da7b0 authored by David Brouwer's avatar David Brouwer
Browse files

Updated information header. Modified to be compatible with Agilex 7. The...

Updated information header. Modified to be compatible with Agilex 7. The modification is based on the architecture of common_ram_crw_crw.vhd.
parent 545c969f
No related branches found
No related tags found
1 merge request!363Porting ram for Intel Agilex 7
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- --
-- Copyright (C) 2014 -- Copyright 2014-2023
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/> -- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands -- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-- --
-- This program is free software: you can redistribute it and/or modify -- Licensed under the Apache License, Version 2.0 (the "License");
-- it under the terms of the GNU General Public License as published by -- you may not use this file except in compliance with the License.
-- the Free Software Foundation, either version 3 of the License, or -- You may obtain a copy of the License at
-- (at your option) any later version.
-- --
-- This program is distributed in the hope that it will be useful, -- http://www.apache.org/licenses/LICENSE-2.0
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- --
-- You should have received a copy of the GNU General Public License -- Unless required by applicable law or agreed to in writing, software
-- along with this program. If not, see <http://www.gnu.org/licenses/>. -- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- --
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
--
-- Author:
-- -
-- Changed by:
-- D.F. Brouwer
-- Description:
-- Dual clock domain
-- Use port a only for write in write clock domain
-- Use port b only for read in read clock domain
-- Remarks:
-- The crw_crw RAM covers all other variants, which were utilized by other
-- common RAM variant files. However, because the crw_crw IP is no longer
-- supported as it was previously used for previous FPGA technology identifiers
-- (device types) by the Agilex 7 (agi027_xxxx), the individual IPs should be
-- used. As a result, this file has been modified. [1]
-- Reference:
-- [1] Based on the architecture of common_ram_crw_crw.vhd.
library IEEE, technology_lib; library IEEE, technology_lib, tech_memory_lib;
use IEEE.std_logic_1164.all; use IEEE.std_logic_1164.all;
use work.common_pkg.all;
use work.common_mem_pkg.all; use work.common_mem_pkg.all;
use technology_lib.technology_select_pkg.all; use technology_lib.technology_select_pkg.all;
...@@ -50,35 +67,72 @@ entity common_ram_cr_cw is ...@@ -50,35 +67,72 @@ entity common_ram_cr_cw is
end common_ram_cr_cw; end common_ram_cr_cw;
architecture str of common_ram_cr_cw is architecture str of common_ram_cr_cw is
constant c_rd_latency : natural := sel_a_b(g_ram.latency < 2, g_ram.latency, 2); -- handle read latency 1 or 2 in RAM
constant c_pipeline : natural := sel_a_b(g_ram.latency > c_rd_latency, g_ram.latency - c_rd_latency, 0); -- handle rest of read latency > 2 in pipeline
-- Intermediate signal for extra pipelining
signal ram_rd_dat : std_logic_vector(rd_dat'range);
-- Map sl to single bit slv for rd_val pipelining
signal ram_rd_en : std_logic_vector(0 downto 0);
signal ram_rd_val : std_logic_vector(0 downto 0);
begin begin
-- Dual clock domain assert g_ram.latency >= 1
-- Use port a only for write in write clock domain report "common_ram_cr_cw : only support read latency >= 1"
-- Use port b only for read in read clock domain severity FAILURE;
u_cr_cw : entity work.common_ram_crw_crw -- memory access
u_cr_cw : entity tech_memory_lib.tech_memory_ram_cr_cw
generic map ( generic map (
g_technology => g_technology, g_technology => g_technology,
g_ram => g_ram, g_adr_w => g_ram.adr_w,
g_dat_w => g_ram.dat_w,
g_nof_words => g_ram.nof_dat,
g_rd_latency => c_rd_latency,
g_init_file => g_init_file g_init_file => g_init_file
) )
port map
(
wrclock => wr_clk,
wrclocken => wr_clken,
wren => wr_en,
wraddress => wr_adr,
data => wr_dat,
rdclock => rd_clk,
rdclocken => rd_clken,
rdaddress => rd_adr,
q => ram_rd_dat
);
-- read output
u_pipe : entity work.common_pipeline
generic map (
g_pipeline => c_pipeline,
g_in_dat_w => g_ram.dat_w,
g_out_dat_w => g_ram.dat_w
)
port map (
clk => rd_clk,
clken => rd_clken,
in_dat => ram_rd_dat,
out_dat => rd_dat
);
-- rd_val control
ram_rd_en(0) <= rd_en;
rd_val <= ram_rd_val(0);
u_rd_val : entity work.common_pipeline
generic map (
g_pipeline => g_ram.latency,
g_in_dat_w => 1,
g_out_dat_w => 1
)
port map ( port map (
rst_a => wr_rst, clk => rd_clk,
rst_b => rd_rst, clken => rd_clken,
clk_a => wr_clk, in_dat => ram_rd_en,
clk_b => rd_clk, out_dat => ram_rd_val
clken_a => wr_clken,
clken_b => rd_clken,
wr_en_a => wr_en,
wr_en_b => '0',
wr_dat_a => wr_dat,
wr_dat_b => (others => '0'),
adr_a => wr_adr,
adr_b => rd_adr,
rd_en_a => '0',
rd_en_b => rd_en,
rd_dat_a => OPEN,
rd_dat_b => rd_dat,
rd_val_a => OPEN,
rd_val_b => rd_val
); );
end str; end str;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment