Studentenversion des ESY6/A Praktikums "signal_processing".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rivierapro_setup.tcl 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. # (C) 2001-2022 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 21.1 850 linux 2022.08.29.18:38:18
  14. # ----------------------------------------
  15. # Auto-generated simulation script rivierapro_setup.tcl
  16. # ----------------------------------------
  17. # This script provides commands to simulate the following IP detected in
  18. # your Quartus project:
  19. # pll_main
  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. # To write a top-level script that compiles Altera simulation libraries and
  26. # the Quartus-generated IP in your project, along with your design and
  27. # testbench files, copy the text from the TOP-LEVEL TEMPLATE section below
  28. # into a new file, e.g. named "aldec.do", and modify the text as directed.
  29. #
  30. # ----------------------------------------
  31. # # TOP-LEVEL TEMPLATE - BEGIN
  32. # #
  33. # # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to
  34. # # construct paths to the files required to simulate the IP in your Quartus
  35. # # project. By default, the IP script assumes that you are launching the
  36. # # simulator from the IP script location. If launching from another
  37. # # location, set QSYS_SIMDIR to the output directory you specified when you
  38. # # generated the IP script, relative to the directory from which you launch
  39. # # the simulator.
  40. # #
  41. # set QSYS_SIMDIR <script generation output directory>
  42. # #
  43. # # Source the generated IP simulation script.
  44. # source $QSYS_SIMDIR/aldec/rivierapro_setup.tcl
  45. # #
  46. # # Set any compilation options you require (this is unusual).
  47. # set USER_DEFINED_COMPILE_OPTIONS <compilation options>
  48. # set USER_DEFINED_VHDL_COMPILE_OPTIONS <compilation options for VHDL>
  49. # set USER_DEFINED_VERILOG_COMPILE_OPTIONS <compilation options for Verilog>
  50. # #
  51. # # Call command to compile the Quartus EDA simulation library.
  52. # dev_com
  53. # #
  54. # # Call command to compile the Quartus-generated IP simulation files.
  55. # com
  56. # #
  57. # # Add commands to compile all design files and testbench files, including
  58. # # the top level. (These are all the files required for simulation other
  59. # # than the files compiled by the Quartus-generated IP simulation script)
  60. # #
  61. # vlog -sv2k5 <your compilation options> <design and testbench files>
  62. # #
  63. # # Set the top-level simulation or testbench module/entity name, which is
  64. # # used by the elab command to elaborate the top level.
  65. # #
  66. # set TOP_LEVEL_NAME <simulation top>
  67. # #
  68. # # Set any elaboration options you require.
  69. # set USER_DEFINED_ELAB_OPTIONS <elaboration options>
  70. # #
  71. # # Call command to elaborate your design and testbench.
  72. # elab
  73. # #
  74. # # Run the simulation.
  75. # run
  76. # #
  77. # # Report success to the shell.
  78. # exit -code 0
  79. # #
  80. # # TOP-LEVEL TEMPLATE - END
  81. # ----------------------------------------
  82. #
  83. # IP SIMULATION SCRIPT
  84. # ----------------------------------------
  85. # If pll_main is one of several IP cores in your
  86. # Quartus project, you can generate a simulation script
  87. # suitable for inclusion in your top-level simulation
  88. # script by running the following command line:
  89. #
  90. # ip-setup-simulation --quartus-project=<quartus project>
  91. #
  92. # ip-setup-simulation will discover the Altera IP
  93. # within the Quartus project, and generate a unified
  94. # script which supports all the Altera IP within the design.
  95. # ----------------------------------------
  96. # ----------------------------------------
  97. # Initialize variables
  98. if ![info exists SYSTEM_INSTANCE_NAME] {
  99. set SYSTEM_INSTANCE_NAME ""
  100. } elseif { ![ string match "" $SYSTEM_INSTANCE_NAME ] } {
  101. set SYSTEM_INSTANCE_NAME "/$SYSTEM_INSTANCE_NAME"
  102. }
  103. if ![info exists TOP_LEVEL_NAME] {
  104. set TOP_LEVEL_NAME "pll_main"
  105. }
  106. if ![info exists QSYS_SIMDIR] {
  107. set QSYS_SIMDIR "./../"
  108. }
  109. if ![info exists QUARTUS_INSTALL_DIR] {
  110. set QUARTUS_INSTALL_DIR "/datadisk/opt/quartus-lite-21.1.1/quartus/"
  111. }
  112. if ![info exists USER_DEFINED_COMPILE_OPTIONS] {
  113. set USER_DEFINED_COMPILE_OPTIONS ""
  114. }
  115. if ![info exists USER_DEFINED_VHDL_COMPILE_OPTIONS] {
  116. set USER_DEFINED_VHDL_COMPILE_OPTIONS ""
  117. }
  118. if ![info exists USER_DEFINED_VERILOG_COMPILE_OPTIONS] {
  119. set USER_DEFINED_VERILOG_COMPILE_OPTIONS ""
  120. }
  121. if ![info exists USER_DEFINED_ELAB_OPTIONS] {
  122. set USER_DEFINED_ELAB_OPTIONS ""
  123. }
  124. # ----------------------------------------
  125. # Initialize simulation properties - DO NOT MODIFY!
  126. set ELAB_OPTIONS ""
  127. set SIM_OPTIONS ""
  128. if ![ string match "*-64 vsim*" [ vsim -version ] ] {
  129. } else {
  130. }
  131. set Aldec "Riviera"
  132. if { [ string match "*Active-HDL*" [ vsim -version ] ] } {
  133. set Aldec "Active"
  134. }
  135. if { [ string match "Active" $Aldec ] } {
  136. scripterconf -tcl
  137. createdesign "$TOP_LEVEL_NAME" "."
  138. opendesign "$TOP_LEVEL_NAME"
  139. }
  140. # ----------------------------------------
  141. # Copy ROM/RAM files to simulation directory
  142. alias file_copy {
  143. echo "\[exec\] file_copy"
  144. }
  145. # ----------------------------------------
  146. # Create compilation libraries
  147. proc ensure_lib { lib } { if ![file isdirectory $lib] { vlib $lib } }
  148. ensure_lib ./libraries
  149. ensure_lib ./libraries/work
  150. vmap work ./libraries/work
  151. ensure_lib ./libraries/altera
  152. vmap altera ./libraries/altera
  153. ensure_lib ./libraries/lpm
  154. vmap lpm ./libraries/lpm
  155. ensure_lib ./libraries/sgate
  156. vmap sgate ./libraries/sgate
  157. ensure_lib ./libraries/altera_mf
  158. vmap altera_mf ./libraries/altera_mf
  159. ensure_lib ./libraries/altera_lnsim
  160. vmap altera_lnsim ./libraries/altera_lnsim
  161. ensure_lib ./libraries/cyclonev
  162. vmap cyclonev ./libraries/cyclonev
  163. ensure_lib ./libraries/cyclonev_hssi
  164. vmap cyclonev_hssi ./libraries/cyclonev_hssi
  165. # ----------------------------------------
  166. # Compile device library files
  167. alias dev_com {
  168. echo "\[exec\] dev_com"
  169. eval vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_syn_attributes.vhd" -work altera
  170. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_standard_functions.vhd" -work altera
  171. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/alt_dspbuilder_package.vhd" -work altera
  172. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_europa_support_lib.vhd" -work altera
  173. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives_components.vhd" -work altera
  174. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.vhd" -work altera
  175. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220pack.vhd" -work lpm
  176. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220model.vhd" -work lpm
  177. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate_pack.vhd" -work sgate
  178. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.vhd" -work sgate
  179. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf_components.vhd" -work altera_mf
  180. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.vhd" -work altera_mf
  181. vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv" -work altera_lnsim
  182. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim_components.vhd" -work altera_lnsim
  183. vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/aldec/cyclonev_atoms_ncrypt.v" -work cyclonev
  184. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.vhd" -work cyclonev
  185. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_components.vhd" -work cyclonev
  186. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_components.vhd" -work cyclonev_hssi
  187. vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/aldec/cyclonev_hssi_atoms_ncrypt.v" -work cyclonev_hssi
  188. vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.vhd" -work cyclonev_hssi
  189. }
  190. # ----------------------------------------
  191. # Compile the design files in correct order
  192. alias com {
  193. echo "\[exec\] com"
  194. eval vcom $USER_DEFINED_VHDL_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QSYS_SIMDIR/pll_main.vho"
  195. }
  196. # ----------------------------------------
  197. # Elaborate top level design
  198. alias elab {
  199. echo "\[exec\] elab"
  200. eval vsim +access +r -t ps $ELAB_OPTIONS -L work -L altera -L lpm -L sgate -L altera_mf -L altera_lnsim -L cyclonev -L cyclonev_hssi $TOP_LEVEL_NAME
  201. }
  202. # ----------------------------------------
  203. # Elaborate the top level design with -dbg -O2 option
  204. alias elab_debug {
  205. echo "\[exec\] elab_debug"
  206. eval vsim -dbg -O2 +access +r -t ps $ELAB_OPTIONS -L work -L altera -L lpm -L sgate -L altera_mf -L altera_lnsim -L cyclonev -L cyclonev_hssi $TOP_LEVEL_NAME
  207. }
  208. # ----------------------------------------
  209. # Compile all the design files and elaborate the top level design
  210. alias ld "
  211. dev_com
  212. com
  213. elab
  214. "
  215. # ----------------------------------------
  216. # Compile all the design files and elaborate the top level design with -dbg -O2
  217. alias ld_debug "
  218. dev_com
  219. com
  220. elab_debug
  221. "
  222. # ----------------------------------------
  223. # Print out user commmand line aliases
  224. alias h {
  225. echo "List Of Command Line Aliases"
  226. echo
  227. echo "file_copy -- Copy ROM/RAM files to simulation directory"
  228. echo
  229. echo "dev_com -- Compile device library files"
  230. echo
  231. echo "com -- Compile the design files in correct order"
  232. echo
  233. echo "elab -- Elaborate top level design"
  234. echo
  235. echo "elab_debug -- Elaborate the top level design with -dbg -O2 option"
  236. echo
  237. echo "ld -- Compile all the design files and elaborate the top level design"
  238. echo
  239. echo "ld_debug -- Compile all the design files and elaborate the top level design with -dbg -O2"
  240. echo
  241. echo
  242. echo
  243. echo "List Of Variables"
  244. echo
  245. echo "TOP_LEVEL_NAME -- Top level module name."
  246. echo " For most designs, this should be overridden"
  247. echo " to enable the elab/elab_debug aliases."
  248. echo
  249. echo "SYSTEM_INSTANCE_NAME -- Instantiated system module name inside top level module."
  250. echo
  251. echo "QSYS_SIMDIR -- Platform Designer base simulation directory."
  252. echo
  253. echo "QUARTUS_INSTALL_DIR -- Quartus installation directory."
  254. echo
  255. echo "USER_DEFINED_COMPILE_OPTIONS -- User-defined compile options, added to com/dev_com aliases."
  256. echo
  257. echo "USER_DEFINED_ELAB_OPTIONS -- User-defined elaboration options, added to elab/elab_debug aliases."
  258. echo
  259. echo "USER_DEFINED_VHDL_COMPILE_OPTIONS -- User-defined vhdl compile options, added to com/dev_com aliases."
  260. echo
  261. echo "USER_DEFINED_VERILOG_COMPILE_OPTIONS -- User-defined verilog compile options, added to com/dev_com aliases."
  262. }
  263. file_copy
  264. h