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

Subversion Repositories socgen

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 133 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'h0d);
28
test.uart_model.rcv_byte(8'h0a);
29
test.uart_model.rcv_byte(8'h4b);
30
test.uart_model.rcv_byte(8'h49);
31
test.uart_model.rcv_byte(8'h4d);
32
test.uart_model.rcv_byte(8'h0d);
33
test.uart_model.rcv_byte(8'h0a);
34
test.cg.next(4000);
35
end
36
begin
37
$display("              ");
38
$display("              ===================================================");
39
$display("              JTAG Test Start");
40
$display("              ===================================================");
41
$display("              ");
42
 
43
 
44
 
45
 
46
 
47
test.cg.next(2);
48
test.jtag_model.enable_tclk;
49
test.cg.next(20);
50
 
51
 
52
test.jtag_model.enable_trst_n;
53
test.jtag_model.enable_reset;
54
test.jtag_model.init;
55
test.cg.next(10);
56
test.jtag_model.LoadTapInst(EXTEST,INST_RETURN);
57
test.cg.next(100);
58
test.jtag_model.LoadTapInst(CLAMP,INST_RETURN);
59
 
60
 
61
test.cg.next(100);
62
test.jtag_model.LoadTapInst(CHIP_ID_ACCESS,INST_RETURN);
63
test.jtag_model.Shift_Cmp_32(32'ha5a5a5a5,32'hf1c2e093);
64
 
65
 
66
test.SW_reg   = 8'h00;
67
test.cg.next(100);
68
test.jtag_model.LoadTapInst(RPC_DATA,INST_RETURN);
69
test.cg.next(1000);
70
 
71
Shift_Cmp_8(8'ha5,8'h00);
72
 
73
test.SW_reg   = 8'h00;
74
test.cg.next(1000);
75
Shift_Cmp_8(8'hf0,8'h00);
76
 
77
 
78
 
79
 
80
test.cg.next(100);
81
 
82
test.jtag_model.LoadTapInst(RPC_ADD,INST_RETURN);
83
 
84
test.cg.next(100);
85
 
86
Shift_Cmp_18(18'h38000,18'h00004);
87
test.cg.next(500);
88
Shift_Cmp_18(18'h1fc21,18'h00004);
89
test.cg.next(500);
90
Shift_Cmp_18(18'h1f821,18'h0fe14);
91
test.cg.next(500);
92
Shift_Cmp_18(18'h1f021,18'h0fc14);
93
test.cg.next(500);
94
Shift_Cmp_18(18'h1c021,18'h0f814);
95
test.cg.next(500);
96
Shift_Cmp_18(18'h18021,18'h0e014);
97
test.cg.next(500);
98
Shift_Cmp_18(18'h10021,18'h0c014);
99
test.cg.next(500);
100
Shift_Cmp_18(18'h00021,18'h08014);
101
test.cg.next(500);
102
Shift_Cmp_18(18'h1fe21,18'h00014);
103
test.cg.next(500);
104
 
105
 
106
 
107
 
108
test.jtag_model.LoadTapInst(BYPASS,INST_RETURN);
109
 
110
test.cg.next(100);
111
 
112
 
113
 
114
 
115
 
116
 
117
end
118
join
119
test.cg.exit;
120
end
121
 
122
 
123
 
124
task automatic  Shift_Cmp_8;    // Initialize boundary register with outputs disabled
125
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
126
 
127
  parameter [15:0] LENGTH =  8;
128
 
129
  input [LENGTH:1]  Dataout;
130
  input [LENGTH:1]  DataExp;
131
  integer i;
132
 
133
  reg [LENGTH:1]  DataBack;
134
 
135
  begin
136
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
137
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
138
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
139
    for (i = 1; i <= LENGTH; i = i+1)
140
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
141
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
142
 
143
   if (DataBack  !== DataExp )
144
   begin
145
   test.cg.fail  (" Shift_cmp  receive error  ");
146
   end
147
 
148
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
149
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
150
  end
151
endtask // ShiftRegister
152
 
153
 
154
 
155
 
156
task automatic  Shift_Cmp_18;    // Initialize boundary register with outputs disabled
157
                         // This tasks starts at RT_IDLE and ends at SHIFT_DR
158
 
159
  parameter [15:0] LENGTH =  18;
160
 
161
  input [LENGTH:1]  Dataout;
162
  input [LENGTH:1]  DataExp;
163
  integer i;
164
 
165
  reg [LENGTH:1]  DataBack;
166
 
167
  begin
168
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);// Transition from RT_IDLE to SELECT_DR
169
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from SELECT_DR to CAPTURE_DR
170
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from CAPTURE_DR to SHIFT_DR
171
    for (i = 1; i <= LENGTH; i = i+1)
172
       test.jtag_model.Clk_bit((i==LENGTH),Dataout[i],DataBack[i]);
173
    $display  ("%t  %m    Shift_data_register    wr-%h  exp-%h rd-%h    ",$realtime,Dataout,DataExp,DataBack  );
174
 
175
   if (DataBack  !== DataExp )
176
   begin
177
   test.cg.fail  (" Shift_cmp  receive error  ");
178
   end
179
 
180
    test.jtag_model.Clk_bit(1'b1,1'b0,actual);//Transition from EXIT1-DR to UPDATE-DR
181
    test.jtag_model.Clk_bit(1'b0,1'b0,actual);// Transition from UPDATE-DR to IDLE
182
  end
183
endtask // ShiftRegister
184
 
185
 
186
 
187
 

powered by: WebSVN 2.1.0

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