blob: 90b6ca750907aaee0460e2a6a2a797ee332cf198 [file] [log] [blame]
<html><head><title>ovm_barrier</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="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="ovm_barrier" href="../../../../src/base/ovm_barrier.svh">ovm_barrier</a></h1><div class=CBody><p>The ovm_barrier class provides a multiprocess synchronization mechanism.&nbsp; It enables a set of processes to block until the desired number of processes get to the synchronization point, at which time all of the processes are released.</p>
<!--START_ND_SUMMARY index=0-->
<div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable>
<!-- index=0 -->
<tr class="SClass"><td colspan=2 class=SEntry><a href="#ovm_barrier" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">ovm_barrier</a></td></tr>
<tr class=SMain><td colspan=2 class=SWideDescription>The ovm_barrier class provides a multiprocess synchronization mechanism. </td></tr>
<tr class="SHierarchy SIndent1 "><td colspan=2 class="SEntry SIndent1">Class Hierarchy</td><tr><tr class="SPrototype SIndent1"><td colspan=2 class=SDescription><div class=ClassHierarchy>
<table border=0 cellspacing=0 cellpadding=0>
<tr><td><div class=CHParent><div class=CHEntry><a href="ovm_object-svh.html#ovm_object" class=LClass id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">ovm_object</a></div></div></td></tr>
<tr><td><div class=CHCurrent><div class=CHEntry>ovm_barrier</div></div></td></tr></table>
</div></td></tr>
<tr class="SPrototype SIndent1">
<td colspan=2 class="SEntry SIndent1">Class Declaration</td><tr><tr class="SPrototype SIndent1"><td colspan=2 class=SDescription><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>class ovm_barrier extends ovm_object</td></tr></table></blockquote></td></tr>
<!-- index=1 -->
<tr class="SGroup SIndent1"><td class=SEntry><a href="#ovm_barrier.Methods" >Methods</a></td><td class=SDescription></td></tr>
<!-- index=2 -->
<tr class="SMethod SIndent2"><td class=SEntry><a href="#ovm_barrier.new" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">new</a></td><td class=SDescription>Creates a new barrier object.</td></tr>
<!-- index=3 -->
<tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#ovm_barrier.wait_for" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">wait_for</a></td><td class=SDescription>Waits for enough processes to reach the barrier before continuing.</td></tr>
<!-- index=4 -->
<tr class="SMethod SIndent2"><td class=SEntry><a href="#ovm_barrier.reset" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">reset</a></td><td class=SDescription>Resets the barrier. </td></tr>
<!-- index=5 -->
<tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#ovm_barrier.set_auto_reset" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">set_auto_reset</a></td><td class=SDescription>Determines if the barrier should reset itself after the threshold is reached.</td></tr>
<!-- index=6 -->
<tr class="SMethod SIndent2"><td class=SEntry><a href="#ovm_barrier.set_threshold" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">set_threshold</a></td><td class=SDescription>Sets the process threshold.</td></tr>
<!-- index=7 -->
<tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#ovm_barrier.get_threshold" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">get_threshold</a></td><td class=SDescription>Gets the current threshold setting for the barrier.</td></tr>
<!-- index=8 -->
<tr class="SMethod SIndent2"><td class=SEntry><a href="#ovm_barrier.get_num_waiters" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">get_num_waiters</a></td><td class=SDescription>Returns the number of processes currently waiting at the barrier.</td></tr>
<!-- index=9 -->
<tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#ovm_barrier.cancel" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">cancel</a></td><td class=SDescription>Decrements the waiter count by one. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<!--CONTENT index=1 -->
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.Methods" href="../../../../src/base/ovm_barrier.svh">Methods</a></h3></div></div>
<!--CONTENT index=2 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.new" href="../../../../src/base/ovm_barrier.svh">new</a></h3><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 new (</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>name</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>&quot;&quot;,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>threshold</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>0</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><div class=CBody><p>Creates a new barrier object.</p></div></div></div>
<!--CONTENT index=3 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.wait_for" href="../../../../src/base/ovm_barrier.svh">wait_for</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual task wait_for()</td></tr></table></blockquote><div class=CBody><p>Waits for enough processes to reach the barrier before continuing.</p><p>The number of processes to wait for is set by the <a href="#ovm_barrier.set_threshold" class=LMethod id=link11 onMouseOver="ShowTip(event, 'tt7', 'link11')" onMouseOut="HideTip('tt7')">set_threshold</a> method.</p></div></div></div>
<!--CONTENT index=4 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.reset" href="../../../../src/base/ovm_barrier.svh">reset</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual function void reset (</td><td class=PType nowrap>bit&nbsp;</td><td class=PParameter nowrap>wakeup</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>1</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><div class=CBody><p>Resets the barrier.&nbsp; This sets the waiter count back to zero.</p><p>The threshold is unchanged.&nbsp; After reset, the barrier will force processes to wait for the threshold again.</p><p>If the <i>wakeup</i> bit is set, any currently waiting processes will be activated.</p></div></div></div>
<!--CONTENT index=5 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.set_auto_reset" href="../../../../src/base/ovm_barrier.svh">set_auto_reset</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual function void set_auto_reset (</td><td class=PType nowrap>bit&nbsp;</td><td class=PParameter nowrap>value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>1</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><div class=CBody><p>Determines if the barrier should reset itself after the threshold is reached.</p><p>The default is on, so when a barrier hits its threshold it will reset, and new processes will block until the threshold is reached again.</p><p>If auto reset is off, then once the threshold is achieved, new processes pass through without being blocked until the barrier is reset.</p></div></div></div>
<!--CONTENT index=6 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.set_threshold" href="../../../../src/base/ovm_barrier.svh">set_threshold</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>virtual function void set_threshold (</td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>threshold</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><div class=CBody><p>Sets the process threshold.</p><p>This determines how many processes must be waiting on the barrier before the processes may proceed.</p><p>Once the <i>threshold</i> is reached, all waiting processes are activated.</p><p>If <i>threshold</i> is set to a value less than the number of currently waiting processes, then the barrier is reset and waiting processes are activated.</p></div></div></div>
<!--CONTENT index=7 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.get_threshold" href="../../../../src/base/ovm_barrier.svh">get_threshold</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function int get_threshold ()</td></tr></table></blockquote><div class=CBody><p>Gets the current threshold setting for the barrier.</p></div></div></div>
<!--CONTENT index=8 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.get_num_waiters" href="../../../../src/base/ovm_barrier.svh">get_num_waiters</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function int get_num_waiters ()</td></tr></table></blockquote><div class=CBody><p>Returns the number of processes currently waiting at the barrier.</p></div></div></div>
<!--CONTENT index=9 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="ovm_barrier.cancel" href="../../../../src/base/ovm_barrier.svh">cancel</a></h3><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function void cancel ()</td></tr></table></blockquote><div class=CBody><p>Decrements the waiter count by one.&nbsp; This is used when a process that is waiting on the barrier is killed or activated by some other means.</p></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>virtual class ovm_object extends ovm_void</td></tr></table></blockquote>The ovm_object class is the base class for all OVM data and hierarchical classes. </div></div><div class=CToolTip id="tt2"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>class ovm_barrier extends ovm_object</td></tr></table></blockquote>The ovm_barrier class provides a multiprocess synchronization mechanism. </div></div><div class=CToolTip id="tt3"><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 new (</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>name</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>&quot;&quot;,</td></tr><tr><td></td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>threshold</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>0</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a new barrier object.</div></div><div class=CToolTip id="tt4"><div class=CMethod><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual task wait_for()</td></tr></table></blockquote>Waits for enough processes to reach the barrier before continuing.</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>virtual function void reset (</td><td class=PType nowrap>bit&nbsp;</td><td class=PParameter nowrap>wakeup</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>1</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Resets the barrier. </div></div><div class=CToolTip id="tt6"><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>virtual function void set_auto_reset (</td><td class=PType nowrap>bit&nbsp;</td><td class=PParameter nowrap>value</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>1</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Determines if the barrier should reset itself after the threshold is reached.</div></div><div class=CToolTip id="tt7"><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>virtual function void set_threshold (</td><td class=PType nowrap>int&nbsp;</td><td class=PParameter nowrap>threshold</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the process threshold.</div></div><div class=CToolTip id="tt8"><div class=CMethod><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function int get_threshold ()</td></tr></table></blockquote>Gets the current threshold setting for the barrier.</div></div><div class=CToolTip id="tt9"><div class=CMethod><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function int get_num_waiters ()</td></tr></table></blockquote>Returns the number of processes currently waiting at the barrier.</div></div><div class=CToolTip id="tt10"><div class=CMethod><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function void cancel ()</td></tr></table></blockquote>Decrements the waiter count by one. </div></div><!--END_ND_TOOLTIPS-->
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>