----------------------------------------------------------------------------------------------------------------
See example constraints based on a sample datasheet:
Looking at the datasheet, the input_delay -min/max and output_delay -min/max should be as follow:
• Input setup time (set_input_delay -max) = 28ns
• Input hold time (set_input_delay -min) = 10ns
• Output setup time (set_output_delay -max) = 12ns
• Output hold time (set_output_delay -min) = 0ns
*For the transmit domain, it is not strictly source-synchronous because the clock comes from the PHY chip so the delay of the clock signal should be taken care into account, but usually the delay is very small (almost negligible) if the clock is running at 40ns.
Draft constraints based on the specs:
//For the RXCLK:
create_clock -name RXCLK_virtual -period <period_value> // Virtual clock for the RX
create_clock -name RXCLK -period <period_value> {get_ports RX_CLK}
set_clock_latency <clock_delay on board to FPGA> {get_clocks RX_CLK} // Can be ignored since it's source synchronous.
//For the TXCLK:
create_generated_clock -name TXCLK -source <clock_source> -divide_by X {get_ports TX_CLK} //assuming it is generated from a clock source
//--OR--
create_clock -name TXCLK_virtual -period <period_value> // Virtual clock for the TX if TX is input
create_clock -name TXCLK -period <period_value> {get_ports TX_CLK} // TX_CLK as input
set_clock_latency <clock_delay on board to FPGA> {get_clocks TX_CLK} // Can be ignored if running at a low speed.
//For the inputs
set_input_delay -clock {get_clocks RXCLK_virtual} -max 28
set_input_delay -clock {get_clocks RXCLK_virtual} -min 10
//For the outputs
set_output_delay -clock {get_clocks TXCLK} -max 12
set_output_delay -clock {get_clocks TXCLK} -min 0
No need for the -clock_fall variant of the constraint MII interface is sampled at the rising edge of the RXCLK and TXCLK.