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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [bench/] [verilog/] [rc203_test.v] - Blame information for rev 1327

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

Line No. Rev Author Line
1 1327 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Testbench for the system                                    ////
4
////                                                              ////
5
////                                                              ////
6
////  Description                                                 ////
7
////  Resets the system, applies the clk and moves the TAP        ////
8
////  around some states. If you have loaded a program in the     ////
9
////  ZBT RAM model, it will run                                  ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - nothing really                                           ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Javier Castillo, jcastillo@opensocdesign.com          ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2004 OpenCores                                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47
 
48
 
49
// synopsys translate_off
50
`include "timescale.v"
51
// synopsys translate_on
52
 
53
`include "or1200_defines.v"
54
 
55
module rc203_test;
56
 
57
   reg    clk_i;
58
   reg    rst_i;
59
 
60
 
61
   wire   [19:0] sram_address;
62
   wire   [3:0] sram_nBW;
63
   wire   sram_nRW;
64
   wire   sram_nCS;
65
   wire   sram_clk;
66
   tri    [31:0] sram_data;
67
 
68
   wire   uart_stx;
69
   reg    uart_srx;
70
 
71
 
72
   reg    jtag_tdi;
73
   reg    jtag_tms;
74
   reg    jtag_tck;
75
   wire   jtag_tdo;
76
 
77
 
78
soc soc(
79
   .clk(clk_i),
80
   .reset(rst_i),
81
   .sram_nRW(sram_nRW),
82
   .sram_nBW(sram_nBW),
83
   .sram_address(sram_address),
84
   .sram_nCS(sram_nCS),
85
   .sram_data(sram_data),
86
   .sram_clk(sram_clk),
87
   .uart_srx(uart_srx),
88
   .uart_stx(uart_stx),
89
   .jtag_tdi(jtag_tdi),
90
   .jtag_tms(jtag_tms),
91
   .jtag_tck(jtag_tck),
92
   .jtag_tdo(jtag_tdo)
93
  );
94
 
95
//
96
// If you load a hex file in the RAM model 
97
// OR1200 will boot from here
98
//
99
zbtram zbtram(
100
   .clk(sram_clk),
101
   .nBW(sram_nBW),
102
   .address(sram_address),
103
   .data(sram_data),
104
   .nCS(sram_nCS),
105
   .nRW(sram_nRW)
106
   );
107
 
108
   initial
109
   begin
110
     $display("Beggining");
111
     uart_srx=1;
112
     jtag_tck=1;
113
     jtag_tdi=0;
114
     jtag_tms=0;
115
     clk_i='b1;
116
     rst_i='b1;
117
     rst_i=#101'b0;
118
     #100;
119
     //JTAG IR DEBUG
120
     jtag_tms=1;
121
     #100;
122
     jtag_tck=0;
123
     #100;
124
     jtag_tck=1;
125
     #100;
126
     jtag_tck=0;
127
     #100;
128
     jtag_tck=1;
129
     #100;
130
     jtag_tck=0;
131
     #100;
132
     jtag_tck=1;
133
     #100;
134
     jtag_tck=0;
135
     #100;
136
     jtag_tck=1;
137
     #100;
138
     jtag_tck=0;
139
     #100;
140
     //TAP reseted
141
     jtag_tms=0;
142
     jtag_tck=1;
143
     #100;
144
     jtag_tck=0;
145
     #100;
146
     //RUN state
147
     jtag_tms=1;
148
     jtag_tck=1;
149
     #100;
150
     jtag_tck=0;
151
     #100;
152
     jtag_tck=1;
153
     #100;
154
     jtag_tck=0;
155
     #100;
156
     //SelectIR
157
     jtag_tms=0;
158
     jtag_tck=1;
159
     #100;
160
     jtag_tck=0;
161
     #100;
162
     jtag_tck=1;
163
     #100;
164
     jtag_tck=0;
165
     #100;
166
     //Shift IR
167
     jtag_tms=0;
168
     jtag_tck=1;
169
     jtag_tdi=0;
170
     #100;
171
     jtag_tck=0;
172
     #100;
173
     jtag_tck=1;
174
     #100;
175
     jtag_tck=0;
176
     #100;
177
     jtag_tck=1;
178
     #100;
179
     jtag_tck=0;
180
     #100;
181
     jtag_tck=1;
182
     jtag_tdi=1;
183
     jtag_tms=1;
184
     #100;
185
     jtag_tck=0;
186
     #100;
187
     //Exit
188
     jtag_tck=1;
189
     jtag_tms=1;
190
     #100
191
     jtag_tck=0;
192
     #100;
193
     jtag_tck=1;
194
     jtag_tms=0;
195
     #100;
196
     jtag_tck=0;
197
     #100;
198
     jtag_tck=1;
199
     #100;
200
   end
201
 
202
always #5 clk_i=!clk_i;
203
 
204
 
205
 
206
endmodule

powered by: WebSVN 2.1.0

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