amitk3553 Posted February 14, 2014 Report Share Posted February 14, 2014 Where is the use of the concept of polymorphism in testbench development in UVM. Please tell me some usecases of polymorphism in testbench development. Quote Link to comment Share on other sites More sharing options...
Hany Salah Posted February 14, 2014 Report Share Posted February 14, 2014 in case you have such ubus example,,, you have different agents ,, each one is responsible to act like either master or slave ,, It isn't restricted that all agents act in the same way at the same time,, but you have to randomly configure each one to make your test more random and more effective ,, such way ,, you have different agents ,,, each one extended from uvm_agent base class ,, and each one may have the same function name ,, for instance write(),, strope () ,, read() and so on ,, Through build phase ,, you called build function through all environments in the same test bench ,, although they have the same name ,, polymorphism play its role another example through when run phase ,,, each agent may have his own run routine with the same name run () ,, but they don't act as each other ,, so polymorphism play its role here also on Other matter ,, naming function whose main purpose similar like run, is so practical as on complex tests you have high number of agents and scripts and you may get lost in routines' names amitk3553 1 Quote Link to comment Share on other sites More sharing options...
David Black Posted February 14, 2014 Report Share Posted February 14, 2014 The simplest examples of polymorphism at work are the UVM factory when you use overrides. amitk3553 1 Quote Link to comment Share on other sites More sharing options...
uwes Posted February 17, 2014 Report Share Posted February 17, 2014 hi, polymorphism is a general concept. see http://en.wikipedia.org/wiki/Polymorphism_(computer_science). the testbenches we write are essentially software. in that sense all methods to improve creation/speed/maintenance/stability/reuse of software should be in the focus for tb developers too. the concept of polymorphism is one way to improve. /uwe amitk3553 1 Quote Link to comment Share on other sites More sharing options...
quanghong Posted February 18, 2014 Report Share Posted February 18, 2014 You can use the polymorphism in UVM as following example: class driver extends uvm_driver; class my_driver extends driver; module test; .... driver dr; initial begin // polymorphism: wait until run-time to bind the object type // You can override either by type or instance. factory.set_type_override_by_type(driver::get_type(), my_driver::get_type()); // It is important to use factory before create dr = driver::type_id::create("driver", null); run_test(); end endmodule Hope it helps. Quang amitk3553 1 Quote Link to comment Share on other sites More sharing options...
nirmish Posted March 14, 2014 Report Share Posted March 14, 2014 Another Simple use case of polymorphism is callbacks.... in driver classes you call the methods [pre* , *post] which are defined in façade class. Now when you extend these façade class you provide definition to these method, once these extended callback classes are added to queue of these callback class then during execution of test case functionality of these redefined method will be called by using the handle of old class... this is possible by polymorphism... hope it helps and clear to you :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.