From 40265a3e1c002bd73eee768684a6ef5431011ccc Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 18 May 2021 18:30:33 -0700 Subject: [PATCH] Add timing constraints for Quartus Prime Pro --- syn/quartus_pro/eth_mac_1g_gmii.sdc | 34 ++++++++++++++++++++++++++++ syn/quartus_pro/eth_mac_1g_rgmii.sdc | 34 ++++++++++++++++++++++++++++ syn/quartus_pro/eth_mac_fifo.sdc | 31 +++++++++++++++++++++++++ syn/quartus_pro/gmii_phy_if.sdc | 28 +++++++++++++++++++++++ syn/quartus_pro/mii_phy_if.sdc | 28 +++++++++++++++++++++++ syn/quartus_pro/rgmii_phy_if.sdc | 32 ++++++++++++++++++++++++++ 6 files changed, 187 insertions(+) create mode 100644 syn/quartus_pro/eth_mac_1g_gmii.sdc create mode 100644 syn/quartus_pro/eth_mac_1g_rgmii.sdc create mode 100644 syn/quartus_pro/eth_mac_fifo.sdc create mode 100644 syn/quartus_pro/gmii_phy_if.sdc create mode 100644 syn/quartus_pro/mii_phy_if.sdc create mode 100644 syn/quartus_pro/rgmii_phy_if.sdc diff --git a/syn/quartus_pro/eth_mac_1g_gmii.sdc b/syn/quartus_pro/eth_mac_1g_gmii.sdc new file mode 100644 index 000000000..e765e1988 --- /dev/null +++ b/syn/quartus_pro/eth_mac_1g_gmii.sdc @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Alex Forencich +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# GMII Gigabit Ethernet MAC timing constraints + +proc constrain_eth_mac_1g_gmii_inst { inst } { + puts "Inserting timing constraints for eth_mac_1g_gmii instance $inst" + + # MII select sync + set_data_delay -from [get_registers "$inst|mii_select_reg"] -to [get_registers "$inst|tx_mii_select_sync[0]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + set_data_delay -from [get_registers "$inst|mii_select_reg"] -to [get_registers "$inst|rx_mii_select_sync[0]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + + # RX prescale sync + set_data_delay -from [get_registers "$inst|rx_prescale[2]"] -to [get_registers "$inst|rx_prescale_sync[0]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + + constrain_gmii_phy_if_inst "$inst|gmii_phy_if_inst" +} diff --git a/syn/quartus_pro/eth_mac_1g_rgmii.sdc b/syn/quartus_pro/eth_mac_1g_rgmii.sdc new file mode 100644 index 000000000..e223b1313 --- /dev/null +++ b/syn/quartus_pro/eth_mac_1g_rgmii.sdc @@ -0,0 +1,34 @@ +# Copyright (c) 2021 Alex Forencich +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# RGMII Gigabit Ethernet MAC timing constraints + +proc constrain_eth_mac_1g_rgmii_inst { inst } { + puts "Inserting timing constraints for eth_mac_1g_rgmii instance $inst" + + # MII select sync + set_data_delay -from [get_registers "$inst|mii_select_reg"] -to [get_registers "$inst|tx_mii_select_sync[0]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + set_data_delay -from [get_registers "$inst|mii_select_reg"] -to [get_registers "$inst|rx_mii_select_sync[0]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + + # RX prescale sync + set_data_delay -from [get_registers "$inst|rx_prescale[2]"] -to [get_registers "$inst|rx_prescale_sync[0]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + + constrain_rgmii_phy_if_inst "$inst|rgmii_phy_if_inst" +} diff --git a/syn/quartus_pro/eth_mac_fifo.sdc b/syn/quartus_pro/eth_mac_fifo.sdc new file mode 100644 index 000000000..dd8685c15 --- /dev/null +++ b/syn/quartus_pro/eth_mac_fifo.sdc @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Alex Forencich +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# Ethernet MAC with FIFO timing constraints + +proc constrain_eth_mac_fifo_inst { inst } { + puts "Inserting timing constraints for ethernet MAC with FIFO instance $inst" + + # RX status sync + set_data_delay -from [get_registers "$inst|rx_sync_reg_1_reg[*]"] -to [get_registers "$inst|rx_sync_reg_2_reg[*]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 + + # TX status sync + set_data_delay -from [get_registers "$inst|tx_sync_reg_1_reg[*]"] -to [get_registers "$inst|tx_sync_reg_2_reg[*]"] -override -get_value_from_clock_period dst_clock_period -value_multiplier 0.8 +} diff --git a/syn/quartus_pro/gmii_phy_if.sdc b/syn/quartus_pro/gmii_phy_if.sdc new file mode 100644 index 000000000..c42f7fa73 --- /dev/null +++ b/syn/quartus_pro/gmii_phy_if.sdc @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Alex Forencich +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# GMII PHY IF timing constraints + +proc constrain_gmii_phy_if_inst { inst } { + puts "Inserting timing constraints for gmii_phy_if instance $inst" + + # reset synchronization + set_false_path -from * -to [get_registers "$inst|tx_rst_reg[*] $inst|rx_rst_reg[*]"] +} diff --git a/syn/quartus_pro/mii_phy_if.sdc b/syn/quartus_pro/mii_phy_if.sdc new file mode 100644 index 000000000..2f35e7af7 --- /dev/null +++ b/syn/quartus_pro/mii_phy_if.sdc @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Alex Forencich +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# MII PHY IF timing constraints + +proc constrain_mii_phy_if_inst { inst } { + puts "Inserting timing constraints for mii_phy_if instance $inst" + + # reset synchronization + set_false_path -from * -to [get_registers "$inst|tx_rst_reg[*] $inst|rx_rst_reg[*]"] +} diff --git a/syn/quartus_pro/rgmii_phy_if.sdc b/syn/quartus_pro/rgmii_phy_if.sdc new file mode 100644 index 000000000..3bb5948ac --- /dev/null +++ b/syn/quartus_pro/rgmii_phy_if.sdc @@ -0,0 +1,32 @@ +# Copyright (c) 2021 Alex Forencich +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# RGMII PHY IF timing constraints + +proc constrain_rgmii_phy_if_inst { inst } { + puts "Inserting timing constraints for rgmii_phy_if instance $inst" + + # reset synchronization + set_false_path -from * -to [get_registers "$inst|tx_rst_reg[*] $inst|rx_rst_reg[*]"] + + # clock output + # set_max_delay -from [get_registers "$inst|rgmii_tx_clk_1"] -to [get_cells "$inst|clk_oddr_inst|altddio_out_inst|auto_generated|ddio_outa[0]"] 2.000 + # set_max_delay -from [get_registers "$inst|rgmii_tx_clk_2"] -to [get_cells "$inst|clk_oddr_inst|altddio_out_inst|auto_generated|ddio_outa[0]"] 2.000 +}