Working with default arguments in SystemVerilog & OVM hierarchy building
Recently Amit (Yet another successful VLSI engineer from CVC’s incubation http://www.cvcblr.com/trng_profiles/CVC_EIC_profile.pdf , asked this: In OVM/UVM ( http://www.cvcblr.com/trng_profiles/Do-it-Right-UVM.pdf ) I am little confused about the way components are hooked-up hierarchically. Consider the code below: In the above constructor ,sometimes I am writing parent =null and some times only parent ,and then passing in super.new();, blindly i am doing this ,but i am not understanding why i am making parent=null and sometime leaving this as parent . what will be the effect of making so. kindly help me. Answer/Explanation: As an enhancement to Verilog, System Verilog allows “default values” for function/task (methods) arguments. By doing so it allows the caller of these methods to have the flexibility in number of arguments – a.k.a variable arguments to a function (though not overloading as in VHDL). So in the example above, the new has 2 arguments, both ha...