Skip to content

Latest commit

 

History

History
59 lines (50 loc) · 3.33 KB

Day8.md

File metadata and controls

59 lines (50 loc) · 3.33 KB

Back to TOC
Prev: Day7$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$Next: Day9


Day 8: Basic RISC-V CPU Microarchitecture

Our objective is to implement a basic RISC-V CPU core (RV32I Base Instruction set except the instructions - FENCE, ECALL & EBREAK).
The following diagrams show the general block diagram of the CPU and the initial implementation pipeline diagram using TL-Verilog:

CPU Block Diagram
D8_CPU_BlockDiagram
TL-Verilog based implementation pipeline/ flow diagram
D8_Basic_CPU_Implementation

The implementation is done stage-by-stage verifying the functionality at each step in the Makerchip IDE. The following logic blocks are implemented and verified:

  • Program Counter (PC)
  • Instruction Fetch from Instruction Memory (IMEM Read)
  • Instruction Decoder
    • Instruction Type Decode (I, R, S, B, U, J)
    • Instruction Immediate Value Decoding
    • Instruction Field Decoding
    • Complete Instruction Decoding
  • Register File Read
  • Arithmetic & Logic Unit (ALU)
  • Register File Write
  • Branch Instructions
    • (Modifying PC logic and adding additional logic to handle the Branch instructions)

8.1 Program Counter + Instruction Fetch

Program Counter + Intruction Fetch
D8_Instruction_Fetch
D8_PC_+_InstrFetch

8.2 Instruction Decoder

Instruction Decoder
D8_InstrDecoder
RISC-V Opcode Map
D8_RISC-V_OpcodeMap
RISC-V Instruction Format
D8_RISCV_ISA_Encoding
RV32I ISA Encoding
D8_RISCV_RV32I_ISA_Encoding
Instruction Type Decoding
D8_RV32I_InstructionType_Decode
Immediate Value Decoding
D8_ImmediateValue_Decoding

8.3 Register File Read

Register File Read
D8_RF_Read
Register File module interface
D8_RF_Interface

8.4 ALU

ALU (only ADD, ADDI implemented for now)
D8_ALU

8.5 Register File Write

Register File Write
D8_RF_Write

8.6 Branch Instruction Logic

Branch Instruction Logic added
D8_Basic_RISC-V_CPU_Unpipelined

Prev: Day7$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$Next: Day9