1 |
4 |
vladimirar |
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
|
2 |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
4 |
|
|
<head>
|
5 |
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
6 |
|
|
<title>SyoSil ApS UVM Scoreboard: cl_syoscb_queue_std.svh Source File</title>
|
7 |
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
8 |
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
9 |
|
|
<script type="text/javaScript" src="search/search.js"></script>
|
10 |
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
11 |
|
|
</head>
|
12 |
|
|
<body onload='searchBox.OnSelectItem(0);'>
|
13 |
|
|
<!-- Generated by Doxygen 1.6.1 -->
|
14 |
|
|
<script type="text/javascript"><!--
|
15 |
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
16 |
|
|
--></script>
|
17 |
|
|
<script type="text/javascript">
|
18 |
|
|
<!--
|
19 |
|
|
function changeDisplayState (e){
|
20 |
|
|
var num=this.id.replace(/[^[0-9]/g,'');
|
21 |
|
|
var button=this.firstChild;
|
22 |
|
|
var sectionDiv=document.getElementById('dynsection'+num);
|
23 |
|
|
if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
|
24 |
|
|
sectionDiv.style.display='block';
|
25 |
|
|
button.src='open.gif';
|
26 |
|
|
}else{
|
27 |
|
|
sectionDiv.style.display='none';
|
28 |
|
|
button.src='closed.gif';
|
29 |
|
|
}
|
30 |
|
|
}
|
31 |
|
|
function initDynSections(){
|
32 |
|
|
var divs=document.getElementsByTagName('div');
|
33 |
|
|
var sectionCounter=1;
|
34 |
|
|
for(var i=0;i<divs.length-1;i++){
|
35 |
|
|
if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
|
36 |
|
|
var header=divs[i];
|
37 |
|
|
var section=divs[i+1];
|
38 |
|
|
var button=header.firstChild;
|
39 |
|
|
if (button!='IMG'){
|
40 |
|
|
divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
|
41 |
|
|
button=document.createElement('img');
|
42 |
|
|
divs[i].insertBefore(button,divs[i].firstChild);
|
43 |
|
|
}
|
44 |
|
|
header.style.cursor='pointer';
|
45 |
|
|
header.onclick=changeDisplayState;
|
46 |
|
|
header.id='dynheader'+sectionCounter;
|
47 |
|
|
button.src='closed.gif';
|
48 |
|
|
section.id='dynsection'+sectionCounter;
|
49 |
|
|
section.style.display='none';
|
50 |
|
|
section.style.marginLeft='14px';
|
51 |
|
|
sectionCounter++;
|
52 |
|
|
}
|
53 |
|
|
}
|
54 |
|
|
}
|
55 |
|
|
window.onload = initDynSections;
|
56 |
|
|
-->
|
57 |
|
|
</script>
|
58 |
|
|
<div class="navigation" id="top">
|
59 |
|
|
<div class="tabs">
|
60 |
|
|
<ul>
|
61 |
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
62 |
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
63 |
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
64 |
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
65 |
|
|
<li><a href="dirs.html"><span>Directories</span></a></li>
|
66 |
|
|
<li>
|
67 |
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
68 |
|
|
<img id="MSearchSelect" src="search/search.png"
|
69 |
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
70 |
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
71 |
|
|
alt=""/>
|
72 |
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
73 |
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
74 |
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
75 |
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
76 |
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
77 |
|
|
</div>
|
78 |
|
|
</li>
|
79 |
|
|
</ul>
|
80 |
|
|
</div>
|
81 |
|
|
<div class="tabs">
|
82 |
|
|
<ul>
|
83 |
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
84 |
|
|
</ul>
|
85 |
|
|
</div>
|
86 |
|
|
<div class="navpath"><a class="el" href="dir_562324e130495ce1321e3e3f14c8d761.html">src</a>
|
87 |
|
|
</div>
|
88 |
|
|
</div>
|
89 |
|
|
<div class="contents">
|
90 |
|
|
<h1>cl_syoscb_queue_std.svh</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/// Standard implementation of a queue. Uses a normal SystemVerilog queue as</span>
|
91 |
|
|
<a name="l00002"></a>00002 <span class="comment"></span><span class="comment">/// implementation. The class implements the queue API as defined by the queue</span>
|
92 |
|
|
<a name="l00003"></a>00003 <span class="comment"></span><span class="comment">/// base class.</span>
|
93 |
|
|
<a name="l00004"></a><a class="code" href="classcl__syoscb__queue__std.html">00004</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classcl__syoscb__queue__std.html" title="Standard implementation of a queue.">cl_syoscb_queue_std</a> <span class="keyword">extends</span> <a class="code" href="classcl__syoscb__queue.html" title="Class which base concet of a queue.">cl_syoscb_queue</a>;
|
94 |
|
|
<a name="l00005"></a>00005 <span class="comment">//-------------------------------------</span>
|
95 |
|
|
<a name="l00006"></a>00006 <span class="comment">// Non randomizable variables</span>
|
96 |
|
|
<a name="l00007"></a>00007 <span class="comment">//-------------------------------------</span><span class="comment"></span>
|
97 |
|
|
<a name="l00008"></a>00008 <span class="comment"> /// Poor mans queue implementation as a SV queue</span>
|
98 |
|
|
<a name="l00009"></a>00009 <span class="comment"></span> local <a class="code" href="classcl__syoscb__item.html" title="The UVM scoreboard item.">cl_syoscb_item</a> items[$];
|
99 |
|
|
<a name="l00010"></a>00010
|
100 |
|
|
<a name="l00011"></a>00011 <span class="comment">//-------------------------------------</span>
|
101 |
|
|
<a name="l00012"></a>00012 <span class="comment">// UVM Macros</span>
|
102 |
|
|
<a name="l00013"></a>00013 <span class="comment">//-------------------------------------</span>
|
103 |
|
|
<a name="l00014"></a>00014 `uvm_component_utils_begin(cl_syoscb_queue_std)
|
104 |
|
|
<a name="l00015"></a>00015 `uvm_field_queue_object(items, UVM_DEFAULT)
|
105 |
|
|
<a name="l00016"></a>00016 `uvm_component_utils_end
|
106 |
|
|
<a name="l00017"></a>00017
|
107 |
|
|
<a name="l00018"></a>00018 <span class="comment">//-------------------------------------</span>
|
108 |
|
|
<a name="l00019"></a>00019 <span class="comment">// Constructor</span>
|
109 |
|
|
<a name="l00020"></a>00020 <span class="comment">//-------------------------------------</span>
|
110 |
|
|
<a name="l00021"></a>00021 extern function new(string name, uvm_component parent);
|
111 |
|
|
<a name="l00022"></a>00022
|
112 |
|
|
<a name="l00023"></a>00023 <span class="comment">//-------------------------------------</span>
|
113 |
|
|
<a name="l00024"></a>00024 <span class="comment">// Queue API</span>
|
114 |
|
|
<a name="l00025"></a>00025 <span class="comment">//-------------------------------------</span>
|
115 |
|
|
<a name="l00026"></a>00026 <span class="comment">// Basic queue functions</span>
|
116 |
|
|
<a name="l00027"></a>00027 extern <span class="keyword">virtual</span> function bit <a class="code" href="classcl__syoscb__queue__std.html#a68f61e7f53901acb3cc50a9001193c0f" title="Queue API: See cl_syoscb_queue for more details">add_item</a>(string producer, uvm_sequence_item item);
|
117 |
|
|
<a name="l00028"></a>00028 extern <span class="keyword">virtual</span> function bit <a class="code" href="classcl__syoscb__queue__std.html#a9cae04fa7b9a40a5554ef24bfaac851b" title="Queue API: See cl_syoscb_queue for more details">delete_item</a>(int unsigned idx);
|
118 |
|
|
<a name="l00029"></a>00029 extern <span class="keyword">virtual</span> function <a class="code" href="classcl__syoscb__item.html" title="The UVM scoreboard item.">cl_syoscb_item</a> <a class="code" href="classcl__syoscb__queue__std.html#a42efb916d933e56e9865919504054499" title="Queue API: See cl_syoscb_queue for more details">get_item</a>(int unsigned idx);
|
119 |
|
|
<a name="l00030"></a>00030 extern <span class="keyword">virtual</span> function int unsigned <a class="code" href="classcl__syoscb__queue__std.html#ac91a26574353c8c24789a993d3ffc12d" title="Queue API: See cl_syoscb_queue for more details">get_size</a>();
|
120 |
|
|
<a name="l00031"></a>00031 extern <span class="keyword">virtual</span> function bit <a class="code" href="classcl__syoscb__queue__std.html#a812d7f4d7143c9bef1f3181e24347d5c" title="Queue API: See cl_syoscb_queue for more details">empty</a>();
|
121 |
|
|
<a name="l00032"></a>00032 extern <span class="keyword">virtual</span> function bit <a class="code" href="classcl__syoscb__queue__std.html#ad293b78071120f596e3884980e36a9fa" title="Queue API: See cl_syoscb_queue for more details">insert_item</a>(string producer, uvm_sequence_item item, int unsigned idx);
|
122 |
|
|
<a name="l00033"></a>00033
|
123 |
|
|
<a name="l00034"></a>00034 <span class="comment">// Iterator support functions</span>
|
124 |
|
|
<a name="l00035"></a>00035 extern <span class="keyword">virtual</span> function <a class="code" href="classcl__syoscb__queue__iterator__base.html" title="Queue iterator base class defining the iterator API used for iterating queues.">cl_syoscb_queue_iterator_base</a> <a class="code" href="classcl__syoscb__queue__std.html#a84149180e88153757ac3df08fe6dd3ce" title="Queue API: See cl_syoscb_queue for more details">create_iterator</a>();
|
125 |
|
|
<a name="l00036"></a>00036 extern <span class="keyword">virtual</span> function bit <a class="code" href="classcl__syoscb__queue__std.html#ada80798fcd391e309e0e85f68cda98e1" title="Queue API: See cl_syoscb_queue for more details">delete_iterator</a>(cl_syoscb_queue_iterator_base iterator);
|
126 |
|
|
<a name="l00037"></a>00037 endclass: <a class="code" href="classcl__syoscb__queue__std.html" title="Standard implementation of a queue.">cl_syoscb_queue_std</a>
|
127 |
|
|
<a name="l00038"></a>00038
|
128 |
|
|
<a name="l00039"></a>00039 function <a class="code" href="classcl__syoscb__queue__std.html" title="Standard implementation of a queue.">cl_syoscb_queue_std</a>::new(string name, uvm_component parent);
|
129 |
|
|
<a name="l00040"></a>00040 super.new(name, parent);
|
130 |
|
|
<a name="l00041"></a>00041 endfunction: new
|
131 |
|
|
<a name="l00042"></a>00042 <span class="comment"></span>
|
132 |
|
|
<a name="l00043"></a>00043 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
133 |
|
|
<a name="l00044"></a><a class="code" href="classcl__syoscb__queue__std.html#a68f61e7f53901acb3cc50a9001193c0f">00044</a> <span class="comment"></span>function bit <a class="code" href="classcl__syoscb__queue__std.html" title="Standard implementation of a queue.">cl_syoscb_queue_std</a>::<a class="code" href="classcl__syoscb__queue__std.html#a68f61e7f53901acb3cc50a9001193c0f" title="Queue API: See cl_syoscb_queue for more details">add_item</a>(string producer, uvm_sequence_item item);
|
134 |
|
|
<a name="l00045"></a>00045 <a class="code" href="classcl__syoscb__item.html" title="The UVM scoreboard item.">cl_syoscb_item</a> new_item;
|
135 |
|
|
<a name="l00046"></a>00046
|
136 |
|
|
<a name="l00047"></a>00047 <span class="comment">// Check that the max_queue_size for this queue is not reached</span>
|
137 |
|
|
<a name="l00048"></a>00048 if(this.cfg.get_max_queue_size(this.get_name())>0 &&
|
138 |
|
|
<a name="l00049"></a>00049 this.<a class="code" href="classcl__syoscb__queue__std.html#ac91a26574353c8c24789a993d3ffc12d" title="Queue API: See cl_syoscb_queue for more details">get_size</a>()==this.<a class="code" href="classcl__syoscb__queue.html#ab92efb1fb67ec7cc8dfe928a474a3e2b" title="Handle to the configuration.">cfg</a>.get_max_queue_size(this.get_name())) begin
|
139 |
|
|
<a name="l00050"></a>00050 `uvm_error("QUEUE_ERROR", $sformatf("[%s]: Maximum number of items (%0d) for queue: %s reached",
|
140 |
|
|
<a name="l00051"></a>00051 this.cfg.get_scb_name(),
|
141 |
|
|
<a name="l00052"></a>00052 this.cfg.get_max_queue_size(this.get_name()),
|
142 |
|
|
<a name="l00053"></a>00053 this.get_name()))
|
143 |
|
|
<a name="l00054"></a>00054 return(1'b0);
|
144 |
|
|
<a name="l00055"></a>00055 end
|
145 |
|
|
<a name="l00056"></a>00056
|
146 |
|
|
<a name="l00057"></a>00057 <span class="comment">// Create the new scoreboard item with META data which wraps the</span>
|
147 |
|
|
<a name="l00058"></a>00058 <span class="comment">// uvm_sequence_item</span>
|
148 |
|
|
<a name="l00059"></a>00059 <span class="comment">//</span>
|
149 |
|
|
<a name="l00060"></a>00060 <span class="comment">// *NOTE*: No need for using create.</span>
|
150 |
|
|
<a name="l00061"></a>00061 <span class="comment">// New is okay since no customization is needed here</span>
|
151 |
|
|
<a name="l00062"></a>00062 <span class="comment">//</span>
|
152 |
|
|
<a name="l00063"></a>00063 <span class="comment">// *NOTE*: Create it once with a default name to be able to retrieve the unique</span>
|
153 |
|
|
<a name="l00064"></a>00064 <span class="comment">// instance id and then rename the object with a uniqueue name</span>
|
154 |
|
|
<a name="l00065"></a>00065 new_item = new(.name("default-item"));
|
155 |
|
|
<a name="l00066"></a>00066 new_item.set_name({producer,"-item-", $psprintf("%0d", new_item.get_inst_id())});
|
156 |
|
|
<a name="l00067"></a>00067
|
157 |
|
|
<a name="l00068"></a>00068 <span class="comment">// Transfer the producer to the item</span>
|
158 |
|
|
<a name="l00069"></a>00069 <span class="comment">// *NOTE*: No need to check the producer since this is checked by the parent component</span>
|
159 |
|
|
<a name="l00070"></a>00070 new_item.set_producer(.producer(producer));
|
160 |
|
|
<a name="l00071"></a>00071
|
161 |
|
|
<a name="l00072"></a>00072 <span class="comment">// Transfer the UVM sequence item to the item</span>
|
162 |
|
|
<a name="l00073"></a>00073 <span class="comment">// *NOTE*: No need to copy it since it has been copied by the parent</span>
|
163 |
|
|
<a name="l00074"></a>00074 new_item.set_item(.item(item));
|
164 |
|
|
<a name="l00075"></a>00075
|
165 |
|
|
<a name="l00076"></a>00076 <span class="comment">// Insert the item in the queue</span>
|
166 |
|
|
<a name="l00077"></a>00077 this.items.push_back(new_item);
|
167 |
|
|
<a name="l00078"></a>00078
|
168 |
|
|
<a name="l00079"></a>00079 <span class="comment">// Count the number of inserts</span>
|
169 |
|
|
<a name="l00080"></a>00080 this.cnt_add_item++;
|
170 |
|
|
<a name="l00081"></a>00081
|
171 |
|
|
<a name="l00082"></a>00082 <span class="comment">// Signal that it worked</span>
|
172 |
|
|
<a name="l00083"></a>00083 return 1;
|
173 |
|
|
<a name="l00084"></a>00084 endfunction: <a class="code" href="classcl__syoscb__queue__std.html#a68f61e7f53901acb3cc50a9001193c0f" title="Queue API: See cl_syoscb_queue for more details">add_item</a>
|
174 |
|
|
<a name="l00085"></a>00085 <span class="comment"></span>
|
175 |
|
|
<a name="l00086"></a>00086 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
176 |
|
|
<a name="l00087"></a><a class="code" href="classcl__syoscb__queue__std.html#a9cae04fa7b9a40a5554ef24bfaac851b">00087</a> <span class="comment"></span>function bit <a class="code" href="classcl__syoscb__queue__std.html" title="Standard implementation of a queue.">cl_syoscb_queue_std</a>::<a class="code" href="classcl__syoscb__queue__std.html#a9cae04fa7b9a40a5554ef24bfaac851b" title="Queue API: See cl_syoscb_queue for more details">delete_item</a>(int unsigned idx);
|
177 |
|
|
<a name="l00088"></a>00088 if(idx < this.items.size()) begin
|
178 |
|
|
<a name="l00089"></a>00089 cl_syoscb_queue_iterator_base iter[$];
|
179 |
|
|
<a name="l00090"></a>00090
|
180 |
|
|
<a name="l00091"></a>00091 <span class="comment">// Wait to get exclusive access to the queue</span>
|
181 |
|
|
<a name="l00092"></a>00092 <span class="comment">// if there are multiple iterators</span>
|
182 |
|
|
<a name="l00093"></a>00093 while(!this.iter_sem.try_get());
|
183 |
|
|
<a name="l00094"></a>00094 items.delete(idx);
|
184 |
|
|
<a name="l00095"></a>00095
|
185 |
|
|
<a name="l00096"></a>00096 <span class="comment">// Update iterators</span>
|
186 |
|
|
<a name="l00097"></a>00097 iter = this.iterators.find(x) with (x.get_idx() < idx);
|
187 |
|
|
<a name="l00098"></a>00098 for(int i = 0; i < iter.size(); i++) begin
|
188 |
|
|
<a name="l00099"></a>00099 void'(iter[i].previous());
|
189 |
|
|
<a name="l00100"></a>00100 end
|
190 |
|
|
<a name="l00101"></a>00101
|
191 |
|
|
<a name="l00102"></a>00102 this.iter_sem.put();
|
192 |
|
|
<a name="l00103"></a>00103 return 1;
|
193 |
|
|
<a name="l00104"></a>00104 end else begin
|
194 |
|
|
<a name="l00105"></a>00105 `uvm_info("OUT_OF_BOUNDS", $sformatf("[%s]: Idx: %0d is not present in queue: %0s", this.cfg.get_scb_name(), idx, this.get_name()), UVM_DEBUG);
|
195 |
|
|
<a name="l00106"></a>00106 return 0;
|
196 |
|
|
<a name="l00107"></a>00107 end
|
197 |
|
|
<a name="l00108"></a>00108 endfunction: delete_item
|
198 |
|
|
<a name="l00109"></a>00109 <span class="comment"></span>
|
199 |
|
|
<a name="l00110"></a>00110 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
200 |
|
|
<a name="l00111"></a><a class="code" href="classcl__syoscb__queue__std.html#a42efb916d933e56e9865919504054499">00111</a> <span class="comment"></span>function cl_syoscb_item cl_syoscb_queue_std::get_item(int unsigned idx);
|
201 |
|
|
<a name="l00112"></a>00112 if(idx < this.items.size()) begin
|
202 |
|
|
<a name="l00113"></a>00113 return items[idx];
|
203 |
|
|
<a name="l00114"></a>00114 end else begin
|
204 |
|
|
<a name="l00115"></a>00115 `uvm_info("OUT_OF_BOUNDS", $sformatf("[%s]: Idx: %0d is not present in queue: %0s", this.cfg.get_scb_name(), idx, this.get_name()), UVM_DEBUG);
|
205 |
|
|
<a name="l00116"></a>00116 return null;
|
206 |
|
|
<a name="l00117"></a>00117 end
|
207 |
|
|
<a name="l00118"></a>00118 endfunction: get_item
|
208 |
|
|
<a name="l00119"></a>00119 <span class="comment"></span>
|
209 |
|
|
<a name="l00120"></a>00120 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
210 |
|
|
<a name="l00121"></a><a class="code" href="classcl__syoscb__queue__std.html#ac91a26574353c8c24789a993d3ffc12d">00121</a> <span class="comment"></span>function int unsigned cl_syoscb_queue_std::get_size();
|
211 |
|
|
<a name="l00122"></a>00122 return this.items.size();
|
212 |
|
|
<a name="l00123"></a>00123 endfunction: get_size
|
213 |
|
|
<a name="l00124"></a>00124 <span class="comment"></span>
|
214 |
|
|
<a name="l00125"></a>00125 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
215 |
|
|
<a name="l00126"></a><a class="code" href="classcl__syoscb__queue__std.html#a812d7f4d7143c9bef1f3181e24347d5c">00126</a> <span class="comment"></span>function bit cl_syoscb_queue_std::empty();
|
216 |
|
|
<a name="l00127"></a>00127 return(this.get_size()!=0 ? 0 : 1);
|
217 |
|
|
<a name="l00128"></a>00128 endfunction
|
218 |
|
|
<a name="l00129"></a>00129 <span class="comment"></span>
|
219 |
|
|
<a name="l00130"></a>00130 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
220 |
|
|
<a name="l00131"></a><a class="code" href="classcl__syoscb__queue__std.html#ad293b78071120f596e3884980e36a9fa">00131</a> <span class="comment"></span>function bit cl_syoscb_queue_std::insert_item(string producer, uvm_sequence_item item, int unsigned idx);
|
221 |
|
|
<a name="l00132"></a>00132 cl_syoscb_item new_item;
|
222 |
|
|
<a name="l00133"></a>00133
|
223 |
|
|
<a name="l00134"></a>00134 <span class="comment">// Create the new scoreboard item with META data which wraps the</span>
|
224 |
|
|
<a name="l00135"></a>00135 <span class="comment">// uvm_sequence_item</span>
|
225 |
|
|
<a name="l00136"></a>00136 <span class="comment">//</span>
|
226 |
|
|
<a name="l00137"></a>00137 <span class="comment">// *NOTE*: No need for using create.</span>
|
227 |
|
|
<a name="l00138"></a>00138 <span class="comment">// New is okay since no customization is needed here</span>
|
228 |
|
|
<a name="l00139"></a>00139 <span class="comment">//</span>
|
229 |
|
|
<a name="l00140"></a>00140 <span class="comment">// *NOTE*: Create it once with a default name to be able to retrieve the unique</span>
|
230 |
|
|
<a name="l00141"></a>00141 <span class="comment">// instance id and then rename the object with a uniqueue name</span>
|
231 |
|
|
<a name="l00142"></a>00142 new_item = new(.name("default-item"));
|
232 |
|
|
<a name="l00143"></a>00143 new_item.set_name({producer,"-item-", $psprintf("%0d", new_item.get_inst_id())});
|
233 |
|
|
<a name="l00144"></a>00144
|
234 |
|
|
<a name="l00145"></a>00145 <span class="comment">// Transfer the producer to the item</span>
|
235 |
|
|
<a name="l00146"></a>00146 <span class="comment">// *NOTE*: No need to check the producer since this is checked by the parent component</span>
|
236 |
|
|
<a name="l00147"></a>00147 new_item.set_producer(.producer(producer));
|
237 |
|
|
<a name="l00148"></a>00148
|
238 |
|
|
<a name="l00149"></a>00149 <span class="comment">// Transfer the UVM sequence item to the item</span>
|
239 |
|
|
<a name="l00150"></a>00150 <span class="comment">// *NOTE*: No need to copy it since it has been copied by the parent</span>
|
240 |
|
|
<a name="l00151"></a>00151 new_item.set_item(.item(item));
|
241 |
|
|
<a name="l00152"></a>00152
|
242 |
|
|
<a name="l00153"></a>00153 if(idx < this.items.size()) begin
|
243 |
|
|
<a name="l00154"></a>00154 cl_syoscb_queue_iterator_base iter[$];
|
244 |
|
|
<a name="l00155"></a>00155
|
245 |
|
|
<a name="l00156"></a>00156 <span class="comment">// Wait to get exclusive access to the queue</span>
|
246 |
|
|
<a name="l00157"></a>00157 <span class="comment">// if there are multiple iterators</span>
|
247 |
|
|
<a name="l00158"></a>00158 while(!this.iter_sem.try_get());
|
248 |
|
|
<a name="l00159"></a>00159 this.items.insert(idx, new_item);
|
249 |
|
|
<a name="l00160"></a>00160
|
250 |
|
|
<a name="l00161"></a>00161 <span class="comment">// Update iterators</span>
|
251 |
|
|
<a name="l00162"></a>00162 iter = this.iterators.find(x) with (x.get_idx() >= idx);
|
252 |
|
|
<a name="l00163"></a>00163 for(int i = 0; i < iter.size(); i++) begin
|
253 |
|
|
<a name="l00164"></a>00164 <span class="comment">// Call .next() blindly. This can never fail by design, since</span>
|
254 |
|
|
<a name="l00165"></a>00165 <span class="comment">// if it was point at the last element then it points to the second last</span>
|
255 |
|
|
<a name="l00166"></a>00166 <span class="comment">// element prior to the .next(). The .next() call will then just</span>
|
256 |
|
|
<a name="l00167"></a>00167 <span class="comment">// set the iterator to the correct index again after the insertion</span>
|
257 |
|
|
<a name="l00168"></a>00168 void'(iter[i].next());
|
258 |
|
|
<a name="l00169"></a>00169 end
|
259 |
|
|
<a name="l00170"></a>00170
|
260 |
|
|
<a name="l00171"></a>00171 this.iter_sem.put();
|
261 |
|
|
<a name="l00172"></a>00172 return 1;
|
262 |
|
|
<a name="l00173"></a>00173 end else if(idx == this.items.size()) begin
|
263 |
|
|
<a name="l00174"></a>00174 this.items.push_back(new_item);
|
264 |
|
|
<a name="l00175"></a>00175 return 1;
|
265 |
|
|
<a name="l00176"></a>00176 end else begin
|
266 |
|
|
<a name="l00177"></a>00177 `uvm_info("OUT_OF_BOUNDS", $sformatf("[%s]: Idx: %0d too large for queue %0s", this.cfg.get_scb_name(), idx, this.get_name()), UVM_DEBUG);
|
267 |
|
|
<a name="l00178"></a>00178 return 0;
|
268 |
|
|
<a name="l00179"></a>00179 end
|
269 |
|
|
<a name="l00180"></a>00180 endfunction: insert_item
|
270 |
|
|
<a name="l00181"></a>00181
|
271 |
|
|
<a name="l00182"></a>00182 <span class="comment"></span>
|
272 |
|
|
<a name="l00183"></a>00183 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
273 |
|
|
<a name="l00184"></a><a class="code" href="classcl__syoscb__queue__std.html#a84149180e88153757ac3df08fe6dd3ce">00184</a> <span class="comment"></span>function cl_syoscb_queue_iterator_base cl_syoscb_queue_std::create_iterator();
|
274 |
|
|
<a name="l00185"></a>00185 cl_syoscb_queue_iterator_std result;
|
275 |
|
|
<a name="l00186"></a>00186
|
276 |
|
|
<a name="l00187"></a>00187 <span class="comment">// Wait to get exclusive access to the queue</span>
|
277 |
|
|
<a name="l00188"></a>00188 <span class="comment">// if there are multiple iterators</span>
|
278 |
|
|
<a name="l00189"></a>00189 while(this.iter_sem.try_get() == 0);
|
279 |
|
|
<a name="l00190"></a>00190
|
280 |
|
|
<a name="l00191"></a>00191 result = cl_syoscb_queue_iterator_std::type_id::create(
|
281 |
|
|
<a name="l00192"></a>00192 $sformatf("%s_iter%0d", this.get_name(), this.iter_idx));
|
282 |
|
|
<a name="l00193"></a>00193
|
283 |
|
|
<a name="l00194"></a>00194 <span class="comment">// No need to check return value since set_queue will issue</span>
|
284 |
|
|
<a name="l00195"></a>00195 <span class="comment">// and `uvm_error of something goes wrong</span>
|
285 |
|
|
<a name="l00196"></a>00196 void'(result.set_queue(this));
|
286 |
|
|
<a name="l00197"></a>00197
|
287 |
|
|
<a name="l00198"></a>00198 this.iterators[result] = result;
|
288 |
|
|
<a name="l00199"></a>00199 this.iter_idx++;
|
289 |
|
|
<a name="l00200"></a>00200 this.iter_sem.put();
|
290 |
|
|
<a name="l00201"></a>00201
|
291 |
|
|
<a name="l00202"></a>00202 return result;
|
292 |
|
|
<a name="l00203"></a>00203 endfunction: create_iterator
|
293 |
|
|
<a name="l00204"></a>00204 <span class="comment"></span>
|
294 |
|
|
<a name="l00205"></a>00205 <span class="comment">/// <b>Queue API:</b> See cl_syoscb_queue for more details</span>
|
295 |
|
|
<a name="l00206"></a><a class="code" href="classcl__syoscb__queue__std.html#ada80798fcd391e309e0e85f68cda98e1">00206</a> <span class="comment"></span>function bit cl_syoscb_queue_std::delete_iterator(cl_syoscb_queue_iterator_base iterator);
|
296 |
|
|
<a name="l00207"></a>00207 if(iterator == null) begin
|
297 |
|
|
<a name="l00208"></a>00208 `uvm_info("NULL", $sformatf("[%s]: Asked to delete null iterator from list of iterators in %s",
|
298 |
|
|
<a name="l00209"></a>00209 this.cfg.get_scb_name(), this.get_name()), UVM_DEBUG);
|
299 |
|
|
<a name="l00210"></a>00210 return 0;
|
300 |
|
|
<a name="l00211"></a>00211 end else begin
|
301 |
|
|
<a name="l00212"></a>00212 <span class="comment">// Wait to get exclusive access to the queue</span>
|
302 |
|
|
<a name="l00213"></a>00213 <span class="comment">// if there are multiple iterators</span>
|
303 |
|
|
<a name="l00214"></a>00214 while(!this.iter_sem.try_get());
|
304 |
|
|
<a name="l00215"></a>00215
|
305 |
|
|
<a name="l00216"></a>00216 this.iterators.delete(iterator);
|
306 |
|
|
<a name="l00217"></a>00217 this.iter_idx--;
|
307 |
|
|
<a name="l00218"></a>00218 this.iter_sem.put();
|
308 |
|
|
<a name="l00219"></a>00219 return 1;
|
309 |
|
|
<a name="l00220"></a>00220 end
|
310 |
|
|
<a name="l00221"></a>00221 endfunction: delete_iterator
|
311 |
|
|
</pre></div></div>
|
312 |
|
|
<!--- window showing the filter options -->
|
313 |
|
|
<div id="MSearchSelectWindow"
|
314 |
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
315 |
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
316 |
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
317 |
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a></div>
|
318 |
|
|
|
319 |
|
|
<!-- iframe showing the search results (closed by default) -->
|
320 |
|
|
<div id="MSearchResultsWindow">
|
321 |
|
|
<iframe src="" frameborder="0"
|
322 |
|
|
name="MSearchResults" id="MSearchResults">
|
323 |
|
|
</iframe>
|
324 |
|
|
</div>
|
325 |
|
|
|
326 |
|
|
<!--*************************************************************************-->
|
327 |
|
|
<!-- $Id: idv_dox_footer.html 136 2010-05-31 19:13:27Z seanoboyle $ -->
|
328 |
|
|
<!--*************************************************************************-->
|
329 |
|
|
<!-- This program is free software: you can redistribute it and/or modify -->
|
330 |
|
|
<!-- it under the terms of the GNU General Public License as published by -->
|
331 |
|
|
<!-- the Free Software Foundation, either version 3 of the License, or -->
|
332 |
|
|
<!-- (at your option) any later version. -->
|
333 |
|
|
<!-- -->
|
334 |
|
|
<!-- This program is distributed in the hope that it will be useful, -->
|
335 |
|
|
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
|
336 |
|
|
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
|
337 |
|
|
<!-- GNU General Public License for more details. -->
|
338 |
|
|
<!-- -->
|
339 |
|
|
<!-- You should have received a copy of the GNU General Public License -->
|
340 |
|
|
<!-- along with this program. If not, see http://www.gnu.org/licenses/. -->
|
341 |
|
|
<!-- -->
|
342 |
|
|
<!--*************************************************************************-->
|
343 |
|
|
<!-- Title: IDV Doxygen Footer File -->
|
344 |
|
|
<!-- Description: This file is a doxygen footer with the IDV logo and a -->
|
345 |
|
|
<!-- and a reference to the GNU FDL License. -->
|
346 |
|
|
<!-- -->
|
347 |
|
|
<!-- Original Author: Sean O'Boyle -->
|
348 |
|
|
<!-- Contact: seanoboyle@intelligentdv.com -->
|
349 |
|
|
<!-- Company: Intelligent Design Verification -->
|
350 |
|
|
<!-- Company URL: http://intelligentdv.com -->
|
351 |
|
|
<!-- -->
|
352 |
|
|
<!-- Download the most recent version here: -->
|
353 |
|
|
<!-- http://intelligentdv.com/downloads -->
|
354 |
|
|
<!-- -->
|
355 |
|
|
<!-- File Bugs Here: http://bugs.intelligentdv.com -->
|
356 |
|
|
<!-- Project: DoxygenFilterSV -->
|
357 |
|
|
<!-- -->
|
358 |
|
|
<!-- File: idv_dox_header.xml -->
|
359 |
|
|
<!-- $LastChangedBy: seanoboyle $ -->
|
360 |
|
|
<!-- $LastChangedDate: 2010-05-31 12:13:27 -0700 (Mon, 31 May 2010) $ -->
|
361 |
|
|
<!-- $LastChangedRevision: 136 $ -->
|
362 |
|
|
<!-- -->
|
363 |
|
|
<!--*************************************************************************-->
|
364 |
|
|
|
365 |
|
|
<br>
|
366 |
|
|
<table border="1" width = "100%">
|
367 |
|
|
<tr>
|
368 |
|
|
<td width = "20%">
|
369 |
|
|
<img src="syosil.jpg">
|
370 |
|
|
</td>
|
371 |
|
|
<td width = "60%">
|
372 |
|
|
<address style="text-align: center;">
|
373 |
|
|
Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.2.5<br>
|
374 |
|
|
<br>
|
375 |
|
|
Copyright 2014-2015 SyoSil ApS<br>
|
376 |
|
|
All Rights Reserved Worldwide<br>
|
377 |
|
|
<br>
|
378 |
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
379 |
|
|
use this file except in compliance with the License. You may obtain a copy of
|
380 |
|
|
the License at<br>
|
381 |
|
|
<br>
|
382 |
|
|
<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a><br>
|
383 |
|
|
<br>
|
384 |
|
|
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
385 |
|
|
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
386 |
|
|
implied. See the License for the specific language governing permissions and limitations under
|
387 |
|
|
the License.
|
388 |
|
|
</address>
|
389 |
|
|
</td>
|
390 |
|
|
<td width = "20%">
|
391 |
|
|
<address style="text-align: right;"><small>
|
392 |
|
|
<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a><br>
|
393 |
|
|
<a href="http://www.doxygen.org/index.html">Doxygen</a> Version: 1.6.1<br>
|
394 |
|
|
<a href="http://www.intelligentdv.com/index.html">IDV SV Filter</a> Version: 2.6.2<br>
|
395 |
|
|
Sat Nov 28 05:41:54 2015</small></address>
|
396 |
|
|
</td>
|
397 |
|
|
</tr>
|
398 |
|
|
</table>
|
399 |
|
|
<address style="text-align: left;"><small>
|
400 |
|
|
Find a documentation bug? Report bugs to: <a href="http://bugs.intelligentdv.com/">bugs.intelligentdv.com</a> Project: DoxygenFilterSV
|
401 |
|
|
</small></address>
|
402 |
|
|
</body>
|
403 |
|
|
</html>
|