| <html><head><title>Factory Classes</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!-- |
| if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script> |
| |
| <!-- Generated by Natural Docs, version Development Release 01-12-2008 (1.35 base) --> |
| <!-- http://www.naturaldocs.org --> |
| |
| <!-- saved from url=(0026)http://www.naturaldocs.org --> |
| |
| |
| |
| |
| |
| |
| |
| |
| <!--TOP - START OF CONTENT--> |
| <div id=Content> |
| |
| |
| <!--CONTENT index=0 --> |
| <div class="CSection"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Factory_Classes" href="../../ovm_ref/factory.txt">Factory Classes</a></h1><div class=CBody><p>As the name implies, the <a href="../files/base/ovm_factory-svh.html#ovm_factory" class=LClass id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">ovm_factory</a> is used to manufacture (create) OVM objects and components. Only one instance of the factory is present in a given simulation.</p><p>User-defined object and component types are registered with the factory via typedef or macro invocation, as explained in <a href="../files/base/ovm_factory-svh.html#ovm_factory.Usage" class=LGroup id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">ovm_factory::Usage</a>. The factory generates and stores lightweight proxies to the user-defined objects and components: <a href="../files/base/ovm_registry-svh.html#ovm_object_registry#(T,Tname)" class=LClass id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">ovm_object_registry #(T,Tname)</a> for objects and <a href="../files/base/ovm_registry-svh.html#ovm_component_registry#(T,Tname)" class=LClass id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">ovm_component_registry #(T,Tname)</a> for components. Each proxy only knows how to create an instance of the object or component it represents, and so is very efficient in terms of memory usage.</p><p>When the user requests a new object or component from the factory (e.g. <a href="../files/base/ovm_factory-svh.html#ovm_factory.create_object_by_type" class=LMethod id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">ovm_factory::create_object_by_type</a>), the factory will determine what type of object to create based on its configuration, then ask that type’s proxy to create an instance of the type, which is returned to the user.</p><img src="nd/Images/ovm_ref_factory.gif" width="472" height="131"></div></div></div> |
| |
| </div><!--Content--> |
| |
| |
| |
| <!--START_ND_TOOLTIPS--> |
| <div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>class ovm_factory</td></tr></table></blockquote>As the name implies, ovm_factory is used to manufacture (create) OVM objects and components. </div></div><div class=CToolTip id="tt2"><div class=CGroup>Using the factory involves three basic operations</div></div><div class=CToolTip id="tt3"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>class ovm_object_registry #(</td></tr><tr><td> </td><td class=PType nowrap>type </td><td class=PParameter nowrap>T</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%>ovm_object,</td></tr><tr><td> </td><td class=PType nowrap>string </td><td class=PParameter nowrap>Tname</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%>"<unknown>"</td></tr><tr><td class=PAfterParameters colspan=5>) extends ovm_object_wrapper</td></tr></table></td></tr></table></blockquote>The ovm_object_registry serves as a lightweight proxy for an ovm_object of type <i>T</i> and type name <i>Tname</i>, a string. </div></div><div class=CToolTip id="tt4"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters colspan=5>class ovm_component_registry #(</td></tr><tr><td> </td><td class=PType nowrap>type </td><td class=PParameter nowrap>T</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%>ovm_component,</td></tr><tr><td> </td><td class=PType nowrap>string </td><td class=PParameter nowrap>Tname</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%>"<unknown>"</td></tr><tr><td class=PAfterParameters colspan=5>) extends ovm_object_wrapper</td></tr></table></td></tr></table></blockquote>The ovm_component_registry serves as a lightweight proxy for a component of type <i>T</i> and type name <i>Tname</i>, a string. </div></div><div class=CToolTip id="tt5"><div class=CMethod><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function ovm_object create_object_by_type (</td><td class=PType nowrap>ovm_object_wrapper </td><td class=PParameter nowrap>requested_type,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PType nowrap>string </td><td class=PParameter nowrap>parent_inst_path</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%>"",</td></tr><tr><td></td><td class=PType nowrap>string </td><td class=PParameter nowrap>name</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%>""</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote></div></div><!--END_ND_TOOLTIPS--> |
| |
| <script language=JavaScript><!-- |
| if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |