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/] [clk_gen/] [questa/] [clk_gen.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    : clk_gen.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 Thu Jul 23 09:42:11 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: clk_gen.sh [-help]
18
# usage: clk_gen.sh [-lib_map_path]
19
# usage: clk_gen.sh [-noclean_files]
20
# usage: clk_gen.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 'clk_gen.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 "clk_gen.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 \"./clk_gen.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
  lib_map_path="<SPECIFY_COMPILED_LIB_PATH>"
106
  if [[ ($1 != "" && -e $1) ]]; then
107
    lib_map_path="$1"
108
  else
109
    echo -e "ERROR: Compiled simulation library directory path not specified or does not exist (type "./top.sh -help" for more information)\n"
110
  fi
111
  if [[ ($lib_map_path != "") ]]; then
112
    src_file="$lib_map_path/$file"
113
    cp $src_file .
114
  fi
115
}
116
 
117
# Create design library directory
118
create_lib_dir()
119
{
120
  lib_dir="questa_lib"
121
  if [[ -e $lib_dir ]]; then
122
    rm -rf $sim_lib_dir
123
  fi
124
 
125
  mkdir $lib_dir
126
 
127
}
128
 
129
# Delete generated data from the previous run
130
reset_run()
131
{
132
  files_to_remove=(compile.log elaborate.log simulate.log vsim.wlf questa_lib)
133
  for (( i=0; i<${#files_to_remove[*]}; i++ )); do
134
    file="${files_to_remove[i]}"
135
    if [[ -e $file ]]; then
136
      rm -rf $file
137
    fi
138
  done
139
 
140
  create_lib_dir
141
}
142
 
143
# Check command line arguments
144
check_args()
145
{
146
  if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then
147
    echo -e "ERROR: Unknown option specified '$2' (type \"./clk_gen.sh -help\" for more information)\n"
148
    exit 1
149
  fi
150
 
151
  if [[ ($2 == "-help" || $2 == "-h") ]]; then
152
    usage
153
  fi
154
}
155
 
156
# Script usage
157
usage()
158
{
159
  msg="Usage: clk_gen.sh [-help]\n\
160
Usage: clk_gen.sh [-lib_map_path]\n\
161
Usage: clk_gen.sh [-reset_run]\n\
162
Usage: clk_gen.sh [-noclean_files]\n\n\
163
[-help] -- Print help information for this script\n\n\
164
[-lib_map_path <path>] -- Compiled simulation library directory path. The simulation library is compiled\n\
165
using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\
166
[-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\
167
from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\
168
-noclean_files switch.\n\n\
169
[-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n"
170
  echo -e $msg
171
  exit 1
172
}
173
 
174
# Launch script
175
run $1 $2

powered by: WebSVN 2.1.0

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