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/] [vcs/] [axi_uartlite_module.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.sh
6
# Simulator   : Synopsys Verilog Compiler 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 Thu Jul 23 09:48:27 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.sh [-help]
18
# usage: axi_uartlite_module.sh [-lib_map_path]
19
# usage: axi_uartlite_module.sh [-noclean_files]
20
# usage: axi_uartlite_module.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.sh -help' for more information.
31
#
32
# Additional references - 'Xilinx Vivado Design Suite User Guide:Logic simulation (UG900)'
33
#
34
#*********************************************************************************************************
35
 
36
# Directory path for design sources and include directories (if any) wrt this path
37
ref_dir="."
38
 
39
# Override directory with 'export_sim_ref_dir' env path value if set in the shell
40
if [[ (! -z "$export_sim_ref_dir") && ($export_sim_ref_dir != "") ]]; then
41
  ref_dir="$export_sim_ref_dir"
42
fi
43
 
44
# Command line options
45
vlogan_opts="-full64"
46
vhdlan_opts="-full64"
47
vcs_elab_opts="-full64 -debug_pp -t ps -licqueue -l elaborate.log"
48
vcs_sim_opts="-ucli -licqueue -l simulate.log"
49
 
50
# Design libraries
51
design_libs=(xil_defaultlib xpm axi_lite_ipif_v3_0_4 lib_pkg_v1_0_2 lib_srl_fifo_v1_0_2 lib_cdc_v1_0_2 axi_uartlite_v2_0_19)
52
 
53
# Simulation root library directory
54
sim_lib_dir="vcs_lib"
55
 
56
# Script info
57
echo -e "axi_uartlite_module.sh - Script generated by export_simulation (Vivado v2017.4 (64-bit)-id)\n"
58
 
59
# Main steps
60
run()
61
{
62
  check_args $# $1
63
  setup $1 $2
64
  compile
65
  elaborate
66
  simulate
67
}
68
 
69
# RUN_STEP: <compile>
70
compile()
71
{
72
  # Compile design files
73
  vlogan -work xil_defaultlib $vlogan_opts -sverilog +incdir+"/opt/cad/xilinx/Vivado2017/Vivado/2017.4/data/xilinx_vip/include" \
74
    "/opt/cad/xilinx/Vivado2017/Vivado/2017.4/data/ip/xpm/xpm_cdc/hdl/xpm_cdc.sv" \
75
  2>&1 | tee -a vlogan.log
76
 
77
  vhdlan -work xpm $vhdlan_opts \
78
    "/opt/cad/xilinx/Vivado2017/Vivado/2017.4/data/ip/xpm/xpm_VCOMP.vhd" \
79
  2>&1 | tee -a vhdlan.log
80
 
81
  vhdlan -work axi_lite_ipif_v3_0_4 $vhdlan_opts \
82
    "$ref_dir/../../../ipstatic/hdl/axi_lite_ipif_v3_0_vh_rfs.vhd" \
83
  2>&1 | tee -a vhdlan.log
84
 
85
  vhdlan -work lib_pkg_v1_0_2 $vhdlan_opts \
86
    "$ref_dir/../../../ipstatic/hdl/lib_pkg_v1_0_rfs.vhd" \
87
  2>&1 | tee -a vhdlan.log
88
 
89
  vhdlan -work lib_srl_fifo_v1_0_2 $vhdlan_opts \
90
    "$ref_dir/../../../ipstatic/hdl/lib_srl_fifo_v1_0_rfs.vhd" \
91
  2>&1 | tee -a vhdlan.log
92
 
93
  vhdlan -work lib_cdc_v1_0_2 $vhdlan_opts \
94
    "$ref_dir/../../../ipstatic/hdl/lib_cdc_v1_0_rfs.vhd" \
95
  2>&1 | tee -a vhdlan.log
96
 
97
  vhdlan -work axi_uartlite_v2_0_19 $vhdlan_opts \
98
    "$ref_dir/../../../ipstatic/hdl/axi_uartlite_v2_0_vh_rfs.vhd" \
99
  2>&1 | tee -a vhdlan.log
100
 
101
  vhdlan -work xil_defaultlib $vhdlan_opts \
102
    "$ref_dir/../../../../aes128_ecb.srcs/sources_1/ip/axi_uartlite_module/sim/axi_uartlite_module.vhd" \
103
  2>&1 | tee -a vhdlan.log
104
 
105
 
106
  vlogan -work xil_defaultlib $vlogan_opts +v2k \
107
    glbl.v \
108
  2>&1 | tee -a vlogan.log
109
 
110
}
111
 
112
# RUN_STEP: <elaborate>
113
elaborate()
114
{
115
  vcs $vcs_elab_opts xil_defaultlib.axi_uartlite_module xil_defaultlib.glbl -o axi_uartlite_module_simv
116
}
117
 
118
# RUN_STEP: <simulate>
119
simulate()
120
{
121
  ./axi_uartlite_module_simv $vcs_sim_opts -do simulate.do
122
}
123
 
124
# STEP: setup
125
setup()
126
{
127
  case $1 in
128
    "-lib_map_path" )
129
      if [[ ($2 == "") ]]; then
130
        echo -e "ERROR: Simulation library directory path not specified (type \"./axi_uartlite_module.sh -help\" for more information)\n"
131
        exit 1
132
      fi
133
      create_lib_mappings $2
134
    ;;
135
    "-reset_run" )
