recreateIp.tcl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ##################################################################
  2. # CHECK VIVADO VERSION
  3. ##################################################################
  4. set scripts_vivado_version 2024.1
  5. set current_vivado_version [version -short]
  6. if { [string first $scripts_vivado_version $current_vivado_version] == -1 } {
  7. catch {common::send_msg_id "IPS_TCL-100" "ERROR" "This script was generated using Vivado <$scripts_vivado_version> and is being run in <$current_vivado_version> of Vivado. Please run the script in Vivado <$scripts_vivado_version> then open the design in Vivado <$current_vivado_version>. Upgrade the design by running \"Tools => Report => Report IP Status...\", then run write_ip_tcl to create an updated script."}
  8. return 1
  9. }
  10. ##################################################################
  11. # START
  12. ##################################################################
  13. # To test this script, run the following commands from Vivado Tcl console:
  14. # source recreateIp.tcl
  15. # If there is no project opened, this script will create a
  16. # project, but make sure you do not have an existing project
  17. # in the current working folder.
  18. set list_projs [get_projects -quiet]
  19. if { $list_projs eq "" } {
  20. create_project VNA_PCIE_PROJ VNA_PCIE_PROJ -part xc7a100tfgg484-2
  21. set_property target_language Verilog [current_project]
  22. set_property simulator_language Mixed [current_project]
  23. }
  24. ##################################################################
  25. # CHECK IPs
  26. ##################################################################
  27. set bCheckIPs 1
  28. set bCheckIPsPassed 1
  29. if { $bCheckIPs == 1 } {
  30. set list_check_ips { xilinx.com:ip:clk_wiz:6.0 xilinx.com:ip:fifo_generator:13.2 xilinx.com:ip:pcie_7x:3.3 }
  31. set list_ips_missing ""
  32. common::send_msg_id "IPS_TCL-1001" "INFO" "Checking if the following IPs exist in the project's IP catalog: $list_check_ips ."
  33. foreach ip_vlnv $list_check_ips {
  34. set ip_obj [get_ipdefs -all $ip_vlnv]
  35. if { $ip_obj eq "" } {
  36. lappend list_ips_missing $ip_vlnv
  37. }
  38. }
  39. if { $list_ips_missing ne "" } {
  40. catch {common::send_msg_id "IPS_TCL-105" "ERROR" "The following IPs are not found in the IP Catalog:\n $list_ips_missing\n\nResolution: Please add the repository containing the IP(s) to the project." }
  41. set bCheckIPsPassed 0
  42. }
  43. }
  44. if { $bCheckIPsPassed != 1 } {
  45. common::send_msg_id "IPS_TCL-102" "WARNING" "Will not continue with creation of design due to the error(s) above."
  46. return 1
  47. }
  48. ##################################################################
  49. # CREATE IP ClkPllSysTo125
  50. ##################################################################
  51. set ClkPllSysTo125 [create_ip -name clk_wiz -vendor xilinx.com -library ip -version 6.0 -module_name ClkPllSysTo125]
  52. # User Parameters
  53. set_property -dict [list \
  54. CONFIG.CLKOUT1_DRIVES {BUFG} \
  55. CONFIG.CLKOUT1_JITTER {203.457} \
  56. CONFIG.CLKOUT1_PHASE_ERROR {155.540} \
  57. CONFIG.CLKOUT1_REQUESTED_OUT_FREQ {50.000} \
  58. CONFIG.CLKOUT2_DRIVES {BUFG} \
  59. CONFIG.CLKOUT3_DRIVES {BUFG} \
  60. CONFIG.CLKOUT4_DRIVES {BUFG} \
  61. CONFIG.CLKOUT5_DRIVES {BUFG} \
  62. CONFIG.CLKOUT6_DRIVES {BUFG} \
  63. CONFIG.CLKOUT7_DRIVES {BUFG} \
  64. CONFIG.MMCM_BANDWIDTH {OPTIMIZED} \
  65. CONFIG.MMCM_CLKFBOUT_MULT_F {17} \
  66. CONFIG.MMCM_CLKOUT0_DIVIDE_F {17} \
  67. CONFIG.MMCM_COMPENSATION {ZHOLD} \
  68. CONFIG.MMCM_DIVCLK_DIVIDE {2} \
  69. CONFIG.PRIMITIVE {PLL} \
  70. CONFIG.PRIM_SOURCE {Single_ended_clock_capable_pin} \
  71. CONFIG.SECONDARY_SOURCE {Single_ended_clock_capable_pin} \
  72. CONFIG.USE_LOCKED {false} \
  73. CONFIG.USE_PHASE_ALIGNMENT {false} \
  74. CONFIG.USE_RESET {false} \
  75. ] [get_ips ClkPllSysTo125]
  76. # Runtime Parameters
  77. set_property -dict {
  78. GENERATE_SYNTH_CHECKPOINT {1}
  79. } $ClkPllSysTo125
  80. ##################################################################
  81. ##################################################################
  82. # CREATE IP MeasDataFifo
  83. ##################################################################
  84. set MeasDataFifo [create_ip -name fifo_generator -vendor xilinx.com -library ip -version 13.2 -module_name MeasDataFifo]
  85. # User Parameters
  86. set_property CONFIG.Input_Data_Width {288} [get_ips MeasDataFifo]
  87. # Runtime Parameters
  88. set_property -dict {
  89. GENERATE_SYNTH_CHECKPOINT {1}
  90. } $MeasDataFifo
  91. ##################################################################
  92. ##################################################################
  93. # CREATE IP pcie1234
  94. ##################################################################
  95. set pcie1234 [create_ip -name pcie_7x -vendor xilinx.com -library ip -version 3.3 -module_name pcie1234]
  96. # User Parameters
  97. set_property -dict [list \
  98. CONFIG.Device_ID {7012} \
  99. CONFIG.Interface_Width {64_bit} \
  100. CONFIG.Link_Speed {2.5_GT/s} \
  101. CONFIG.Max_Payload_Size {512_bytes} \
  102. CONFIG.Maximum_Link_Width {X2} \
  103. CONFIG.PCIe_Blk_Locn {X0Y0} \
  104. CONFIG.Trans_Buf_Pipeline {None} \
  105. CONFIG.User_Clk_Freq {125} \
  106. CONFIG.en_ext_pipe_interface {false} \
  107. CONFIG.pipe_mode_sim {Enable_Pipe_Simulation} \
  108. CONFIG.pipe_sim {true} \
  109. ] [get_ips pcie1234]
  110. # Runtime Parameters
  111. set_property -dict {
  112. GENERATE_SYNTH_CHECKPOINT {1}
  113. } $pcie1234
  114. ##################################################################