Altera_Forum
Honored Contributor
7 years agoSPI Slave Timing Constraint Question
Hi,
I have designed an spi slave component and am having problems working out the best/correct way of creating timing constraints for the interface. A quick description of my component: The input nss sclk and mosi signals are sunk to an internal clk domain running faster than the max spi clock freq. I am evaluating the nss and sclk edges and shift in data from the mosi signal and shift data back out on the miso signal. (see attached diagram) I am not sure how to constrain this interface to pass timing. As I am syncronising the incoming signals to an internal clock via 2 registers I was thinking I should false path from the input pins to the internal register stage as they are crossing clock domains. At the same time I am concerned that the relationship between sclk and mosi/miso is important and I want the fitter to know to to place the registers in a way that maintains the relationship. I am also unsure how to describe the relationship required for my miso output signal which needs to maintain a setup/hold relationship to sclk. Here is roughly what I am thinking (note these are not correct sdcs): describe the incoming spi signal relationships:
create_clock -name {virtual_sclk} -period $period_sclk
set_input_delay -clock virtual_sclk -max $maxdelays
set_input_delay -clock virtual_sclk -min $mindelays then false path the input port to register? or would this be a time to use set_max_delay? //false path option
set_false_path -from to
// or max delay
set_max_delay -from to $somedelay I was thinking for the miso I could set output min/max delay wrt virtual_sclk? set_output_delay -clock {virtual_sclk} -max/min $max/mindelays but miso is being generated at my internal clock domain and I cant sync it back to the virtual_sclk domain so I guess the timing analysis wouldnt be valid and end up with a setup relationship of the closest the two edges could get? Any help or advice would be appreciated. Thanks James