// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: dmu_dou_edr.v
// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
// This program is distributed in the hope that it will be useful,
// 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
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// For the avoidance of doubt, and except that if any non-GPL license
// choice is available it will apply instead, Sun elects to use only
// the General Public License version 2 (GPLv2) at this time for any
// software where a choice of GPL license versions is made
// available with the language indicating that GPLv2 or any later version
// may be used, or where a choice of which version of the GPL is applied is
// otherwise unspecified.
// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
// CA 95054 USA or visit www.sun.com if you need additional information or
// ========== Copyright Header End ============================================
// CLU's CRM - DOU's EDR DMA Interface
// ILU's EIL - DOU Interface
dmu_mb0_dou_dma_data_wr_en,
dmu_mb0_dou_dma_data_rd_en
//////////////////////////////////////////////////////////////////////
//************************* Parameters *************************
//////////////////////////////////////////////////////////////////////
parameter MEM_WIDTH = `FIRE_DLC_ERD_DATA_WDTH+`FIRE_DLC_ERD_DPAR_WDTH;
parameter MEM_TIEHIGH = 1'b1;
// parameter MEM_TIELOW = 1'b0;
//////////////////////////////////////////////////////////////////////
//************************* Port Declarations *******************
//////////////////////////////////////////////////////////////////////
input tcu_se_scancollar_in;
input tcu_array_wr_inhibit;
// CLU's CRM - DOU's EDR DMA Interface
input [`FIRE_DLC_CDD_ADDR_WDTH-1:0] cl2do_dma_addr; // Address width, to address 128 entries DMA
input [`FIRE_DLC_CDD_DATA_WDTH-1:0] cl2do_dma_data; // Data width, 16 bytes
input [`FIRE_DLC_CDD_DPAR_WDTH-1:0] cl2do_dma_dpar; // Parity width 32 bit parity on data
// ILU's EIL - DOU Interface
input [`FIRE_DLC_ERD_ADDR_WDTH-2:0] y2edr_addr; // Address width, to address 128 entries DMA / 64 entries PIO
output [MEM_WIDTH-1:0] edr2mux_dma_data_out; // RAM data output
input [6:0] dmu_mb0_addr;
input [7:0] dmu_mb0_wdata;
input dmu_mb0_dou_dma_data_wr_en;
input dmu_mb0_dou_dma_data_rd_en;
//////////////////////////////////////////////////////////////////////
//*************** Submodule Instantiations ***********************
//////////////////////////////////////////////////////////////////////
fire_dlc_ram128x132_211hd4 ram128x132_211hd4
.dib ({cl2do_dma_dpar, cl2do_dma_data}),
.doa (edr2mux_dma_data_out),
//BP n2 6-04-04 new ram model
//BP n2 9-22-04, add scan bypass mux
// note: {cl2do_dma_dpar, cl2do_dma_data} come directly from flops in clu
wire [MEM_WIDTH-1:0] dma_ram_data_out;
//SV 02/24/05 added BIST logic
wire [6:0] rd_addr_ram, wr_addr_ram ;
wire wr_en_ram, rd_en_ram ;
assign din_ram = dmu_mb0_run ? ({dmu_mb0_wdata[3:0],{16{dmu_mb0_wdata}}}) : ({cl2do_dma_dpar, cl2do_dma_data}) ;
assign rd_addr_ram = dmu_mb0_run ? dmu_mb0_addr[6:0] : y2edr_addr ;
assign wr_addr_ram = dmu_mb0_run ? dmu_mb0_addr[6:0] : cl2do_dma_addr ;
assign wr_en_ram = dmu_mb0_run ? dmu_mb0_dou_dma_data_wr_en : cl2do_dma_wr ;
assign rd_en_ram = dmu_mb0_run ? dmu_mb0_dou_dma_data_rd_en : MEM_TIEHIGH ;
/* 0in memory_access -read_addr y2edr_addr -read (y2edr_addr != cl2do_dma_addr)
-write_addr cl2do_dma_addr
-latency 1 -write cl2do_dma_wr
-read_data dma_ram_data_out -write_data ({cl2do_dma_dpar, cl2do_dma_data}) -group mbist_mode */
assign edr2mux_dma_data_out = tcu_array_bypass ? {cl2do_dma_dpar, cl2do_dma_data} : dma_ram_data_out;
n2_dmu_dp_128x132s_cust dou_dma_ram128x132
.dout (dma_ram_data_out),
.tcu_scan_en (tcu_scan_en),
.tcu_se_scancollar_in (tcu_se_scancollar_in),
.tcu_array_wr_inhibit (tcu_array_wr_inhibit),
.tcu_pce_ov (tcu_pce_ov),