This repository contains the implementation of a Systolic Array Matrix Multiplier, written in SpinalHDL. The matrix multiplier leverages systolic array architecture to efficiently perform matrix multiplication.
- Configurable data width
- Configurable matrix dimensions (number of columns and rows)
- Uses systolic array architecture for efficient computation
- Input and output interfaces for matrix data
- Valid and Done signals for result validity and computation completion
MatrixMultiplier.scala
: Contains the main implementation of the Systolic Array Matrix Multiplier, ShiftRegister, and Processing Element (PE) classes.
- Clone the repository.
- Make sure you have installed SpinalHDL and its dependencies.
- Modify the
SystolicArrayConfig
,ShiftRegisterConfig
, andPeConfig
classes in theMatrixMultiplier.scala
file to customize the matrix multiplier's parameters. - To generate the Verilog code, run the
SystolicAarrayVerilog
object in theMatrixMultiplier.scala
file.
The following example demonstrates how to use the Systolic Array Matrix Multiplier.
import spinal.core._
import matrixMultiplier._
object MySystolicArrayExample {
def main(args: Array[String]): Unit = {
val systolicArrayConfig = SystolicArrayConfig(
xCols = 8,
wCols = 8,
wRows = 8,
dataWidth = 32
)
val report = SpinalConfig.generateVerilog(SystolicArray(systolicArrayConfig))
report.printPruned()
}
}
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to contribute by submitting pull requests or opening issues to discuss any potential improvements or fixes.
Please make sure your code follows the existing code style and provide detailed commit messages.
For any questions or concerns, please open an issue on this repository.
Please note that this is a toy project and not intended for production use. Use at your own risk.