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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [fpgas/] [ip/] [Nexys2_T6502/] [sim/] [icarus/] [io_irq_2/] [test_define] - Blame information for rev 133

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
 
2
reg actual;
3
 
4
parameter   EXTEST          =   4'b0000;
5
parameter   SAMPLE          =   4'b0001;
6
parameter   HIGHZ_MODE      =   4'b0010;
7
parameter   CHIP_ID_ACCESS  =   4'b0011;
8
parameter   CLAMP           =   4'b1000;
9
parameter   RPC_DATA        =   4'b1010;
10
parameter   RPC_ADD         =   4'b1001;
11
parameter   BYPASS          =   4'b1111;
12
parameter   INST_RETURN     =   4'b1101;
13
 
14
 
15
 
16
initial
17
begin
18
$display("              ");
19
$display("              ===================================================");
20
$display("              Test Start");
21
$display("              ===================================================");
22
$display("              ");
23
test.cg.next(20);
24
 
25
fork
26
begin
27
test.uart_model.rcv_byte(8'h42);
28
test.uart_model.send_byte(8'h65);
29
test.uart_model.rcv_byte(8'h65);
30
test.uart_model.send_byte(8'h37);
31
test.uart_model.rcv_byte(8'h37);
32
test.uart_model.send_byte(8'h20);
33
test.uart_model.rcv_byte(8'h20);
34
test.uart_model.send_byte(8'h41);
35
test.uart_model.rcv_byte(8'h41);
36
test.uart_model.send_byte(8'h45);
37
test.uart_model.rcv_byte(8'h45);
38
test.uart_model.send_byte(8'h25);
39
test.uart_model.rcv_byte(8'h25);
40
test.cg.next(4000);
41
end
42
begin
43
$display("              ");
44
$display("              ===================================================");
45
$display("              JTAG Test Start");
46
$display("              ===================================================");
47
$display("              ");
48
 
49
 
50
 
51
 
52
 
53
test.cg.next(2);
54
test.jtag_model.enable_tclk;
55
test.cg.next(20);
56
 
57
 
58
test.jtag_model.enable_trst_n;
59
test.jtag_model.enable_reset;
60
test.jtag_model.init;
61
test.cg.next(10);
62
test.jtag_model.LoadTapInst(EXTEST,INST_RETURN);
63
test.cg.next(100);
64
test.jtag_model.LoadTapInst(CLAMP,INST_RETURN);
65
 
66
 
67
test.cg.next(100);
68
test.jtag_model.LoadTapInst(CHIP_ID_ACCESS,INST_RETURN);
69 133 jt_eaton
test.jtag_model.Shift_Cmp_32(32'ha5a5a5a5,32'hf1c2e093);
70 131 jt_eaton
 
71 133 jt_eaton
 
72
test.SW_reg   = 8'h34;
73 131 jt_eaton
test.cg.next(100);
74
test.jtag_model.LoadTapInst(RPC_DATA,INST_RETURN);
75
 
76
 
77 133 jt_eaton
Shift_Cmp_8(8'ha5,8'h34);
78 131 jt_eaton
 
79 133 jt_eaton
test.SW_reg   = 8'h56;
80 131 jt_eaton
test.cg.next(100);
81 133 jt_eaton
Shift_Cmp_8(8'h00,8'h56);
82
 
83
test.SW_reg   = 8'h78;
84
test.cg.next(100);
85
Shift_Cmp_8(8'h00,8'h78);
86
 
87
test.SW_reg   = 8'hff;
88
test.cg.next(100);
89
Shift_Cmp_8(8'h00,8'hff);
90
 
91
 
92
 
93
test.cg.next(100);
94 131 jt_eaton
test.jtag_model.LoadTapInst(RPC_ADD,INST_RETURN);
95
 
96
Shift_Cmp_53(53'h1c000000000000,53'h00000000000004);
97
 
98
test.cg.next(4000);
99
 
100
 
101
Shift_Cmp_42(42'b0_11001010_00011000_10000001_11111111_0100_00001       ,42'h00000000004);
102
Shift_Cmp_42(42'b0_00110110_11001100_10011001_01111110_0100_00001       ,42'h2ca1881ff44);
103
 
104
 
105
test.cg.next(5000);
106
 
107
 
108
 
109
 
110
test.cg.next(100);
111
 
112
test.jtag_model.LoadTapInst(BYPASS,INST_RETURN);
113
 
114
test.cg.next(100);
115
 
116
 
117
 
118
 
119
 
120
 
121
end
122
join
123
test.cg.exit;
124
end
125
 
126
 
127
 
128
task automatic  Shift_Cmp_8;    // Initialize boundary register with outputs disabled
129
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
130
 
131
  parameter [15:0] LENGTH =  8;
132
 
133
  input [LENGTH:1]  Dataout;
134
  input [LENGTH:1]  DataExp;
135
  integer i;
136
 
137
  reg [LENGTH:1]  DataBack;
138
 
139
  begin
140
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
141
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
142
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
143
    for (i = 1; i <= LENGTH; i = i+1)
144
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
145
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
146
 
147
   if (DataBack  !== DataExp )
148
   begin
149
   test.cg.fail  (" Shift_cmp  receive error  ");
150
   end
151
 
152
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
153
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
154
  end
155
endtask // ShiftRegister
156
 
157
 
158
 
159
 
160
 
161
 
162
task automatic  Shift_Cmp_42;    // Initialize boundary register with outputs disabled
163
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
164
 
165
  parameter [15:0] LENGTH =  42;
166
 
167
  input [LENGTH:1]  Dataout;
168
  input [LENGTH:1]  DataExp;
169
  integer i;
170
 
171
  reg [LENGTH:1]  DataBack;
172
 
173
  begin
174
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
175
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
176
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
177
    for (i = 1; i <= LENGTH; i = i+1)
178
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
179
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
180
 
181
   if (DataBack  != DataExp )
182
   begin
183
   test.cg.fail  (" Shift_cmp  receive error  ");
184
   end
185
 
186
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
187
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
188
  end
189
endtask // ShiftRegister
190
 
191
 
192
 
193
 
194
 
195
task automatic  Shift_Cmp_53;    // Initialize boundary register with outputs disabled
196
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
197
 
198
  parameter [15:0] LENGTH =  53;
199
 
200
  input [LENGTH:1]  Dataout;
201
  input [LENGTH:1]  DataExp;
202
  integer i;
203
 
204
  reg [LENGTH:1]  DataBack;
205
 
206
  begin
207
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
208
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
209
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
210
    for (i = 1; i <= LENGTH; i = i+1)
211
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
212
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
213
 
214
   if (DataBack  != DataExp )
215
   begin
216
   test.cg.fail  (" Shift_cmp  receive error  ");
217
   end
218
 
219
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
220
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
221
  end
222
endtask // ShiftRegister
223
 
224
 
225
 

powered by: WebSVN 2.1.0

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