📄 mipsmem.v
字号:
//------------------------------------------------// mipsmemsingle.v// David_Harris@hmc.edu 23 October 2005// External memories used by MIPS single-cycle// processor//------------------------------------------------module dmem(input clk, we, input [31:0] a, wd, output [31:0] rd); reg [31:0] RAM[63:0]; assign rd = RAM[a[31:2]]; // word aligned always @(posedge clk) if (we) RAM[a[31:2]] <= wd;endmodulemodule imem(input [5:0] a, output [31:0] rd); reg [31:0] RAM[63:0]; initial begin $readmemh("memfile.dat",RAM); end assign rd = RAM[a]; // word alignedendmodule
// imem must currently be created with CoreGen for Xilinx synthesis// or loaded from imem.v for simulation
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -