1 |
6 |
daniel.kho |
#!/bin/bash
|
2 |
|
|
#
|
3 |
|
|
# Example bash script for Mentor Graphics QuestaSim/ModelSim simulation.
|
4 |
|
|
#
|
5 |
|
|
# Author(s):
|
6 |
|
|
# - Daniel C.K. Kho, daniel.kho@opencores.org | daniel.kho@tauhop.com
|
7 |
|
|
#
|
8 |
|
|
# Copyright (C) 2012-2013 Authors and OPENCORES.ORG
|
9 |
|
|
#
|
10 |
|
|
# This program is free software: you can redistribute it and/or modify
|
11 |
|
|
# it under the terms of the GNU General Public License as published by
|
12 |
|
|
# the Free Software Foundation, either version 3 of the License, or
|
13 |
|
|
# (at your option) any later version.
|
14 |
|
|
#
|
15 |
|
|
# This program is distributed in the hope that it will be useful,
|
16 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
# GNU General Public License for more details.
|
19 |
|
|
#
|
20 |
|
|
# You should have received a copy of the GNU General Public License
|
21 |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
22 |
|
|
#
|
23 |
|
|
# This notice and disclaimer must be retained as part of this text at all times.
|
24 |
|
|
#
|
25 |
|
|
# @dependencies:
|
26 |
|
|
# @designer: Daniel C.K. Kho [daniel.kho@gmail.com] | [daniel.kho@tauhop.com]
|
27 |
|
|
# @history: @see Mercurial log for full list of changes.
|
28 |
|
|
#
|
29 |
|
|
# @Description:
|
30 |
|
|
#
|
31 |
|
|
|
32 |
|
|
#read -p "press Enter to run full simulation now, or Ctrl-C to exit: ";
|
33 |
|
|
echo $(date "+[%Y-%m-%d %H:%M:%S]: Removing previously-generated files and folders...");
|
34 |
|
|
rm -rf modelsim.ini ./simulate.log ./work ./altera ./osvvm ./tauhop;
|
35 |
|
|
|
36 |
|
|
echo $(date "+[%Y-%m-%d %H:%M:%S]: Remove successful.");
|
37 |
|
|
echo $(date "+[%Y-%m-%d %H:%M:%S]: Compiling project...");
|
38 |
|
|
vlib work; vmap work work;
|
39 |
|
|
#vlib osvvm; vmap osvvm osvvm;
|
40 |
|
|
#vlib tauhop; vmap tauhop tauhop;
|
41 |
|
|
|
42 |
|
|
#vcom -2008 -work osvvm ../../../rtl/packages/os-vvm/SortListPkg_int.vhd \
|
43 |
|
|
# ../../../rtl/packages/os-vvm/RandomBasePkg.vhd \
|
44 |
|
|
# ../../../rtl/packages/os-vvm/RandomPkg.vhd \
|
45 |
|
|
# ../../../rtl/packages/os-vvm/CoveragePkg.vhd \
|
46 |
|
|
# | tee -ai ./simulate.log;
|
47 |
|
|
|
48 |
|
|
vcom -2008 -work work ../../../design/fir.vhdl \
|
49 |
|
|
../../../tester/tb_fir.vhdl \
|
50 |
|
|
| tee -ai ./simulate.log;
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
errorStr=`grep "\*\* Error: " ./simulate.log`
|
54 |
|
|
if [ `echo ${#errorStr}` -gt 0 ]
|
55 |
|
|
then echo "Errors exist. Refer simulate.log for more details. Exiting."; exit;
|
56 |
|
|
else
|
57 |
|
|
vsim -t ps -do ./waves.do -voptargs="+acc" "work.tb_fir(rtl)";
|
58 |
|
|
echo $(date "+[%Y-%m-%d %H:%M:%S]: simulation loaded.");
|
59 |
|
|
fi
|