sunidrak
Full Member level 1
- Joined
- Apr 12, 2012
- Messages
- 97
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- Bengaluru, India
- Activity points
- 1,738
Does ModelSim support nested class testbench codes...Can any body tell in which verilog simulator does this code works ? This code is shownig error in my Modelsim SE
** Error: C:/Sunil_Labs/Lab1/example2.sv(31): (vlog-60) Nested class declarations not yet supported.
////////////CODE/////////////////
class figure;
virtual function void draw();
$display("figure:draw");
endfunction
function void compute_area();
$display("figure:compute_area");
endfunction
endclass
class polygon extends figure;
virtual function void draw();
$display("polygon:draw");
endfunction
function void compute_area();
$display("polygon:compute_area");
endfunction
endclass
class square extends polygon;
virtual function void draw();
$display("square:draw");
endfunction
function void compute_area();
$display("square:compute_area");
endfunction
class square extends polygon;
virtual function void draw();
$display("square:draw");
endfunction
function void compute_area();
$display("square:compute_area");
endfunction
endclass
module top;
figure f;
polygon p;
square s;
initial begin
s = new();
f = s;
p = s;
p.draw();
p.compute_area();
f.draw();
f.compute_area();
s.draw();
s.compute_area();
end
endmodule
** Error: C:/Sunil_Labs/Lab1/example2.sv(31): (vlog-60) Nested class declarations not yet supported.
////////////CODE/////////////////
class figure;
virtual function void draw();
$display("figure:draw");
endfunction
function void compute_area();
$display("figure:compute_area");
endfunction
endclass
class polygon extends figure;
virtual function void draw();
$display("polygon:draw");
endfunction
function void compute_area();
$display("polygon:compute_area");
endfunction
endclass
class square extends polygon;
virtual function void draw();
$display("square:draw");
endfunction
function void compute_area();
$display("square:compute_area");
endfunction
class square extends polygon;
virtual function void draw();
$display("square:draw");
endfunction
function void compute_area();
$display("square:compute_area");
endfunction
endclass
module top;
figure f;
polygon p;
square s;
initial begin
s = new();
f = s;
p = s;
p.draw();
p.compute_area();
f.draw();
f.compute_area();
s.draw();
s.compute_area();
end
endmodule