bd.tcl 7.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. proc init { cellpath otherInfo } {
  2. set cell_handle [get_bd_cells $cellpath]
  3. set all_busif [get_bd_intf_pins $cellpath/*]
  4. set axi_standard_param_list [list ID_WIDTH AWUSER_WIDTH ARUSER_WIDTH WUSER_WIDTH RUSER_WIDTH BUSER_WIDTH]
  5. set full_sbusif_list [list ]
  6. foreach busif $all_busif {
  7. if { [string equal -nocase [get_property MODE $busif] "slave"] == 1 } {
  8. set busif_param_list [list]
  9. set busif_name [get_property NAME $busif]
  10. if { [lsearch -exact -nocase $full_sbusif_list $busif_name ] == -1 } {
  11. continue
  12. }
  13. foreach tparam $axi_standard_param_list {
  14. lappend busif_param_list "C_${busif_name}_${tparam}"
  15. }
  16. bd::mark_propagate_only $cell_handle $busif_param_list
  17. }
  18. }
  19. }
  20. proc pre_propagate {cellpath otherInfo } {
  21. set cell_handle [get_bd_cells $cellpath]
  22. set all_busif [get_bd_intf_pins $cellpath/*]
  23. set axi_standard_param_list [list ID_WIDTH AWUSER_WIDTH ARUSER_WIDTH WUSER_WIDTH RUSER_WIDTH BUSER_WIDTH]
  24. foreach busif $all_busif {
  25. if { [string equal -nocase [get_property CONFIG.PROTOCOL $busif] "AXI4"] != 1 } {
  26. continue
  27. }
  28. if { [string equal -nocase [get_property MODE $busif] "master"] != 1 } {
  29. continue
  30. }
  31. set busif_name [get_property NAME $busif]
  32. foreach tparam $axi_standard_param_list {
  33. set busif_param_name "C_${busif_name}_${tparam}"
  34. set val_on_cell_intf_pin [get_property CONFIG.${tparam} $busif]
  35. set val_on_cell [get_property CONFIG.${busif_param_name} $cell_handle]
  36. if { [string equal -nocase $val_on_cell_intf_pin $val_on_cell] != 1 } {
  37. if { $val_on_cell != "" } {
  38. set_property CONFIG.${tparam} $val_on_cell $busif
  39. }
  40. }
  41. }
  42. }
  43. }
  44. proc propagate {cellpath otherInfo } {
  45. set cell_handle [get_bd_cells $cellpath]
  46. set all_busif [get_bd_intf_pins $cellpath/*]
  47. set axi_standard_param_list [list ID_WIDTH AWUSER_WIDTH ARUSER_WIDTH WUSER_WIDTH RUSER_WIDTH BUSER_WIDTH]
  48. foreach busif $all_busif {
  49. if { [string equal -nocase [get_property CONFIG.PROTOCOL $busif] "AXI4"] != 1 } {
  50. continue
  51. }
  52. if { [string equal -nocase [get_property MODE $busif] "slave"] != 1 } {
  53. continue
  54. }
  55. set busif_name [get_property NAME $busif]
  56. foreach tparam $axi_standard_param_list {
  57. set busif_param_name "C_${busif_name}_${tparam}"
  58. set val_on_cell_intf_pin [get_property CONFIG.${tparam} $busif]
  59. set val_on_cell [get_property CONFIG.${busif_param_name} $cell_handle]
  60. if { [string equal -nocase $val_on_cell_intf_pin $val_on_cell] != 1 } {
  61. #override property of bd_interface_net to bd_cell -- only for slaves. May check for supported values..
  62. if { $val_on_cell_intf_pin != "" } {
  63. set_property CONFIG.${busif_param_name} $val_on_cell_intf_pin $cell_handle
  64. }
  65. }
  66. }
  67. }
  68. }