R
rik
Guest
Hi guys
I have an issue here.
Here is a testbench
parameter data1 = 4'b0010;
@(negedge tclk)
scan_ir(data1);
............
task scan_ir;
input [3:0] tdi_data;
integer k;
integer l;
parameter tms_value = 9'b0110_0_0110;
begin
for (k=0 ; k<9 ; k=k+1)
begin
tms = tms_value[k];
if (k==4)
begin
for (l=0; l<4; l=l+1)
begin
@(negedge tclk)
tdi_in= tdi_data[l];
if (y==3)
tms = 1;
end
end
@(negedge tclk);
end
end
endtask
I need to pass the value data1 to the task, where tdi_in is feed to the
value of tdi_data which inturn is data1. But I think there is a bug in,
tdi_in = tdi_data[l]
and is not getting executed as desired.
Can I pass in value like this. If yes how can I assign bit by bit
values to tdi_in with the value of data1, using task/functions.
I have an issue here.
Here is a testbench
parameter data1 = 4'b0010;
@(negedge tclk)
scan_ir(data1);
............
task scan_ir;
input [3:0] tdi_data;
integer k;
integer l;
parameter tms_value = 9'b0110_0_0110;
begin
for (k=0 ; k<9 ; k=k+1)
begin
tms = tms_value[k];
if (k==4)
begin
for (l=0; l<4; l=l+1)
begin
@(negedge tclk)
tdi_in= tdi_data[l];
if (y==3)
tms = 1;
end
end
@(negedge tclk);
end
end
endtask
I need to pass the value data1 to the task, where tdi_in is feed to the
value of tdi_data which inturn is data1. But I think there is a bug in,
tdi_in = tdi_data[l]
and is not getting executed as desired.
Can I pass in value like this. If yes how can I assign bit by bit
values to tdi_in with the value of data1, using task/functions.