136
      reset_run
137
      echo -e "INFO: Simulation run files deleted.\n"
138
      exit 0
139
    ;;
140
    "-noclean_files" )
141
      # do not remove previous data
142
    ;;
143
    * )
144
      create_lib_mappings $2
145
  esac
146
 
147
  create_lib_dir
148
 
149
  # Add any setup/initialization commands here:-
150
 
151
  # <user specific commands>
152
 
153
}
154
 
155
# Define design library mappings
156
create_lib_mappings()
157
{
158
  file="synopsys_sim.setup"
159
  if [[ -e $file ]]; then
160
    if [[ ($1 == "") ]]; then
161
      return
162
    else
163
      rm -rf $file
164
    fi
165
  fi
166
 
167
  touch $file
168
 
169
  lib_map_path="<SPECIFY_COMPILED_LIB_PATH>"
170
  if [[ ($1 != "" && -e $1) ]]; then
171
    lib_map_path="$1"
172
  else
173
    echo -e "ERROR: Compiled simulation library directory path not specified or does not exist (type "./top.sh -help" for more information)\n"
174
  fi
175
 
176
  for (( i=0; i<${#design_libs[*]}; i++ )); do
177
    lib="${design_libs[i]}"
178
    mapping="$lib:$sim_lib_dir/$lib"
179
    echo $mapping >> $file
180
  done
181
 
182
  if [[ ($lib_map_path != "") ]]; then
183
    incl_ref="OTHERS=$lib_map_path/synopsys_sim.setup"
184
    echo $incl_ref >> $file
185
  fi
186
}
187
 
188
# Create design library directory paths
189
create_lib_dir()
190
{
191
  if [[ -e $sim_lib_dir ]]; then
192
    rm -rf $sim_lib_dir
193
  fi
194
 
195
  for (( i=0; i<${#design_libs[*]}; i++ )); do
196
    lib="${design_libs[i]}"
197
    lib_dir="$sim_lib_dir/$lib"
198
    if [[ ! -e $lib_dir ]]; then
199
      mkdir -p $lib_dir
200
    fi
201
  done
202
}
203
 
204
# Delete generated data from the previous run
205
reset_run()
206
{
207
  files_to_remove=(ucli.key axi_uartlite_module_simv vlogan.log vhdlan.log compile.log elaborate.log simulate.log .vlogansetup.env .vlogansetup.args .vcs_lib_lock scirocco_command.log 64 AN.DB csrc axi_uartlite_module_simv.daidir)
208
  for (( i=0; i<${#files_to_remove[*]}; i++ )); do
209
    file="${files_to_remove[i]}"
210
    if [[ -e $file ]]; then
211
      rm -rf $file
212
    fi
213
  done
214
 
215
  create_lib_dir
216
}
217
 
218
# Check command line arguments
219
check_args()
220
{
221
  if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
222
    echo -e "ERROR: Unknown option specified '$2' (type \"./axi_uartlite_module.sh -help\" for more information)\n"
223
    exit 1
224
  fi
225
 
226
  if [[ ($2 == "-help" || $2 == "-h") ]]; then
227
    usage
228
  fi
229
}
230
 
231
# Script usage
232
usage()
233
{
234
  msg="Usage: axi_uartlite_module.sh [-help]\n\
235
Usage: axi_uartlite_module.sh [-lib_map_path]\n\
236
Usage: axi_uartlite_module.sh [-reset_run]\n\
237
Usage: axi_uartlite_module.sh [-noclean_files]\n\n\
238
[-help] -- Print help information for this script\n\n\
239
[-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
240
using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
241
[-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
242
from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
243
-noclean_files switch.\n\n\
244
[-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
245
  echo -e $msg
246
  exit 1
247
}
248
 
249
# Launch script
250
run $1 $2

powered by: WebSVN 2.1.0

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