Skip to main content

Understanding the Project and the Blocks Used

Below are the main blocks that make up our RISC-V project, in a structure similar to the previous tutorials.

The central processor, responsible for fetching, decoding, and executing instructions, as well as handling memory/register reads and writes.

  • Main Inputs:

    • clk: the system clock

    • reset: global reset signal

    • instruction: the instruction from the instruction memory (imem)

    • read_data: data returned by the data memory (blockram)

  • Main Outputs:

    • pc: the program counter value

    • mem_write_Mem: enables writes to data memory

    • write_data: the value to be written to data memory

    • alu_result_Exec: result of arithmetic/logic operations

    • reg_write_WB: enables writes to the register file

    • Function: The instruction memory for RISC-V.

    • Behavior: Receives pc and returns the corresponding instruction on instr.

    • Function: Data memory for load and store operations.

    • Behavior: Used by the processor to read (read_data) or write (write_data) data at the address (addr) provided by the ALU.

    • Function: The RISC-V register file (x0 to x31).

    • Behavior: Reads or writes values based on control signals (reg_write_WB, RS1, RS2, RD).

    • Function: Inverts the input signal (commonly used for generating an active-low reset).

    • Function: Generates a 1 Hz clock for slowing down and making the system operation more observable (optional).

    • Function: Displays data on a screen, useful for seeing register values or debug messages.

    • Function: Converts characters into bitmaps to be displayed by screen.

    • Function: Support modules for signal routing, bus multiplexing, and instruction decoding.

 

Finally, a top module integrates all these components, mapping outputs to physical pins.