The mini mips verilog code and the test bench

22 907 0
The mini mips verilog code and the test bench

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

The mini mips verilog code and the test bench

THE MINI-MIPS VERILOG CODE AND THE TEST-BENCH Verilog: Top with Data Memory module top( input clk, reset, output [31:0] WriteData,DataAdr, output MemWrite); wire [31:0] Pcnext, Instr, Readdata; // instantiate processor and memories mips mips (clk,reset,Instr,Readdata,Pcnext,DataAdr,WriteData,MemWrite); instructmem instructmem (Pcnext[7:2],Instr); datamem datamem (clk,MemWrite,DataAdr,WriteData,Readdata); endmodule ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// module datamem( 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]]

Ngày đăng: 29/04/2014, 16:42

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan