thnx 4 d reply .
yes i hav declared variable as int i.
and i hav found a sol fr it by using a for loop instead f foreach.
i have anothr problem now in d piece f code below.
task scoreboard :: check();
int index[$];
string message;
static int pkts_checked = 0;
if(TRACE_ON) $display("[trace]%t %s:%m",$realtime,name);
index = refpkt.find_first_index() with (item.da == pkt2cmp.da);
if(index.size() <= 0)
begin
$display("\n%m\n[error]%t %s not found in reference queue\n",
$realtime,pkt2cmp.name);
pkt2cmp.display("error");
$finish;
end
pkt2send = refpkt[index[0]];
refpkt.delete(index[0]);
if(!pkt2send.compare(pkt2cmp, message))
begin
$display("\n%m\n[error]%t packet #%0d %s\n",$realtime,
pkts_changed, message);
pkt2send.display("error");
pkt2cmp.display("error");
$finish;
end
$display("[note]%t packet #%0d %s", $realtime, pkts_checked++, message);
if(pkts_checked >= run_for_n_packets)
->done;
endtask
in the line
index = refpkt.find_first_index() with (item.da == pkt2cmp.da);
shows the follwing error.
|
ncvlog: *E,EXPIDN (scoreboard.sv,54|34): expecting an identifier (null).
i have tried it wd removing () aftr refpkt.find_first_index with .....
also have tried it with .find_index() with....
but noth as such workd out. plz help wd sm other suggestion.
thnx.