summaryrefslogtreecommitdiffstats
path: root/hw_v5_fx30t_extension/simulation
diff options
context:
space:
mode:
authorBert Lange <b.lange@fzd.de>2011-11-07 14:37:59 +0100
committerBert Lange <b.lange@fzd.de>2011-11-07 14:37:59 +0100
commit83f5520b62663857ce8e4813ee8de2bb3cbd07b0 (patch)
tree4d717fa205c5603c4136bb97d7baad8041d3274b /hw_v5_fx30t_extension/simulation
parent96d587425f73e57dcfc6dffde48258a39dfb05f0 (diff)
downloadzpu-83f5520b62663857ce8e4813ee8de2bb3cbd07b0.zip
zpu-83f5520b62663857ce8e4813ee8de2bb3cbd07b0.tar.gz
initial commit
Diffstat (limited to 'hw_v5_fx30t_extension/simulation')
-rw-r--r--hw_v5_fx30t_extension/simulation/Makefile47
-rw-r--r--hw_v5_fx30t_extension/simulation/run.do65
-rw-r--r--hw_v5_fx30t_extension/simulation/vhdl_files.txt1
3 files changed, 113 insertions, 0 deletions
diff --git a/hw_v5_fx30t_extension/simulation/Makefile b/hw_v5_fx30t_extension/simulation/Makefile
new file mode 100644
index 0000000..7c41f84
--- /dev/null
+++ b/hw_v5_fx30t_extension/simulation/Makefile
@@ -0,0 +1,47 @@
+#
+# $HeadURL: https://svn.fzd.de/repo/concast/FWF_Projects/FWKE/beam_position_monitor/hardware/board_sp605/simulation/Makefile $
+# $Date: 2011-09-05 16:49:43 +0200 (Mo, 05. Sep 2011) $
+# $Author: lange $
+# $Revision: 1240 $
+#
+
+library = work
+top = top
+
+all: compile simulate
+
+
+compile: Makefile.msim
+ export ANAFLAGS="-quiet -2008"; \
+ make -f Makefile.msim | ccze -A
+
+
+simulate:
+ export top=$(top); \
+ vsim -quiet -gui $(library).$(top) -do run.do -nowlfmcl -l transcript.log
+
+
+clean:
+ rm -rf $(library)
+ rm -f transcript
+ rm -f *.wlf
+ rm -f wlf*
+ @#
+ make -f Makefile.msim clean
+ rm -f Makefile.msim
+ rm -f .stamp
+
+
+# default patterns
+
+lib: $(library)
+
+$(library):
+ vlib $(library)
+
+
+# generate Makefile.msim with vmk
+Makefile.msim: vhdl_files.txt lib
+ vlib work
+ vmk -t modelsim -O -w $(library) -F vhdl_files.txt
+
diff --git a/hw_v5_fx30t_extension/simulation/run.do b/hw_v5_fx30t_extension/simulation/run.do
new file mode 100644
index 0000000..339fac7
--- /dev/null
+++ b/hw_v5_fx30t_extension/simulation/run.do
@@ -0,0 +1,65 @@
+
+#
+# helper functions
+#
+
+# restart + run
+proc r {} {
+ restart -f
+ set sim_start [clock seconds]
+
+ run -all
+
+ puts "# simulation run time: [clock format [expr [clock seconds] - $sim_start] -gmt 1 -format %H:%M:%S] "
+}
+
+
+# restart with clear
+proc rc {} {
+ .main clear
+ r
+}
+
+# print varables
+proc my_debug {} {
+ global env
+ foreach key [array names env] {
+ puts "$key=$env($key)"
+ }
+}
+
+
+# fast exit
+proc e {} {
+ exit -force
+}
+
+# fast exit
+proc x {} {
+ exit -force
+}
+
+
+# get env variables
+global env
+quietly set top $env(top)
+
+
+if {[file exists wave.do]} {
+ do wave.do
+} else {
+ if {[file exists wave_$top.do]} {
+ do wave_$top.do
+ } else {
+ puts "INFO: no wave file (wave_$top.do) found"
+ }
+ puts "INFO: no wave file (wave.do) found"
+}
+
+
+
+set sim_start [clock seconds]
+
+run -all
+
+puts "# simulation run time: [clock format [expr [clock seconds] - $sim_start] -gmt 1 -format %H:%M:%S] "
diff --git a/hw_v5_fx30t_extension/simulation/vhdl_files.txt b/hw_v5_fx30t_extension/simulation/vhdl_files.txt
new file mode 100644
index 0000000..a994fc5
--- /dev/null
+++ b/hw_v5_fx30t_extension/simulation/vhdl_files.txt
@@ -0,0 +1 @@
+work ../rtl/top.vhd
OpenPOWER on IntegriCloud