I'm using Xilinx Spartan 6 Automotive FPGA. My FPGA design has a SPI interface to a external peripheral.
From FPGA to the peripheral, I have these SPI related signals:
- spi clk
- spi data (mosi) - the data is presented on the falling edge of the spi clk
From the peripheral to FPGA:
- spi data (miso) - the data is presented on the rising edge using the spi clk received from FPGA
FPGA samples the MISO SPI data using the SPI CLK falling edge - it's generated internally (via a state machine).
Now, I want to add a timing constraint on the MISO pin to ensure the MISO data reaches the first sync component (a latch clocked by spi clk) without violating the setup and hold time. Which Xilinx timing constraint should I use?
Some options I was looking into are OFFSET IN, FROM/TO...
I perfer OFFSET IN because it relates data to the clock, but I cannot figure how to specify an internal clock (I don't have SPI clk loopback). FROM/TO might work, but it's not relative to the clock.