This repository presents a fully functional Vector Load/Store Unit (VLSU) that integrates with a scalar processor to handle memory-intensive vector operations. Designed to be educational, modular, and scalable, it serves as a practical introduction to vector processing for learners and researchers alike.
The block diagram below illustrates the interaction between the Scalar Processor, Vector Co-Processor, and Memory. Instructions are issued by the scalar core and executed via the VLSU, with memory transactions handled accordingly.
The
vec_pro_ready,vec_pro_ack, andscalar_pro_readysignals manage synchronization and handshake logic.
This repository contains the datapath design of a vector processor architecture. The datapath illustrates the internal communication between key functional units and how vector instructions are executed in conjunction with scalar and control status register (CSR) components.
The datapath consists of the following main components:
- Decodes vector instructions into control and data signals.
- Outputs addresses and enables for reading/writing vector registers.
- Interfaces directly with the Vector Register File and CSR unit.
- Stores vector operands.
- Supports reading and writing of vector elements up to
MAX_VLEN.
- Stores runtime configuration such as:
VLEN: Maximum vector length.LMUL: Vector length multiplier.vstart,vlen,vl,vtype: Other vector-related control parameters.
- Interfaces with both the decode unit and VLSU.
- Handles memory operations for vector elements.
- Supports:
- Unit-stride access
- Strided access
- Indexed access
- Outputs vector memory data for writing back to registers.
- Flexible memory access patterns via the VLSU.
- Dynamic configuration through CSR programming for varying vector lengths.
- Efficient operand muxing and data routing among units.
The waveform below shows a successful sequence of vector load/store operations using ModelSim/Vivado. Key activities include valid instruction decoding, data loading, address generation, and memory interaction.
Highlights:
- Observe valid vector instructions like
V LOAD,V STORE. - Monitor address calculations, handshaking, and memory alignment.
- Verify expected opcode and func3 decoding (
0x07for VLOAD).
Our verification infrastructure validates DUT behavior through real-time comparisons between expected and actual results. The Monitor module captures internal signal transitions and flags inconsistencies.
Features:
- Built-in golden model monitor
- Custom testbench with instruction/memory logs
- End-to-end testing with result matching
Representative results include:
- Instruction execution
- Intermediate registers
- Final memory values compared with the monitor
Built-in error detection helps debug:
- Misaligned base addresses
- Invalid LMUL/VLEN
- AXI protocol errors
On detecting errors, flags are raised and logs are printed for debugging.
A Makefile is provided for compilation, elaboration, simulation, and waveform viewing using both Vivado (XSim) and ModelSim. Below are the available commands and what to expect from each.
Vivado/XSim is used for SystemVerilog simulation and waveform analysis.
-
make vivado
Run the full Vivado flow: compile → elaborate → simulate -
make viv_compile
Compile only the SystemVerilog sources withxvlog. -
make viv_elaborate
Elaborate the design usingxelab. -
make viv_waves
Launch the waveform viewer withxsim --gui.
ModelSim is available as an alternative simulator for supported environments.
make vsim
Executes the full ModelSim flow:- Creates a
worklibrary - Compiles all SystemVerilog sources
- Runs the simulation with waveforms
- Creates a
To remove all simulation artifacts and reset the environment:
make clean| Test Type | Result (Vivado / ModelSim) |
|---|---|
| Load Only | Load complete |
| Load/Store (Pass) | Load/Store test pass |
| Load/Store (Fail) | Load/Store test fail |
| CSR Config Only | Test pass |
- SystemVerilog Sources:
src/*.sv - Testbench:
test/vector_processor_tb.sv - Defines:
define/*.svh
- Vivado (for XSim): Tested with Vivado 2020.2+
- ModelSim (optional): For alternative simulation
- GNU Make: For running simulation targets
We welcome contributions!
Please refer to our Contribution Rubrics before submitting PRs or issues.
- Fazail Ali Butt (2021-EE-142)
- Shanzay Wasim (2021-EE-154)
- Zawaher Bin Asim (2021-EE-163)
- Muhammad Bilal Matloob (2021-EE-171)
Supervisor: Dr. Ubaid Ullah Fiaz
Department of Electrical Engineering, UET Lahore







