OpenCores
URL https://opencores.org/ocsvn/wb4pb/wb4pb/trunk

Subversion Repositories wb4pb

[/] [wb4pb/] [trunk/] [sim/] [do/] [picoblaze_wb_gpio_tb.do] - Blame information for rev 25

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ste.fis
################################################################################
2
## This sourcecode is released under BSD license.
3
## Please see http://www.opensource.org/licenses/bsd-license.php for details!
4
################################################################################
5
##
6
## Copyright (c) 2010, Stefan Fischer 
7
## All rights reserved.
8
##
9
## Redistribution and use in source and binary forms, with or without
10
## modification, are permitted provided that the following conditions are met:
11
##
12
##  * Redistributions of source code must retain the above copyright notice,
13
##    this list of conditions and the following disclaimer.
14
##  * Redistributions in binary form must reproduce the above copyright notice,
15
##    this list of conditions and the following disclaimer in the documentation
16
##    and/or other materials provided with the distribution.
17
##  * Neither the name of the author nor the names of his contributors may be
18
##    used to endorse or promote products derived from this software without
19
##    specific prior written permission.
20
##
21
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
## POSSIBILITY OF SUCH DAMAGE.
32
##
33
################################################################################
34
## filename: picoblaze_wb_gpio_tb.do
35
## description: ModelSim (R) do-macro / tcl-script for picoblaze_wb_gpio_tb hdl
36
##              testbench
37
## todo4user: modify working directory and hdl variables
38
## version: 0.0.0
39
## changelog: - 0.0.0, initial release
40
##            - ...
41
################################################################################
42
 
43
# IMPORTANT NOTICE!
44
# Verilog (R) simulation flow requires Xilinx (R) ISE (R) to be installed.
45
 
46 25 ste.fis
# user settings: preferred hdl, working directory and Xilinx (R) ISE (R)
47
# installation path (needed for Verilog (R) simulation)
48
set wd "d:/projects/wb4pb/sim"
49 20 ste.fis
set isVHDL yes
50 25 ste.fis
set XILINX_ISE_PATH "c:/xilinx/13.1"
51 2 ste.fis
 
52
# working directory cannot be changed while simulation is running
53
if {![string equal -nocase [pwd] $wd]} {
54
  quit -sim
55
  cd $wd
56
}
57
 
58
# creating library work, if not existing
59
if {[glob -nocomplain -types d "work"] == {}} {
60
  vlib work
61
}
62
 
63
# compiling hdl modules and starting simulator
64
if {$isVHDL} {
65
 
66
  vcom -check_synthesis "../rtl/picoblaze_wb_gpio.vhd"
67
  vcom -check_synthesis "../rtl/wbm_picoblaze.vhd"
68
  vcom -check_synthesis "../rtl/wbs_gpio.vhd"
69
  vcom "../rtl/kcpsm3.vhd"
70
  vcom "../asm/pbwbgpio.vhd"
71
  vcom "../sim/hdl/picoblaze_wb_gpio_tb.vhd"
72
 
73
  vsim picoblaze_wb_gpio_tb behavioral
74
 
75
} else {
76
 
77
  vlog "../rtl/picoblaze_wb_gpio.v"
78
  vlog "../rtl/wbm_picoblaze.v"
79
  vlog "../rtl/wbs_gpio.v"
80
  vlog "../rtl/kcpsm3.v"
81
  vlog "../asm/pbwbgpio.v"
82
  vlog "../sim/hdl/picoblaze_wb_gpio_tb.v"
83 25 ste.fis
  vlog "${XILINX_ISE_PATH}/ise_ds/ise/verilog/src/glbl.v"
84 2 ste.fis
 
85
  vsim picoblaze_wb_gpio_tb glbl
86
 
87
}
88
 
89
# configuring wave window
90
view -undock -x 0 -y 0 -width 1024 -height 640 wave
91
 
92
# adding signals of interest
93
 
94
proc add_wave_sys_sig? {on_off_n} {
95
  if {$on_off_n} {
96
    add wave -divider "SYSTEM SIGNALS"
97
    add wave sim:/dut/rst
98
    add wave sim:/dut/clk
99
  }
100
}
101
 
102
proc add_wave_wb_sig? {on_off_n} {
103
  if {$on_off_n} {
104
    add wave -divider "WISHBONE SIGNALS"
105
    #add wave sim:/dut/wb_cyc
106
    add wave sim:/dut/wb_stb
107
    add wave sim:/dut/wb_we
108
    add wave -radix hex sim:/dut/wb_adr
109
    add wave -radix hex sim:/dut/wb_dat_m2s
110
    add wave -radix hex sim:/dut/wb_dat_s2m
111
    add wave sim:/dut/wb_ack
112
  }
113
}
114
 
115
proc add_wave_pbport_sig? {on_off_n} {
116
  if {$on_off_n} {
117
    add wave -divider "PICOBLAZE PORT SIGNALS"
118
    add wave -radix hex sim:/dut/pb_port_id
119
    add wave sim:/dut/pb_write_strobe
120
    add wave -radix hex sim:/dut/pb_out_port
121
    add wave sim:/dut/pb_read_strobe
122
    add wave -radix hex sim:/dut/pb_in_port
123
  }
124
}
125
 
126
proc add_wave_pbimem_sig? {on_off_n} {
127
  if {$on_off_n} {
128
    add wave -divider "PICOBLAZE INSTRUCTION MEMORY SIGNALS"
129
    add wave -radix hex sim:/dut/address
130
    add wave -radix hex sim:/dut/instruction
131
  }
132
}
133
 
134
proc add_wave_gpio_sig? {on_off_n} {
135
  if {$on_off_n} {
136
    add wave -divider "GPIO SIGNALS"
137
    add wave -radix hex sim:/dut/gpio_in
138
    add wave -radix hex sim:/dut/gpio_out
139
    add wave -radix hex sim:/dut/gpio_oe
140
    add wave -radix hex sim:/dut/p_gpio_io
141
  }
142
}
143
 
144
# selecting active signal groups
145
add_wave_sys_sig? yes
146
add_wave_wb_sig? yes
147
add_wave_pbport_sig? yes
148
add_wave_pbimem_sig? no
149
add_wave_gpio_sig? yes
150
 
151
# setting simulation runtime
152
run 10 us
153
 
154
# zooming to time area of interest
155
wave zoomfull

powered by: WebSVN 2.1.0

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