MeasDataFifo.sh 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #!/bin/bash -f
  2. #*********************************************************************************************************
  3. # Vivado (TM) v2020.2 (64-bit)
  4. #
  5. # Filename : MeasDataFifo.sh
  6. # Simulator : Aldec Riviera-PRO 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. # Script info
  36. echo -e "MeasDataFifo.sh - Script generated by export_simulation (Vivado v2020.2 (64-bit)-id)\n"
  37. # Main steps
  38. run()
  39. {
  40. check_args $# $1
  41. setup $1 $2
  42. compile
  43. simulate
  44. }
  45. # RUN_STEP: <compile>
  46. compile()
  47. {
  48. # Compile design files
  49. source compile.do 2>&1 | tee -a compile.log
  50. }
  51. # RUN_STEP: <simulate>
  52. simulate()
  53. {
  54. runvsimsa -l simulate.log -do "do {simulate.do}"
  55. }
  56. # STEP: setup
  57. setup()
  58. {
  59. case $1 in
  60. "-lib_map_path" )
  61. if [[ ($2 == "") ]]; then
  62. echo -e "ERROR: Simulation library directory path not specified (type \"./MeasDataFifo.sh -help\" for more information)\n"
  63. exit 1
  64. fi
  65. map_setup_file $2
  66. ;;
  67. "-reset_run" )
  68. reset_run
  69. echo -e "INFO: Simulation run files deleted.\n"
  70. exit 0
  71. ;;
  72. "-noclean_files" )
  73. # do not remove previous data
  74. ;;
  75. * )
  76. map_setup_file $2
  77. esac
  78. # Add any setup/initialization commands here:-
  79. # <user specific commands>
  80. }
  81. # Map library.cfg file
  82. map_setup_file()
  83. {
  84. file="library.cfg"
  85. if [[ ($1 != "") ]]; then
  86. lib_map_path="$1"
  87. else
  88. lib_map_path="C:/Users/Stepan/Desktop/4portCompact/S5443Current/S5443_M/S5443.cache/compile_simlib/riviera"
  89. fi
  90. if [[ ($lib_map_path != "") ]]; then
  91. src_file="$lib_map_path/$file"
  92. if [[ -e $src_file ]]; then
  93. vmap -link $lib_map_path
  94. fi
  95. fi
  96. }
  97. # Delete generated data from the previous run
  98. reset_run()
  99. {
  100. files_to_remove=(compile.log elaboration.log simulate.log dataset.asdb work riviera)
  101. for (( i=0; i<${#files_to_remove[*]}; i++ )); do
  102. file="${files_to_remove[i]}"
  103. if [[ -e $file ]]; then
  104. rm -rf $file
  105. fi
  106. done
  107. }
  108. # Check command line arguments
  109. check_args()
  110. {
  111. if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
  112. echo -e "ERROR: Unknown option specified '$2' (type \"./MeasDataFifo.sh -help\" for more information)\n"
  113. exit 1
  114. fi
  115. if [[ ($2 == "-help" || $2 == "-h") ]]; then
  116. usage
  117. fi
  118. }
  119. # Script usage
  120. usage()
  121. {
  122. msg="Usage: MeasDataFifo.sh [-help]\n\
  123. Usage: MeasDataFifo.sh [-lib_map_path]\n\
  124. Usage: MeasDataFifo.sh [-reset_run]\n\
  125. Usage: MeasDataFifo.sh [-noclean_files]\n\n\
  126. [-help] -- Print help information for this script\n\n\
  127. [-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
  128. using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
  129. [-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
  130. from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
  131. -noclean_files switch.\n\n\
  132. [-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
  133. echo -e $msg
  134. exit 1
  135. }
  136. # Launch script
  137. run $1 $2