@@ -491,7 +491,7 @@ ad_ip_parameter axi_apollo_rx_dma CONFIG.MAX_BYTES_PER_BURST 4096
491491ad_ip_parameter axi_apollo_rx_dma CONFIG.CYCLIC 0
492492ad_ip_parameter axi_apollo_rx_dma CONFIG.DMA_DATA_WIDTH_SRC $adc_data_width 
493493if  {$ADI_PHY_SEL } {
494-   ad_ip_parameter axi_apollo_rx_dma CONFIG.DMA_DATA_WIDTH_DEST $adc_data_width 
494+   ad_ip_parameter axi_apollo_rx_dma CONFIG.DMA_DATA_WIDTH_DEST [ expr  min(1024,  $adc_data_width )] 
495495} else  {
496496  #  Versal limitation
497497  ad_ip_parameter axi_apollo_rx_dma CONFIG.DMA_DATA_WIDTH_DEST [expr  min(512, $adc_data_width )]
@@ -592,7 +592,7 @@ ad_ip_parameter axi_apollo_tx_dma CONFIG.DMA_2D_TRANSFER 0
592592ad_ip_parameter axi_apollo_tx_dma CONFIG.CYCLIC 1
593593ad_ip_parameter axi_apollo_tx_dma CONFIG.MAX_BYTES_PER_BURST 4096
594594if  {$ADI_PHY_SEL } {
595-   ad_ip_parameter axi_apollo_tx_dma CONFIG.DMA_DATA_WIDTH_SRC $dac_data_width 
595+   ad_ip_parameter axi_apollo_tx_dma CONFIG.DMA_DATA_WIDTH_SRC [ expr  min(1024,  $dac_data_width )] 
596596} else  {
597597  #  Versal limitation
598598  ad_ip_parameter axi_apollo_tx_dma CONFIG.DMA_DATA_WIDTH_SRC [expr  min(512, $dac_data_width )]
@@ -797,16 +797,24 @@ if {$ASYMMETRIC_A_B_MODE} {
797797  }
798798} else  {
799799  set  max_lane_map {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
800-   #  set lane_map {}
801- 
802-   #  for {set i 0}  {$i < $RX_NUM_LINKS} {incr i} {
803-   #    for {set j 0}  {$j < $RX_JESD_L} {incr j} {
804-   #      set cur_lane [expr $i*$MAX_RX_LANES_PER_LINK+$j]
805-   #      lappend lane_map [lindex $max_lane_map $cur_lane]
806-   #    }
807-   #  }
800+   set  lane_map {}
801+ 
802+   for  {set  i 0}  {$i  < $RX_NUM_LINKS } {incr  i} {
803+     for  {set  j 0}  {$j  < $RX_JESD_L } {incr  j} {
804+       set  cur_lane [expr  $i *$MAX_RX_LANES_PER_LINK +$j ]
805+       lappend  lane_map [lindex  $max_lane_map  $cur_lane ]
806+     }
807+   }
808+ 
809+   for  {set  i 0}  {$i  < $RX_NUM_LINKS } {incr  i} {
810+     for  {set  j $RX_JESD_L }  {$j  < $MAX_RX_LANES_PER_LINK } {incr  j} {
811+       set  cur_lane [expr  $i *$MAX_RX_LANES_PER_LINK +$j ]
812+       lappend  lane_map [lindex  $max_lane_map  $cur_lane ]
813+     }
814+   }
815+ 
808816  if  {$ADI_PHY_SEL } {
809-     ad_xcvrcon  util_apollo_xcvr axi_apollo_rx_xcvr axi_apollo_rx_jesd $max_lane_map   {} rx_device_clk $MAX_RX_LANES 
817+     ad_xcvrcon  util_apollo_xcvr axi_apollo_rx_xcvr axi_apollo_rx_jesd $lane_map   {} rx_device_clk $MAX_RX_LANES 
810818    create_bd_port -dir I rx_sysref_12
811819    create_bd_port -dir O rx_sync_12
812820  }
@@ -828,16 +836,34 @@ if {$ASYMMETRIC_A_B_MODE} {
828836  }
829837} else  {
830838  set  max_lane_map {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
831-   #  set lane_map {}
832- 
833-   #  for {set i 0}  {$i < $TX_NUM_LINKS} {incr i} {
834-   #    for {set j 0}  {$j < $TX_JESD_L} {incr j} {
835-   #      set cur_lane [expr $i*$MAX_TX_LANES_PER_LINK+$j]
836-   #      lappend lane_map [lindex $max_lane_map $cur_lane]
837-   #    }
838-   #  }
839+   set  lane_map {}
840+ 
841+  for  {set  i 0}  {$i  < $TX_NUM_LINKS } {incr  i} {
842+     for  {set  j 0}  {$j  < $TX_JESD_L } {incr  j} {
843+       set  cur_lane [expr  $i *$MAX_TX_LANES_PER_LINK +$j ]
844+       lappend  lane_map [lindex  $max_lane_map  $cur_lane ]
845+     }
846+   }
847+ 
848+   for  {set  i 0}  {$i  < $TX_NUM_LINKS } {incr  i} {
849+     for  {set  j $TX_JESD_L }  {$j  < $MAX_TX_LANES_PER_LINK } {incr  j} {
850+       set  cur_lane [expr  $i *$MAX_TX_LANES_PER_LINK +$j ]
851+       lappend  lane_map [lindex  $max_lane_map  $cur_lane ]
852+     }
853+   }
854+ 
839855  if  {$ADI_PHY_SEL } {
840-     ad_xcvrcon  util_apollo_xcvr axi_apollo_tx_xcvr axi_apollo_tx_jesd $max_lane_map  {} tx_device_clk $MAX_TX_LANES 
856+     ad_xcvrcon  util_apollo_xcvr axi_apollo_tx_xcvr axi_apollo_tx_jesd $lane_map  {} tx_device_clk $MAX_TX_LANES 
857+ 
858+     if  {$TX_JESD_L  == 8} {
859+       delete_bd_objs [get_bd_intf_nets axi_apollo_tx_xcvr_up_cm_8]
860+       delete_bd_objs [get_bd_intf_nets axi_apollo_tx_xcvr_up_cm_12]
861+       connect_bd_intf_net [get_bd_intf_pins axi_apollo_tx_xcvr/up_cm_8] [get_bd_intf_pins util_apollo_xcvr/up_cm_12]
862+       connect_bd_intf_net [get_bd_intf_pins axi_apollo_tx_xcvr/up_cm_12] [get_bd_intf_pins util_apollo_xcvr/up_cm_16]
863+     } elseif  {$TX_JESD_L  == 4} {
864+       delete_bd_objs [get_bd_intf_nets axi_apollo_tx_xcvr_up_cm_4]
865+       connect_bd_intf_net [get_bd_intf_pins axi_apollo_tx_xcvr/up_cm_4] [get_bd_intf_pins util_apollo_xcvr/up_cm_12]
866+     }
841867    create_bd_port -dir I tx_sysref_12
842868    create_bd_port -dir I tx_sync_12
843869  }
0 commit comments