1 |
2 |
vv_gulyaev |
#!/bin/bash -f
|
2 |
|
|
#*********************************************************************************************************
|
3 |
|
|
# Vivado (TM) v2017.4 (64-bit)
|
4 |
|
|
#
|
5 |
|
|
# Filename : axi_uartlite_module.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 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 |
|
|
# Set the compiled library directory
|
45 |
|
|
ref_lib_dir="."
|
46 |
|
|
|
47 |
|
|
# Command line options
|
48 |
|
|
irun_opts="-64bit -v93 -relax -access +rwc -namemap_mixgen"
|
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="ies_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 |
|
|
execute
|
65 |
|
|
}
|
66 |
|
|
|
67 |
|
|
# RUN_STEP: <execute>
|
68 |
|
|
execute()
|
69 |
|
|
{
|
70 |
|
|
irun $irun_opts \
|
71 |
|
|
-reflib "$ref_lib_dir/unisim:unisim" \
|
72 |
|
|
-reflib "$ref_lib_dir/unisims_ver:unisims_ver" \
|
73 |
|
|
-reflib "$ref_lib_dir/secureip:secureip" \
|
74 |
|
|
-reflib "$ref_lib_dir/unimacro:unimacro" \
|
75 |
|
|
-reflib "$ref_lib_dir/unimacro_ver:unimacro_ver" \
|
76 |
|
|
-top xil_defaultlib.axi_uartlite_module \
|
77 |
|
|
-f run.f \
|
78 |
|
|
-top glbl \
|
79 |
|
|
glbl.v \
|
80 |
|
|
+incdir+"/opt/cad/xilinx/Vivado2017/Vivado/2017.4/data/xilinx_vip/include"
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
# STEP: setup
|
84 |
|
|
setup()
|
85 |
|
|
{
|
86 |
|
|
case $1 in
|
87 |
|
|
"-lib_map_path" )
|
88 |
|
|
if [[ ($2 == "") ]]; then
|
89 |
|
|
echo -e "ERROR: Simulation library directory path not specified (type \"./axi_uartlite_module.sh -help\" for more information)\n"
|
90 |
|
|
exit 1
|
91 |
|
|
else
|
92 |
|
|
ref_lib_dir=$2
|
93 |
|
|
fi
|
94 |
|
|
;;
|
95 |
|
|
"-reset_run" )
|
96 |
|
|
reset_run
|
97 |
|
|
echo -e "INFO: Simulation run files deleted.\n"
|
98 |
|
|
exit 0
|
99 |
|
|
;;
|
100 |
|
|
"-noclean_files" )
|
101 |
|
|
# do not remove previous data
|
102 |
|
|
;;
|
103 |
|
|
* )
|
104 |
|
|
esac
|
105 |
|
|
|
106 |
|
|
create_lib_dir
|
107 |
|
|
|
108 |
|
|
# Add any setup/initialization commands here:-
|
109 |
|
|
|
110 |
|
|
# <user specific commands>
|
111 |
|
|
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
# Create design library directory paths
|
115 |
|
|
create_lib_dir()
|
116 |
|
|
{
|
117 |
|
|
if [[ -e $sim_lib_dir ]]; then
|
118 |
|
|
rm -rf $sim_lib_dir
|
119 |
|
|
fi
|
120 |
|
|
|
121 |
|
|
for (( i=0; i<${#design_libs[*]}; i++ )); do
|
122 |
|
|
lib="${design_libs[i]}"
|
123 |
|
|
lib_dir="$sim_lib_dir/$lib"
|
124 |
|
|
if [[ ! -e $lib_dir ]]; then
|
125 |
|
|
mkdir -p $lib_dir
|
126 |
|
|
fi
|
127 |
|
|
done
|
128 |
|
|
}
|
129 |
|
|
|
130 |
|
|
# Delete generated data from the previous run
|
131 |
|
|
reset_run()
|
132 |
|
|
{
|
133 |
|
|
files_to_remove=(ncsim.key irun.key irun.log waves.shm irun.history .simvision INCA_libs)
|
134 |
|
|
for (( i=0; i<${#files_to_remove[*]}; i++ )); do
|
135 |
|
|
file="${files_to_remove[i]}"
|
136 |
|
|
if [[ -e $file ]]; then
|
137 |
|
|
rm -rf $file
|
138 |
|
|
fi
|
139 |
|
|
done
|
140 |
|
|
|
141 |
|
|
create_lib_dir
|
142 |
|
|
}
|
143 |
|
|
|
144 |
|
|
# Check command line arguments
|
145 |
|
|
check_args()
|
146 |
|
|
{
|
147 |
|
|
if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
|
148 |
|
|
echo -e "ERROR: Unknown option specified '$2' (type \"./axi_uartlite_module.sh -help\" for more information)\n"
|
149 |
|
|
exit 1
|
150 |
|
|
fi
|
151 |
|
|
|
152 |
|
|
if [[ ($2 == "-help" || $2 == "-h") ]]; then
|
153 |
|
|
usage
|
154 |
|
|
fi
|
155 |
|
|
}
|
156 |
|
|
|
157 |
|
|
# Script usage
|
158 |
|
|
usage()
|
159 |
|
|
{
|
160 |
|
|
msg="Usage: axi_uartlite_module.sh [-help]\n\
|
161 |
|
|
Usage: axi_uartlite_module.sh [-lib_map_path]\n\
|
162 |
|
|
Usage: axi_uartlite_module.sh [-reset_run]\n\
|
163 |
|
|
Usage: axi_uartlite_module.sh [-noclean_files]\n\n\
|
164 |
|
|
[-help] -- Print help information for this script\n\n\
|
165 |
|
|
[-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
|
166 |
|
|
using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
|
167 |
|
|
[-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
|
168 |
|
|
from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
|
169 |
|
|
-noclean_files switch.\n\n\
|
170 |
|
|
[-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
|
171 |
|
|
echo -e $msg
|
172 |
|
|
exit 1
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
# Launch script
|
176 |
|
|
run $1 $2
|