aizyc
Newbie level 4
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.
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.