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

Subversion Repositories or1k

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

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 1575 jcastillo
////      - Javier Castillo, javier.castillo@urjc.es              ////
16 1327 jcastillo
////                                                              ////
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 1575 jcastillo
// Revision 1.1.1.1  2004/12/13 17:14:31  jcastillo
48
// Firt import of OR1200 over Celoxica RC203 platform
49
//
50 1327 jcastillo
 
51
 
52
// synopsys translate_off
53
`include "timescale.v"
54
// synopsys translate_on
55
 
56
`include "or1200_defines.v"
57
 
58
module rc203_test;
59
 
60
   reg    clk_i;
61
   reg    rst_i;
62
 
63
 
64
   wire   [19:0] sram_address;
65
   wire   [3:0] sram_nBW;
66
   wire   sram_nRW;
67
   wire   sram_nCS;
68
   wire   sram_clk;
69
   tri    [31:0] sram_data;
70
 
71
   wire   uart_stx;
72
   reg    uart_srx;
73
 
74
 
75
   reg    jtag_tdi;
76
   reg    jtag_tms;
77
   reg    jtag_tck;
78
   wire   jtag_tdo;
79
 
80
 
81
soc soc(
82
   .clk(clk_i),
83
   .reset(rst_i),
84
   .sram_nRW(sram_nRW),
85
   .sram_nBW(sram_nBW),
86
   .sram_address(sram_address),
87
   .sram_nCS(sram_nCS),
88
   .sram_data(sram_data),
89
   .sram_clk(sram_clk),
90
   .uart_srx(uart_srx),
91
   .uart_stx(uart_stx),
92
   .jtag_tdi(jtag_tdi),
93
   .jtag_tms(jtag_tms),
94
   .jtag_tck(jtag_tck),
95
   .jtag_tdo(jtag_tdo)
96
  );
97
 
98
//
99
// If you load a hex file in the RAM model 
100
// OR1200 will boot from here
101
//
102
zbtram zbtram(
103
   .clk(sram_clk),
104
   .nBW(sram_nBW),
105
   .address(sram_address),
106
   .data(sram_data),
107
   .nCS(sram_nCS),
108
   .nRW(sram_nRW)
109
   );
110
 
111
   initial
112
   begin
113
     $display("Beggining");
114
     uart_srx=1;
115
     jtag_tck=1;
116
     jtag_tdi=0;
117
     jtag_tms=0;
118
     clk_i='b1;
119
     rst_i='b1;
120
     rst_i=#101'b0;
121
     #100;
122
     //JTAG IR DEBUG
123
     jtag_tms=1;
124
     #100;
125
     jtag_tck=0;
126
     #100;
127
     jtag_tck=1;
128
     #100;
129
     jtag_tck=0;
130
     #100;
131
     jtag_tck=1;
132
     #100;
133
     jtag_tck=0;
134
     #100;
135
     jtag_tck=1;
136
     #100;
137
     jtag_tck=0;
138
     #100;
139
     jtag_tck=1;
140
     #100;
141
     jtag_tck=0;
142
     #100;
143
     //TAP reseted
144
     jtag_tms=0;
145
     jtag_tck=1;
146
     #100;
147
     jtag_tck=0;
148
     #100;
149
     //RUN state
150
     jtag_tms=1;
151
     jtag_tck=1;
152
     #100;
153
     jtag_tck=0;
154
     #100;
155
     jtag_tck=1;
156
     #100;
157
     jtag_tck=0;
158
     #100;
159
     //SelectIR
160
     jtag_tms=0;
161
     jtag_tck=1;
162
     #100;
163
     jtag_tck=0;
164
     #100;
165
     jtag_tck=1;
166
     #100;
167
     jtag_tck=0;
168
     #100;
169
     //Shift IR
170
     jtag_tms=0;
171
     jtag_tck=1;
172
     jtag_tdi=0;
173
     #100;
174
     jtag_tck=0;
175
     #100;
176
     jtag_tck=1;
177
     #100;
178
     jtag_tck=0;
179
     #100;
180
     jtag_tck=1;
181
     #100;
182
     jtag_tck=0;
183
     #100;
184
     jtag_tck=1;
185
     jtag_tdi=1;
186
     jtag_tms=1;
187
     #100;
188
     jtag_tck=0;
189
     #100;
190
     //Exit
191
     jtag_tck=1;
192
     jtag_tms=1;
193
     #100
194
     jtag_tck=0;
195
     #100;
196
     jtag_tck=1;
197
     jtag_tms=0;
198
     #100;
199
     jtag_tck=0;
200
     #100;
201
     jtag_tck=1;
202
     #100;
203
   end
204
 
205
always #5 clk_i=!clk_i;
206
 
207
 
208
 
209
endmodule

powered by: WebSVN 2.1.0

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