Altera_Forum
Honored Contributor
11 years agoConstraining an SPI interface
Hello all,
What is the proper way of constraining a 4-wire SPI master interface? I have several devices connected to my SPI bus, and fastest one can accecpt a SCLK up to 33 ns period, with setup and hold times of 5 ns. First off, I'm deriving my SCLK signal by dividing down (using fabric, not a PLL) the main clock (125 MHz core clock of the PCIe core) that drives my state machine that shifts out bit on the MOSI line (and in on the MISO line). First question: should I declare that SCLK as virtual or not? By looking at all the examples I found it looks like all the non-virtual clock must be generated by free-running oscillators and/or PLLs. Second question: using the app note 433, system-centric approach, if we consider all the trace delays for data and clock the same, it looks like I should be declaring those two output delays set_output_delay -clock my_spi_clk_virt -max 5.0 [get_ports MOSI] set_output_delay -clock my_spi_clk_virt -min -5.0 [get_ports MOSI] set_output_delay -clock my_spi_clk_virt -max 5.0 [get_ports SSn] set_output_delay -clock my_spi_clk_virt -min -5.0 [get_ports SSn] Anything wrong with this approach? Last question: how do I constrain the MISO port? Thanks!!