xcelium_setup.sh 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # (C) 2001-2024 Altera Corporation. All rights reserved.
  2. # Your use of Altera Corporation's design tools, logic functions and
  3. # other software and tools, and its AMPP partner logic functions, and
  4. # any output files any of the foregoing (including device programming
  5. # or simulation files), and any associated documentation or information
  6. # are expressly subject to the terms and conditions of the Altera
  7. # Program License Subscription Agreement, Altera MegaCore Function
  8. # License Agreement, or other applicable license agreement, including,
  9. # without limitation, that your use is for the sole purpose of
  10. # programming logic devices manufactured by Altera and sold by Altera
  11. # or its authorized distributors. Please refer to the applicable
  12. # agreement for further details.
  13. # ACDS 23.1 991 linux 2024.05.19.19:48:27
  14. # ----------------------------------------
  15. # xcelium - auto-generated simulation script
  16. # ----------------------------------------
  17. # This script provides commands to simulate the following IP detected in
  18. # your Quartus project:
  19. # mainpll
  20. #
  21. # Altera recommends that you source this Quartus-generated IP simulation
  22. # script from your own customized top-level script, and avoid editing this
  23. # generated script.
  24. #
  25. # Xcelium Simulation Script.
  26. # To write a top-level shell script that compiles Intel simulation libraries
  27. # and the Quartus-generated IP in your project, along with your design and
  28. # testbench files, copy the text from the TOP-LEVEL TEMPLATE section below
  29. # into a new file, e.g. named "xcelium_sim.sh", and modify text as directed.
  30. #
  31. # You can also modify the simulation flow to suit your needs. Set the
  32. # following variables to 1 to disable their corresponding processes:
  33. # - SKIP_FILE_COPY: skip copying ROM/RAM initialization files
  34. # - SKIP_DEV_COM: skip compiling the Quartus EDA simulation library
  35. # - SKIP_COM: skip compiling Quartus-generated IP simulation files
  36. # - SKIP_ELAB and SKIP_SIM: skip elaboration and simulation
  37. #
  38. # ----------------------------------------
  39. # # TOP-LEVEL TEMPLATE - BEGIN
  40. # #
  41. # # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to
  42. # # construct paths to the files required to simulate the IP in your Quartus
  43. # # project. By default, the IP script assumes that you are launching the
  44. # # simulator from the IP script location. If launching from another
  45. # # location, set QSYS_SIMDIR to the output directory you specified when you
  46. # # generated the IP script, relative to the directory from which you launch
  47. # # the simulator. In this case, you must also copy the generated files
  48. # # "cds.lib" and "hdl.var" - plus the directory "cds_libs" if generated -
  49. # # into the location from which you launch the simulator, or incorporate
  50. # # into any existing library setup.
  51. # #
  52. # # Run Quartus-generated IP simulation script once to compile Quartus EDA
  53. # # simulation libraries and Quartus-generated IP simulation files, and copy
  54. # # any ROM/RAM initialization files to the simulation directory.
  55. # # - If necessary, specify any compilation options:
  56. # # USER_DEFINED_COMPILE_OPTIONS
  57. # # USER_DEFINED_VHDL_COMPILE_OPTIONS applied to vhdl compiler
  58. # # USER_DEFINED_VERILOG_COMPILE_OPTIONS applied to verilog compiler
  59. # #
  60. # source <script generation output directory>/xcelium/xcelium_setup.sh \
  61. # SKIP_ELAB=1 \
  62. # SKIP_SIM=1 \
  63. # USER_DEFINED_COMPILE_OPTIONS=<compilation options for your design> \
  64. # USER_DEFINED_VHDL_COMPILE_OPTIONS=<VHDL compilation options for your design> \
  65. # USER_DEFINED_VERILOG_COMPILE_OPTIONS=<Verilog compilation options for your design> \
  66. # QSYS_SIMDIR=<script generation output directory>
  67. # #
  68. # # Compile all design files and testbench files, including the top level.
  69. # # (These are all the files required for simulation other than the files
  70. # # compiled by the IP script)
  71. # #
  72. # xmvlog <compilation options> <design and testbench files>
  73. # #
  74. # # TOP_LEVEL_NAME is used in this script to set the top-level simulation or
  75. # # testbench module/entity name.
  76. # #
  77. # # Run the IP script again to elaborate and simulate the top level:
  78. # # - Specify TOP_LEVEL_NAME and USER_DEFINED_ELAB_OPTIONS.
  79. # # - Override the default USER_DEFINED_SIM_OPTIONS. For example, to run
  80. # # until $finish(), set to an empty string: USER_DEFINED_SIM_OPTIONS="".
  81. # #
  82. # source <script generation output directory>/xcelium/xcelium_setup.sh \
  83. # SKIP_FILE_COPY=1 \
  84. # SKIP_DEV_COM=1 \
  85. # SKIP_COM=1 \
  86. # TOP_LEVEL_NAME=<simulation top> \
  87. # USER_DEFINED_ELAB_OPTIONS=<elaboration options for your design> \
  88. # USER_DEFINED_SIM_OPTIONS=<simulation options for your design>
  89. # #
  90. # # TOP-LEVEL TEMPLATE - END
  91. # ----------------------------------------
  92. #
  93. # IP SIMULATION SCRIPT
  94. # ----------------------------------------
  95. # If mainpll is one of several IP cores in your
  96. # Quartus project, you can generate a simulation script
  97. # suitable for inclusion in your top-level simulation
  98. # script by running the following command line:
  99. #
  100. # ip-setup-simulation --quartus-project=<quartus project>
  101. #
  102. # ip-setup-simulation will discover the Altera IP
  103. # within the Quartus project, and generate a unified
  104. # script which supports all the Altera IP within the design.
  105. # ----------------------------------------
  106. # ACDS 23.1 991 linux 2024.05.19.19:48:27
  107. # ----------------------------------------
  108. # initialize variables
  109. TOP_LEVEL_NAME="mainpll"
  110. QSYS_SIMDIR="./../"
  111. QUARTUS_INSTALL_DIR="/home/bart/intelFPGA_lite/23.1std/quartus/"
  112. SKIP_FILE_COPY=0
  113. SKIP_DEV_COM=0
  114. SKIP_COM=0
  115. SKIP_ELAB=0
  116. SKIP_SIM=0
  117. USER_DEFINED_ELAB_OPTIONS=""
  118. USER_DEFINED_SIM_OPTIONS="-input \"@run 100; exit\""
  119. # ----------------------------------------
  120. # overwrite variables - DO NOT MODIFY!
  121. # This block evaluates each command line argument, typically used for
  122. # overwriting variables. An example usage:
  123. # sh <simulator>_setup.sh SKIP_SIM=1
  124. for expression in "$@"; do
  125. eval $expression
  126. if [ $? -ne 0 ]; then
  127. echo "Error: This command line argument, \"$expression\", is/has an invalid expression." >&2
  128. exit $?
  129. fi
  130. done
  131. # ----------------------------------------
  132. # initialize simulation properties - DO NOT MODIFY!
  133. ELAB_OPTIONS=""
  134. SIM_OPTIONS=""
  135. if [[ `xmsim -version` != *"xmsim(64)"* ]]; then
  136. :
  137. else
  138. :
  139. fi
  140. # ----------------------------------------
  141. # create compilation libraries
  142. mkdir -p ./libraries/work/
  143. mkdir -p ./libraries/altera_ver/
  144. mkdir -p ./libraries/lpm_ver/
  145. mkdir -p ./libraries/sgate_ver/
  146. mkdir -p ./libraries/altera_mf_ver/
  147. mkdir -p ./libraries/altera_lnsim_ver/
  148. mkdir -p ./libraries/cyclonev_ver/
  149. mkdir -p ./libraries/cyclonev_hssi_ver/
  150. mkdir -p ./libraries/cyclonev_pcie_hip_ver/
  151. # ----------------------------------------
  152. # copy RAM/ROM files to simulation directory
  153. # ----------------------------------------
  154. # compile device library files
  155. if [ $SKIP_DEV_COM -eq 0 ]; then
  156. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.v" -work altera_ver
  157. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220model.v" -work lpm_ver
  158. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.v" -work sgate_ver
  159. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.v" -work altera_mf_ver
  160. xmvlog -sv $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv" -work altera_lnsim_ver
  161. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_atoms_ncrypt.v" -work cyclonev_ver
  162. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_hmi_atoms_ncrypt.v" -work cyclonev_ver
  163. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.v" -work cyclonev_ver
  164. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_hssi_atoms_ncrypt.v" -work cyclonev_hssi_ver
  165. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.v" -work cyclonev_hssi_ver
  166. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_pcie_hip_atoms_ncrypt.v" -work cyclonev_pcie_hip_ver
  167. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_pcie_hip_atoms.v" -work cyclonev_pcie_hip_ver
  168. fi
  169. # ----------------------------------------
  170. # compile design files in correct order
  171. if [ $SKIP_COM -eq 0 ]; then
  172. xmvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QSYS_SIMDIR/mainpll.vo"
  173. fi
  174. # ----------------------------------------
  175. # elaborate top level design
  176. if [ $SKIP_ELAB -eq 0 ]; then
  177. xmelab -update -access +w+r+c -namemap_mixgen +DISABLEGENCHK -relax $ELAB_OPTIONS $USER_DEFINED_ELAB_OPTIONS $TOP_LEVEL_NAME
  178. fi
  179. # ----------------------------------------
  180. # simulate
  181. if [ $SKIP_SIM -eq 0 ]; then
  182. eval xmsim -licqueue $SIM_OPTIONS $USER_DEFINED_SIM_OPTIONS $TOP_LEVEL_NAME
  183. fi