DescriptionQ256
Q256DVDesignASIC interview problem
Downcasting
TechniquesSystemVerilogObject-oriented dispatch
DifficultyEasy
TopicSV
LanguageSystemVerilog
Format4 choices
01
Problem
What is the result of the cast?
Class declarationSystemVerilog
class B; endclass
class D extends B; int tag = 9; endclass
B b; D original, d;
initial begin
original = new;
b = original;
if ($cast(d, b)) $display("%0d", d.tag);
else $display("fail");
end02
