mipsmem.v
来自「verilog语言实现的基于MIPS体系结构的微处理器程序」· Verilog 代码 · 共 35 行
V
35 行
//------------------------------------------------// 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 + =
减小字号Ctrl + -
显示快捷键?