MiniMIPS is a compact and efficient RISC (Reduced Instruction Set Computer) processor inspired by the MIPS architecture. This project is a part of Computer Organisation and Architercture Lab [CS39001] Course. This guide outlines the detailed steps required to set up, simulate, and deploy the processor design using Vivado and FPGA. Follow the instructions step-by-step for a seamless workflow:
- Open Vivado and create a new project.
- Use the IP Catalog feature:
- Navigate to the Memory & Storage Elements category.
- Select Block Memory Generator.
- Refer the Memory folder for exact configurations of both BRAM generated
- Configure two separate memories: Instruction Memory and Data Memory.
- Ensure that both memories have the required address widths and data widths.
- Add the wrapper modules BRAM_Data.v and BRAM_Instructions.v.
- Copy all Verilog modules from the
DataPath
folder into the Vivado project: - For each module:
- Open and review its interface (inputs, outputs, and parameter declarations).
- Ensure no naming conflicts between modules.
- Add testbenches (if not already provided) to verify their standalone functionality.
- Check that wires between modules (e.g., ALU output to register bank input) are logically correct.
- Copy the
Control Unit
andBranch Control
Verilog files into the project:- Control Unit: Responsible for generating control signals based on instruction opcodes.
- Branch Control: Handles branching and jump operations.
- Use individual testbenches to validate signal generation for various instructions.
- Copy the
Processor.v
file into the project. - Steps to integrate:
- Include connections to both the
DataPath
andControlPath
modules. - Ensure input clock and reset signals are correctly routed.
- If the design involves hierarchical modules, verify module instantiations in
Processor.v
. - Set as the Top Module, navigate to Project Settings > Top Module and select
Processor.v
. - Run initial synthesis to check for unresolved ports or errors.
- Include connections to both the
- Open the
instruction.s
file for reference. - Guidelines for writing assembly:
- Follow instruction formats and opcodes as defined in the ISA.
- Use comments to annotate each instruction for clarity.
- Avoid syntax errors by using the correct labels and delimiters.
- Cross-check assembly code with the provided ISA documentation to ensure correctness.
- Use the
assembler.py
script to convert the assembly code into.coe
files: - Command:
python3 assembler.py <input_file.s>
- Verify that the input
.s
file is in the same directory asassembler.py
. - Check the output
.coe
files for errors or missing values. - If the
.coe
file is incorrect, revisit the assembly code and correct errors.
- Load the
.coe
files into the Instruction Memory and Data Memory modules:- Open each BRAM instance in Vivado.
- Navigate to the Initialization File section.
- Replace the existing file (if any) with the generated
.coe
file. - Verify Each memory module has been updated with the correct
.coe
file. - Perform a test synthesis to confirm proper initialization.
- Simulate the integrated processor design:
- Add a testbench to the
Processor.v
file. - Include realistic input stimuli (e.g., instruction sequences, initial data values).
- Check for correct control signal generation.
- Verify datapath functionality (e.g., ALU operations, memory accesses).
- Add a testbench to the
- Copy the
FPGA_Wrapper.v
file into the project. - Role of the wrapper:
- Maps internal processor signals to FPGA I/O pins.
- Adds any necessary interfacing logic.
- Ensure all FPGA pins are defined as inputs/outputs in the wrapper.
- Write and include the
FPGA_XDC.xdc
constraints file:- Map FPGA pins to physical board pins (e.g., clock, reset, I/O signals).
- Ensure Pin mappings match the FPGA board specifications.
- Steps in Vivado:
- Synthesis: Convert Verilog code into gate-level representation.
- Implementation: Map synthesized design onto the FPGA’s physical resources.
- Generate Bitstream: Create a file to program the FPGA.
- Monitor logs for errors or critical warnings.
- Open Vivado’s Hardware Manager.
- Connect to the FPGA board:
- Ensure the board is powered and connected via USB/JTAG.
- Select the generated bitstream file and upload it to the FPGA.
- Verify successful programming through Vivado.
- Use FPGA input pins to select outputs for observation:
0000
→ Current value from the ALUOut PIPO Module.0001
to1111
→ Value stored in the Register Bank at the respective index.- If outputs are incorrect, revisit the control signals and datapath connections.
- DataPath: Contains Verilog modules for the datapath design.
- ControlPath: Contains Verilog modules for the control unit.
- Memory: Contains correct configuration for BRAM Modules.
- Processor.v: Top module for integrating the design.
- FPGA_Wrapper.v: Wrapper module for FPGA implementation.
- FPGA_XDC.xdc: Constraints file for FPGA pin mapping.
- assembler.py: Python script to convert assembly code into
.coe
files.