`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 2019/07/03 13:29:31 // Design Name: // Module Name: xil_tdpram // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// //`define XINLINX_FPGA module xil_tdpram #( parameter DATAWIDTH = 32 ,parameter ADDRWIDTH = 12 )( input PortClk ,input [ADDRWIDTH-1 :0] PortAAddr ,input [DATAWIDTH-1 :0] PortADataIn ,input PortAWriteEnable //active low ,input PortAChipEnable //active low ,input [(DATAWIDTH/8)-1 :0] PortAByteWriteEnable //active low ,output [DATAWIDTH-1 :0] PortADataOut ,input [ADDRWIDTH-1 :0] PortBAddr ,input [DATAWIDTH-1 :0] PortBDataIn ,input PortBWriteEnable //active low ,input PortBChipEnable //active low ,input [(DATAWIDTH/8)-1 :0] PortBByteWriteEnable //active low ,output [DATAWIDTH-1 :0] PortBDataOut ); //////////////////////////////////////////////////////////////////////////////// //Function //////////////////////////////////////////////////////////////////////////////// function integer clog2(input integer bit_depth); begin for(clog2=0;bit_depth>0;clog2=clog2+1) bit_depth =bit_depth>>1; end endfunction localparam LSB = clog2(DATAWIDTH/8 -1); localparam MAW = ADDRWIDTH - LSB; localparam MB =(DATAWIDTH)*(32'h0000_0001<