one place for all my love
[hwmod.git] / demo / sim / testcase1 / demo_tb_behav.do
diff --git a/demo/sim/testcase1/demo_tb_behav.do b/demo/sim/testcase1/demo_tb_behav.do
new file mode 100644 (file)
index 0000000..78d3d8a
--- /dev/null
@@ -0,0 +1,37 @@
+if {[file exists behav_work]} {
+  vdel -all -lib behav_work
+}
+
+# create work library directory
+vlib behav_work
+
+# map directory to library name "work"
+vmap work behav_work
+
+#compile vhdl files
+vcom -work work ../../src/demo_pkg.vhd
+vcom -work work -cover bs ../../src/demo.vhd
+
+# compile testbench
+vcom -work work demo_tb.vhd
+
+# compile configuration file
+vcom -work work config_behav.vhd
+
+# start simulation
+vsim -coverage work.conf
+
+view -undock wave
+
+# add signals to waveform
+# add all testbench signals
+add wave *
+
+# add internal signals of unit under test
+add wave -divider DEMO
+add wave uut/counter
+add wave uut/ledstate
+
+# auto-run simulation
+run 50 us
+wave zoomfull