Simple Mips Processor in Verilog
Simple Mips Processor in Verilog
Verilog
Data Memory
• module DM(MemRead, MemWrite, ABUS,
DIN, DATABUS);
– MemWrite: Nothing happens if 0. If 1, the memory at
location ABUS will be written with DIN.
– ABUS: At any moment, the data at location ABUS will
appear at DATABUS.
– MemRead: Not used.
Data Memory
• Address bus: 8 bits.
• Data bus: 32 bits. Each memory location holds
32 bits.
Data Memory
• Init the contents in data memory with any
value you like:
initial
begin
for (i=0; i <= DM_ADDR_MAX_m1; i = i + 1)
ram[i] = i*10 + 1;
end
Instruction Memory
• module IM(CSB,WRB,ABUS,DATABUS);
– CSB: chip select. If 0, selected. If 1, not selected.
– WRB: Not used.
– ABUS: Address bus. At any moment, if chip is selected,
the data at location ABUS will appear at DATABUS.
Instruction Memory
• Address bus: 8 bits.
• Data bus: 32 bits. Each memory location holds
32 bits.
Instruction Memory
• The most straightforward way of loading a program: