📄 ram.v
字号:
`timescale 1ns/10ps/*****************************************************************************$RCSfile: ram.v,v $$Revision: 1.3 $$Author: kohlere $$Date: 2000/03/23 18:26:19 $$State: Exp $$Source: &Description: Cache Memory Module*****************************************************************************/module ram (nGCLK, write_sel, read_sel, write_port, read_port, wr_ena);parameter LSS = 2; //Line Select Bitsparameter NL = 4; //Number of Cache Lines (kB = 32*NL/1024)/*------------------------------------------------------------------------ Ports------------------------------------------------------------------------*/input [255:0] write_port; //Write Valueinput [LSS-1:0] read_sel; //Read Select Lineinput [LSS-1:0] write_sel; //Write Select Lineinput nGCLK; //Clock Signalinput wr_ena; //Write Enableoutput [255:0] read_port; //Read Line/*------------------------------------------------------------------------ Signal Declarations------------------------------------------------------------------------*/reg [255:0] mem [NL-1:0]; //Memory Declarationwire [255:0] read_port; //Read Port//synopsys translate_offassign #2 read_port = mem[read_sel];always @(posedge nGCLK) begin if (wr_ena) mem[write_sel] <= #1 write_port; end//synopsys translate_onendmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -