OpenCores
URL https://opencores.org/ocsvn/aes-128-ecb-encoder/aes-128-ecb-encoder/trunk

Subversion Repositories aes-128-ecb-encoder

[/] [aes-128-ecb-encoder/] [trunk/] [fpga/] [aes128_ecb_2017/] [aes128_ecb.ip_user_files/] [sim_scripts/] [axi_uartlite_module_sim/] [questa/] [axi_uartlite_module_sim.sh] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 vv_gulyaev
#!/bin/bash -f
2
#*********************************************************************************************************
3
# Vivado (TM) v2017.4 (64-bit)
4
#
5
# Filename    : axi_uartlite_module_sim.sh
6
# Simulator   : Mentor Graphics Questa Advanced 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 Tue Jul 28 11:34:43 MSK 2020
13
# SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
14
#
15
# Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.
16
#
17
# usage: axi_uartlite_module_sim.sh [-help]
18
# usage: axi_uartlite_module_sim.sh [-lib_map_path]
19
# usage: axi_uartlite_module_sim.sh [-noclean_files]
20
# usage: axi_uartlite_module_sim.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 'axi_uartlite_module_sim.sh -help' for more information.
31
#
32
# Additional references - 'Xilinx Vivado Design Suite User Guide:Logic simulation (UG900)'
33
#
34
#*********************************************************************************************************
35
 
36
 
37
# Script info
38
echo -e "axi_uartlite_module_sim.sh - Script generated by export_simulation (Vivado v2017.4 (64-bit)-id)\n"
39
 
40
# Main steps
41
run()
42
{
43
  check_args $# $1
44
  setup $1 $2
45
  compile
46
  elaborate
47
  simulate
48
}
49
 
50
# RUN_STEP: <compile>
51
compile()
52
{
53
  # Compile design files
54
  source compile.do 2>&1 | tee -a compile.log
55
 
56
}
57
 
58
# RUN_STEP: <elaborate>
59
elaborate()
60
{
61
  source elaborate.do 2>&1 | tee -a elaborate.log
62
}
63
 
64
# RUN_STEP: <simulate>
65
simulate()
66
{
67
  vsim -64 -c -do "do {simulate.do}" -l simulate.log
68
}
69
 
70
# STEP: setup
71
setup()
72
{
73
  case $1 in
74
    "-lib_map_path" )
75
      if [[ ($2 == "") ]]; then
76
        echo -e "ERROR: Simulation library directory path not specified (type \"./axi_uartlite_module_sim.sh -help\" for more information)\n"
77
        exit 1
78
      fi
79
     copy_setup_file $2
80
    ;;
81
    "-reset_run" )
82
      reset_run
83
      echo -e "INFO: Simulation run files deleted.\n"
84
      exit 0
85
    ;;
86
    "-noclean_files" )
87
      # do not remove previous data
88
    ;;
89
    * )
90
     copy_setup_file $2
91
  esac
92
 
93
  create_lib_dir
94
 
95
  # Add any setup/initialization commands here:-
96
 
97
  # <user specific commands>
98
 
99
}
100
 
101
# Copy modelsim.ini file
102
copy_setup_file()
103
{
104
  file="modelsim.ini"
105
  if [[ ($1 != "") ]]; then
106
    lib_map_path="$1"
107
  else
108
    lib_map_path="/home/v.gulyaev/Project/vozhak/trunk/rtl/aes128/fpga/aes128_ecb/aes128_ecb.cache/compile_simlib/questa"
109
  fi
110
  if [[ ($lib_map_path != "") ]]; then
111
    src_file="$lib_map_path/$file"
112
    cp $src_file .
113
  fi
114
}
115
 
116
# Create design library directory
117
create_lib_dir()
118
{
119
  lib_dir="questa_lib"
120
  if [[ -e $lib_dir ]]; then
121
    rm -rf $sim_lib_dir
122
  fi
123
 
124
  mkdir $lib_dir
125
 
126
}
127
 
128
# Delete generated data from the previous run
129
reset_run()
130
{
131
  files_to_remove=(compile.log elaborate.log simulate.log vsim.wlf questa_lib)
132
  for (( i=0; i<${#files_to_remove[*]}; i++ )); do
133
    file="${files_to_remove[i]}"
134
    if [[ -e $file ]]; then
135
      rm -rf $file
136
    fi
137
  done
138
 
139
  create_lib_dir
140
}
141
 
142
# Check command line arguments
143
check_args()
144
{
145
  if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
146
    echo -e "ERROR: Unknown option specified '$2' (type \"./axi_uartlite_module_sim.sh -help\" for more information)\n"
147
    exit 1
148
  fi
149
 
150
  if [[ ($2 == "-help" || $2 == "-h") ]]; then
151
    usage
152
  fi
153
}
154
 
155
# Script usage
156
usage()
157
{
158
  msg="Usage: axi_uartlite_module_sim.sh [-help]\n\
159
Usage: axi_uartlite_module_sim.sh [-lib_map_path]\n\
160
Usage: axi_uartlite_module_sim.sh [-reset_run]\n\
161
Usage: axi_uartlite_module_sim.sh [-noclean_files]\n\n\
162
[-help] -- Print help information for this script\n\n\
163
[-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
164
using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
165
[-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
166
from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
167
-noclean_files switch.\n\n\
168
[-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
169
  echo -e $msg
170
  exit 1
171
}
172
 
173
# Launch script
174
run $1 $2

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.