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 31

Go to most recent revision | 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
##  * 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_uart_tb.do
35
## description: ModelSim (R) do-macro / tcl-script for picoblaze_wb_uart_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 14 ste.fis
set isVHDL yes
50 25 ste.fis
set XILINX_ISE_PATH "c:/xilinx/13.1"
51 14 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_uart.vhd"
67
  vcom -check_synthesis "../rtl/wbm_picoblaze.vhd"
68
  vcom -check_synthesis "../rtl/wbs_uart.vhd"
69
  vcom "../rtl/uart_rx.vhd"
70
  vcom "../rtl/uart_tx.vhd"
71
  vcom "../rtl/kcuart_rx.vhd"
72
  vcom "../rtl/kcuart_tx.vhd"
73
  vcom "../rtl/bbfifo_16x8.vhd"
74
  vcom "../rtl/kcpsm3.vhd"
75
  vcom "../asm/pbwbuart.vhd"
76
  vcom "../sim/hdl/picoblaze_wb_uart_tb.vhd"
77
 
78
  vsim picoblaze_wb_uart_tb behavioral
79
 
80
} else {
81
 
82
  vlog "../rtl/picoblaze_wb_uart.v"
83
  vlog "../rtl/wbm_picoblaze.v"
84
  vlog "../rtl/wbs_uart.v"
85
  vlog "../rtl/uart_rx.v"
86
  vlog "../rtl/uart_tx.v"
87
  vlog "../rtl/kcuart_rx.v"
88
  vlog "../rtl/kcuart_tx.v"
89
  vlog "../rtl/bbfifo_16x8.v"
90
  vlog "../rtl/kcpsm3.v"
91
  vlog "../asm/pbwbuart.v"
92
  vlog "../sim/hdl/picoblaze_wb_uart_tb.v"
93 25 ste.fis
  vlog "${XILINX_ISE_PATH}/ise_ds/ise/verilog/src/glbl.v"
94 14 ste.fis
 
95
  vsim picoblaze_wb_uart_tb glbl
96
 
97
}
98
 
99
# configuring wave window
100
view -undock -x 0 -y 0 -width 1024 -height 640 wave
101
 
102
# adding signals of interest
103
 
104
proc add_wave_sys_sig? {on_off_n} {
105
  if {$on_off_n} {
106
    add wave -divider "SYSTEM SIGNALS"
107
    add wave sim:/dut/rst
108
    add wave sim:/dut/clk
109
  }
110
}
111
 
112
proc add_wave_wb_sig? {on_off_n} {
113
  if {$on_off_n} {
114
    add wave -divider "WISHBONE SIGNALS"
115
    #add wave sim:/dut/wb_cyc
116
    add wave sim:/dut/wb_stb
117
    add wave sim:/dut/wb_we
118
    add wave -radix hex sim:/dut/wb_adr
119 25 ste.fis
    add wave -radix ascii sim:/dut/wb_dat_m2s
120 14 ste.fis
    add wave -radix hex sim:/dut/wb_dat_s2m
121
    add wave sim:/dut/wb_ack
122
  }
123
}
124
 
125
proc add_wave_pbport_sig? {on_off_n} {
126
  if {$on_off_n} {
127
    add wave -divider "PICOBLAZE PORT SIGNALS"
128
    add wave -radix hex sim:/dut/pb_port_id
129
    add wave sim:/dut/pb_write_strobe
130
    add wave -radix hex sim:/dut/pb_out_port
131
    add wave sim:/dut/pb_read_strobe
132
    add wave -radix hex sim:/dut/pb_in_port
133
  }
134
}
135
 
136
proc add_wave_pbimem_sig? {on_off_n} {
137
  if {$on_off_n} {
138
    add wave -divider "PICOBLAZE INSTRUCTION MEMORY SIGNALS"
139
    add wave -radix hex sim:/dut/address
140
    add wave -radix hex sim:/dut/instruction
141
  }
142
}
143
 
144
proc add_wave_uart_sig? {on_off_n} {
145
  if {$on_off_n} {
146
    add wave -divider "UART SIGNALS"
147
    add wave sim:/uart_rx_si
148
    #add wave sim:/uart_tx_so
149
    add wave sim:/dut/inst_wbs_uart/en_16_x_baud
150
  }
151
}
152
 
153
# selecting active signal groups
154
add_wave_sys_sig? yes
155
add_wave_wb_sig? yes
156
add_wave_pbport_sig? yes
157
add_wave_pbimem_sig? no
158
add_wave_uart_sig? yes
159
 
160
# setting simulation runtime
161
run 100 us
162
 
163
# zooming to time area of interest
164
wave zoomfull

powered by: WebSVN 2.1.0

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