MeasDataFifo.sh 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/bin/bash -f
  2. #*********************************************************************************************************
  3. # Vivado (TM) v2020.2 (64-bit)
  4. #
  5. # Filename : MeasDataFifo.sh
  6. # Simulator : Cadence Incisive Enterprise Simulator
  7. # Description : Simulation script for compiling, elaborating and verifying the project source files.
  8. # The script will automatically create the design libraries sub-directories in the run
  9. # directory, add the library logical mappings in the simulator setup file, create default
  10. # 'do/prj' file, execute compilation, elaboration and simulation steps.
  11. #
  12. # Generated by Vivado on Wed May 03 12:02:59 +0700 2023
  13. # SW Build 3064766 on Wed Nov 18 09:12:45 MST 2020
  14. #
  15. # Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.
  16. #
  17. # usage: MeasDataFifo.sh [-help]
  18. # usage: MeasDataFifo.sh [-lib_map_path]
  19. # usage: MeasDataFifo.sh [-noclean_files]
  20. # usage: MeasDataFifo.sh [-reset_run]
  21. #
  22. # Prerequisite:- To compile and run simulation, you must compile the Xilinx simulation libraries using the
  23. # 'compile_simlib' TCL command. For more information about this command, run 'compile_simlib -help' in the
  24. # Vivado Tcl Shell. Once the libraries have been compiled successfully, specify the -lib_map_path switch
  25. # that points to these libraries and rerun export_simulation. For more information about this switch please
  26. # type 'export_simulation -help' in the Tcl shell.
  27. #
  28. # You can also point to the simulation libraries by either replacing the <SPECIFY_COMPILED_LIB_PATH> in this
  29. # script with the compiled library directory path or specify this path with the '-lib_map_path' switch when
  30. # executing this script. Please type 'MeasDataFifo.sh -help' for more information.
  31. #
  32. # Additional references - 'Xilinx Vivado Design Suite User Guide:Logic simulation (UG900)'
  33. #
  34. #*********************************************************************************************************
  35. # Directory path for design sources and include directories (if any) wrt this path
  36. ref_dir="."
  37. # Override directory with 'export_sim_ref_dir' env path value if set in the shell
  38. if [[ (! -z "$export_sim_ref_dir") && ($export_sim_ref_dir != "") ]]; then
  39. ref_dir="$export_sim_ref_dir"
  40. fi
  41. # Set the compiled library directory
  42. ref_lib_dir="."
  43. # Command line options
  44. irun_opts="-64bit -v93 -relax -access +rwc -namemap_mixgen"
  45. # Design libraries
  46. design_libs=(xpm xil_defaultlib)
  47. # Simulation root library directory
  48. sim_lib_dir="ies_lib"
  49. # Script info
  50. echo -e "MeasDataFifo.sh - Script generated by export_simulation (Vivado v2020.2 (64-bit)-id)\n"
  51. # Main steps
  52. run()
  53. {
  54. check_args $# $1
  55. setup $1 $2
  56. execute
  57. }
  58. # RUN_STEP: <execute>
  59. execute()
  60. {
  61. irun $irun_opts \
  62. -reflib "$ref_lib_dir/unisim:unisim" \
  63. -reflib "$ref_lib_dir/unisims_ver:unisims_ver" \
  64. -reflib "$ref_lib_dir/secureip:secureip" \
  65. -reflib "$ref_lib_dir/unimacro:unimacro" \
  66. -reflib "$ref_lib_dir/unimacro_ver:unimacro_ver" \
  67. -top xil_defaultlib.MeasDataFifo \
  68. -f run.f \
  69. -top glbl \
  70. glbl.v
  71. }
  72. # STEP: setup
  73. setup()
  74. {
  75. case $1 in
  76. "-lib_map_path" )
  77. if [[ ($2 == "") ]]; then
  78. echo -e "ERROR: Simulation library directory path not specified (type \"./MeasDataFifo.sh -help\" for more information)\n"
  79. exit 1
  80. else
  81. ref_lib_dir=$2
  82. fi
  83. ;;
  84. "-reset_run" )
  85. reset_run
  86. echo -e "INFO: Simulation run files deleted.\n"
  87. exit 0
  88. ;;
  89. "-noclean_files" )
  90. # do not remove previous data
  91. ;;
  92. * )
  93. esac
  94. create_lib_dir
  95. # Add any setup/initialization commands here:-
  96. # <user specific commands>
  97. }
  98. # Create design library directory paths
  99. create_lib_dir()
  100. {
  101. if [[ -e $sim_lib_dir ]]; then
  102. rm -rf $sim_lib_dir
  103. fi
  104. for (( i=0; i<${#design_libs[*]}; i++ )); do
  105. lib="${design_libs[i]}"
  106. lib_dir="$sim_lib_dir/$lib"
  107. if [[ ! -e $lib_dir ]]; then
  108. mkdir -p $lib_dir
  109. fi
  110. done
  111. }
  112. # Delete generated data from the previous run
  113. reset_run()
  114. {
  115. files_to_remove=(ncsim.key irun.key irun.log waves.shm irun.history .simvision INCA_libs)
  116. for (( i=0; i<${#files_to_remove[*]}; i++ )); do
  117. file="${files_to_remove[i]}"
  118. if [[ -e $file ]]; then
  119. rm -rf $file
  120. fi
  121. done
  122. create_lib_dir
  123. }
  124. # Check command line arguments
  125. check_args()
  126. {
  127. if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
  128. echo -e "ERROR: Unknown option specified '$2' (type \"./MeasDataFifo.sh -help\" for more information)\n"
  129. exit 1
  130. fi
  131. if [[ ($2 == "-help" || $2 == "-h") ]]; then
  132. usage
  133. fi
  134. }
  135. # Script usage
  136. usage()
  137. {
  138. msg="Usage: MeasDataFifo.sh [-help]\n\
  139. Usage: MeasDataFifo.sh [-lib_map_path]\n\
  140. Usage: MeasDataFifo.sh [-reset_run]\n\
  141. Usage: MeasDataFifo.sh [-noclean_files]\n\n\
  142. [-help] -- Print help information for this script\n\n\
  143. [-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
  144. using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
  145. [-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
  146. from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
  147. -noclean_files switch.\n\n\
  148. [-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
  149. echo -e $msg
  150. exit 1
  151. }
  152. # Launch script
  153. run $1 $2