power_uvm_ifb Imported from Blogger
Nice post! Thank you for introducing me to interface classes. Somehow I missed this in the new LRM…
Nice post! Thank you for introducing me to interface classes. Somehow I missed this in the new LRM…
I found this section in the LRM interesting as well:
interface class IntfClass;
pure virtual function bit funcBase();
pure virtual function bit funcExt();
endclass
class BaseClass;
virtual function bit funcBase();
return (1);
endfunction
endclass
class ExtClass extends BaseClass implements IntfClass;
virtual function bit funcExt();
return (0);
endfunction
endclass
ExtClass fulfills its requirement to implement IntfClass by providing an implementation of funcExt
and by inheriting an implementation of funcBase from BaseClass.
This would allow you to write a library of ~implementations~ of an interface class. Then the implementation class can pull off the shelf which implementation it wants to use (or “extend” from)!
Thank you for the article. I came across one more class “process class” in SV, which is used to monitor the progress of threads generated using fork.
1 replyI wouldn’t call the ‘process’ class another type of class. It’s just a built in class, not a different class construct. Nevertheless, I’ll keep it in mind and maybe we’ll see a post on working with processes in the future.
Hi Tudor,
Thanks for reading my blog post “ASIC with Ankit: Class - The Classic Feature - Part II” and thanks for touching up on interface class. This is a nice post with useful and required information. Thanks for sharing !
Thanks,
ASIC With Ankit
Awesome post Tudor… This has great clarity on interface class…
Hi Tudor,
Nice post.
Quick question:
Can this abstract class be passed using config db from the module ?
I think you mean doing a uvm_config_db #(some_interface_class)::set(…), right? I’m pretty sure this should be possible.
Tudor,
I notice that the ‘driver’ class and ‘insurer’ class encapsulates the interface classes drivable_if and insurable interface respectively. Is this always needed? If so, could you please throw some more light as to why?
The don’t encapsulate the interfaces. They implement them.