Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

system verilog error with ncvlog

Status
Not open for further replies.

aizyc

Newbie level 4
Joined
Nov 26, 2010
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
hyderabad
Activity points
1,329
hi
i hav written the "generator class " code for a router
my simulation is stuck with an error . please help me with a solution asap.

this is the piece of code
------------------------------------------------
function generator::new(string name = "generator");
if(TRACE_ON)
$display("[TRACE] %t %s:%m", $realtime,name);
this.name = name;
this.pkt2send = new();
this.out_box = new[16];

foreach(this.out_box)
begin
this.out_box = new();
end
endfunction
----------------------------------------------------------------
---- the error-----


foreach(this.out_box)

|
ncvlog: *E,EXPAIF (generator.sv,27|16): Expecting simple array identifier in foreach.

foreach(this.out_box)
|
ncvlog: *E,MISEXX (generator.sv,27|28): expecting an '=' or '<=' sign in an assignment [9.2(IEEE)].
foreach(this.out_box)
|
ncvlog: *E,NOTSTT (generator.sv,27|28): expecting a statement [9(IEEE)].


thanks.
 

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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top