What is “special” about SystemVerilog’s new - constructor
During one of our recent VSV training sessions, a smart attendee asked few interesting questions about SystemVerilog’s new constructor. Questions like: 1. Is it similar to other functions in Verilog/SV? 2. Is it virtual? 3. What is the return type of the same? 4. How does inheritance work for new ? So here is a blog entry that delves into the “details”. First of all – it is a function – so it can only have non-time consuming stuff (BTW, a task can be invoked via fork..join_none from within a function). It is NOT a virtual function. It is illegal to declare it “virtual”. On the return “type” – it is different from other functions – it is very “adaptive in nature” – i.e. it returns what the LHS requires. i.e. it returns an object of the type of the handle that appears on the LHS. Hence there is NO return type declared for this special function. Things get very interesting/special when a new class is derived from a base class. With any other System Verilog function/task...