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/] [modelsim/] [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   : Mentor Graphics ModelSim 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
 
37
# Script info
38
echo -e "axi_uartlite_module.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
  simulate
47
}
48
 
49
# RUN_STEP: <compile>
50
compile()
51
{
52
  # Compile design files
53
  source compile.do 2>&1 | tee -a compile.log
54
 
55
}
56
 
57
# RUN_STEP: <simulate>
58
simulate()
59
{
60
  vsim -64 -c -do "do {simulate.do}" -l simulate.log
61
}
62
 
63
# STEP: setup
64
setup()
65
{
66
  case $1 in
67
    "-lib_map_path" )
68
      if [[ ($2 == "") ]]; then
69
        echo -e "ERROR: Simulation library directory path not specified (type \"./axi_uartlite_module.sh -help\" for more information)\n"
70
        exit 1
71
      fi
72
     copy_setup_file $2
73
    ;;
74
    "-reset_run" )
75
      reset_run
76
      echo -e "INFO: Simulation run files deleted.\n"
77
      exit 0
78
    ;;
79
    "-noclean_files" )
80
      # do not remove previous data
81
    ;;
82
    * )
83
     copy_setup_file $2
84
  esac
85
 
86
  create_lib_dir
87
 
88
  # Add any setup/initialization commands here:-
89
 
90
  # <user specific commands>
91
 
92
}
93
 
94
# Copy modelsim.ini file
95
copy_setup_file()
96
{
97
  file="modelsim.ini"
98
  lib_map_path="<SPECIFY_COMPILED_LIB_PATH>"
99
  if [[ ($1 != "" && -e $1) ]]; then
100
    lib_map_path="$1"
101
  else
102
    echo -e "ERROR: Compiled simulation library directory path not specified or does not exist (type "./top.sh -help" for more information)\n"
103
  fi
104
  if [[ ($lib_map_path != "") ]]; then
105
    src_file="$lib_map_path/$file"
106
    cp $src_file .
107
  fi
108
}
109
 
110
# Create design library directory
111
create_lib_dir()
112
{
113
  lib_dir="modelsim_lib"
114
  if [[ -e $lib_dir ]]; then
115
    rm -rf $sim_lib_dir
116
  fi
117
 
118
  mkdir $lib_dir
119
 
120
}
121
 
122
# Delete generated data from the previous run
123
reset_run()
124
{
125
  files_to_remove=(compile.log elaborate.log simulate.log vsim.wlf modelsim_lib)
126
  for (( i=0; i<${#files_to_remove[*]}; i++ )); do
127
    file="${files_to_remove[i]}"
128
    if [[ -e $file ]]; then
129
      rm -rf $file
130
    fi
131
  done
132
 
133
  create_lib_dir
134
}
135
 
136
# Check command line arguments
137
check_args()
138
{
139
  if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
140
    echo -e "ERROR: Unknown option specified '$2' (type \"./axi_uartlite_module.sh -help\" for more information)\n"
141
    exit 1
142
  fi
143
 
144
  if [[ ($2 == "-help" || $2 == "-h") ]]; then
145
    usage
146
  fi
147
}
148
 
149
# Script usage
150
usage()
151
{
152
  msg="Usage: axi_uartlite_module.sh [-help]\n\
153
Usage: axi_uartlite_module.sh [-lib_map_path]\n\
154
Usage: axi_uartlite_module.sh [-reset_run]\n\
155
Usage: axi_uartlite_module.sh [-noclean_files]\n\n\
156
[-help] -- Print help information for this script\n\n\
157
[-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
158
using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
159
[-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
160
from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
161
-noclean_files switch.\n\n\
162
[-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
163
  echo -e $msg
164
  exit 1
165
}
166
 
167
# Launch script
168
run $1 $2

powered by: WebSVN 2.1.0

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