Description: Design a simplified version of a MIPS machine and write Verilog programs that describe its structure and simulate its functioning. Use structural (gate level) modeling for all components unless otherwise specified. The machine should include the following components:
- General purpose registers (register file): 4 registers, 16-bit long, numbered 0 - 3. Register $0 must contain 0 (read-only). Implemented by D flip-flops with gate-level modeling.
- Other registers: 16-bit program counter, pipeline registers. Implemented by reg vectors in Verilog.
- Istruction Memory. Word size: 16 bits, word addressed, size: 1024 bytes. Implemented by reg vectors in Verilog.
- Data Memory. Word size: 16 bits, byte addressed, size: 1024 bytes. Implemented by reg vectors in Verilog.
- Data Cache (optional): direct mapped, write-through, 16-bit block size, size: 8 blocks. Any kind of Verilog model accepted.
- ALU: 16-bit data, 3-bit control. Functions: and, or, add, sub, slt.
- Control unit: may be implemented by behavioral modeling.
- Other components necessary to connect the main components: multiplexes and decoders implemented by gate-level modeling.
Instruction | Opcode |
---|---|
add | 0000 |
sub | 0001 |
and | 0010 |
or | 0011 |
addi | 0100 |
lw | 0101 |
sw | 0110 |
slt | 0111 |
beq | 1000 |
bne | 1001 |
Instruction formats:
R-format (add, sub, and, or, slt)
op | rs | rt | rd | unused |
---|---|---|---|---|
4 | 2 | 2 | 2 | 6 |
I-format (addi, lw, sw, beq, bne)
op | rs | rt | address / value |
---|---|---|---|
4 | 2 | 2 | 8 |
Restrictions:
- Use structural (gate level) modeling for all components except for the program counter, memories, and pipeline registers.
- Implement a pipelined datapath and control.