This guide describes how to integrate the SPI Controller IP block into ASIC or FPGA designs.
- Add RTL Files: Include
spi_controller.sv,spi_fifo.sv, andspi_protocol_engine.svin your project. - Instantiate Module: Connect all required ports (see below).
- Connect APB Interface: Wire up APB signals to your SoC bus fabric.
- Connect SPI Interface: Connect SPI signals to external devices or board pins.
- Interrupts: Connect
spi_irq_oto your interrupt controller if needed. - Configure Parameters: Set FIFO depth, data width, and baud divider as required.
spi_controller u_spi_ctrl (
.pclk_i (pclk),
.presetn_i (presetn),
.psel_i (psel),
.penable_i (penable),
.pwrite_i (pwrite),
.paddr_i (paddr),
.pwdata_i (pwdata),
.prdata_o (prdata),
.pready_o (pready),
.pslverr_o (pslverr),
.spi_clk_o (spi_clk),
.spi_mosi_o (spi_mosi),
.spi_miso_i (spi_miso),
.spi_csn_o (spi_csn),
.spi_irq_o (spi_irq)
);- pclk_i: Connect to system APB clock (e.g., 100 MHz).
- presetn_i: Connect to system reset (active low).
- Connect all APB signals to your SoC's APB bus fabric.
- Ensure address decoding matches the register map.
- Connect
spi_clk_o,spi_mosi_o,spi_csn_oto board pins or other IP. - Connect
spi_miso_ito the SPI slave device.
- Connect
spi_irq_oto your interrupt controller or processor. - Enable/disable interrupts via the INT register.
- Use provided constraints for pin mapping and timing.
- Simulate with Vivado/Quartus or Cocotb testbenches.
- Use OpenLane or commercial flows for synthesis and P&R.
- Provide SDC constraints for timing.
For further help, contact the Vyges team or refer to the design specification.