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

Subversion Repositories wb4pb

[/] [wb4pb/] [trunk/] [sim/] [do/] [picoblaze_wb_uart_tb.do] - Blame information for rev 32

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 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 31 ste.fis
##    and/or other materials provided with the distribution.
17 14 ste.fis
##
18
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
## POSSIBILITY OF SUCH DAMAGE.
29
##
30
################################################################################
31
## filename: picoblaze_wb_uart_tb.do
32
## description: ModelSim (R) do-macro / tcl-script for picoblaze_wb_uart_tb hdl
33
##              testbench
34
## todo4user: modify working directory and hdl variables
35
## version: 0.0.0
36
## changelog: - 0.0.0, initial release
37
##            - ...
38
################################################################################
39
 
40
# IMPORTANT NOTICE!
41
# Verilog (R) simulation flow requires Xilinx (R) ISE (R) to be installed.
42
 
43 25 ste.fis
# user settings: preferred hdl, working directory and Xilinx (R) ISE (R)
44
# installation path (needed for Verilog (R) simulation)
45
set wd "d:/projects/wb4pb/sim"
46 14 ste.fis
set isVHDL yes
47 25 ste.fis
set XILINX_ISE_PATH "c:/xilinx/13.1"
48 14 ste.fis
 
49
# working directory cannot be changed while simulation is running
50
if {![string equal -nocase [pwd] $wd]} {
51
  quit -sim
52
  cd $wd
53
}
54
 
55
# creating library work, if not existing
56
if {[glob -nocomplain -types d "work"] == {}} {
57
  vlib work
58
}
59
 
60
# compiling hdl modules and starting simulator
61
if {$isVHDL} {
62
 
63
  vcom -check_synthesis "../rtl/picoblaze_wb_uart.vhd"
64
  vcom -check_synthesis "../rtl/wbm_picoblaze.vhd"
65
  vcom -check_synthesis "../rtl/wbs_uart.vhd"
66
  vcom "../rtl/uart_rx.vhd"
67
  vcom "../rtl/uart_tx.vhd"
68
  vcom "../rtl/kcuart_rx.vhd"
69
  vcom "../rtl/kcuart_tx.vhd"
70
  vcom "../rtl/bbfifo_16x8.vhd"
71
  vcom "../rtl/kcpsm3.vhd"
72
  vcom "../asm/pbwbuart.vhd"
73
  vcom "../sim/hdl/picoblaze_wb_uart_tb.vhd"
74
 
75
  vsim picoblaze_wb_uart_tb behavioral
76
 
77
} else {
78
 
79
  vlog "../rtl/picoblaze_wb_uart.v"
80
  vlog "../rtl/wbm_picoblaze.v"
81
  vlog "../rtl/wbs_uart.v"
82
  vlog "../rtl/uart_rx.v"
83
  vlog "../rtl/uart_tx.v"
84
  vlog "../rtl/kcuart_rx.v"
85
  vlog "../rtl/kcuart_tx.v"
86
  vlog "../rtl/bbfifo_16x8.v"
87
  vlog "../rtl/kcpsm3.v"
88
  vlog "../asm/pbwbuart.v"
89
  vlog "../sim/hdl/picoblaze_wb_uart_tb.v"
90 25 ste.fis
  vlog "${XILINX_ISE_PATH}/ise_ds/ise/verilog/src/glbl.v"
91 14 ste.fis
 
92
  vsim picoblaze_wb_uart_tb glbl
93
 
94
}
95
 
96
# configuring wave window
97
view -undock -x 0 -y 0 -width 1024 -height 640 wave
98
 
99
# adding signals of interest
100
 
101
proc add_wave_sys_sig? {on_off_n} {
102
  if {$on_off_n} {
103
    add wave -divider "SYSTEM SIGNALS"
104
    add wave sim:/dut/rst
105
    add wave sim:/dut/clk
106
  }
107
}
108
 
109
proc add_wave_wb_sig? {on_off_n} {
110
  if {$on_off_n} {
111
    add wave -divider "WISHBONE SIGNALS"
112
    #add wave sim:/dut/wb_cyc
113
    add wave sim:/dut/wb_stb
114
    add wave sim:/dut/wb_we
115
    add wave -radix hex sim:/dut/wb_adr
116 25 ste.fis
    add wave -radix ascii sim:/dut/wb_dat_m2s
117 14 ste.fis
    add wave -radix hex sim:/dut/wb_dat_s2m
118
    add wave sim:/dut/wb_ack
119
  }
120
}
121
 
122
proc add_wave_pbport_sig? {on_off_n} {
123
  if {$on_off_n} {
124
    add wave -divider "PICOBLAZE PORT SIGNALS"
125
    add wave -radix hex sim:/dut/pb_port_id
126
    add wave sim:/dut/pb_write_strobe
127
    add wave -radix hex sim:/dut/pb_out_port
128
    add wave sim:/dut/pb_read_strobe
129
    add wave -radix hex sim:/dut/pb_in_port
130
  }
131
}
132
 
133
proc add_wave_pbimem_sig? {on_off_n} {
134
  if {$on_off_n} {
135
    add wave -divider "PICOBLAZE INSTRUCTION MEMORY SIGNALS"
136
    add wave -radix hex sim:/dut/address
137
    add wave -radix hex sim:/dut/instruction
138
  }
139
}
140
 
141
proc add_wave_uart_sig? {on_off_n} {
142
  if {$on_off_n} {
143
    add wave -divider "UART SIGNALS"
144
    add wave sim:/uart_rx_si
145
    #add wave sim:/uart_tx_so
146
    add wave sim:/dut/inst_wbs_uart/en_16_x_baud
147
  }
148
}
149
 
150
# selecting active signal groups
151
add_wave_sys_sig? yes
152
add_wave_wb_sig? yes
153
add_wave_pbport_sig? yes
154
add_wave_pbimem_sig? no
155
add_wave_uart_sig? yes
156
 
157
# setting simulation runtime
158
run 100 us
159
 
160
# zooming to time area of interest
161
wave zoomfull

powered by: WebSVN 2.1.0

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