1 |
2 |
rpaley_yid |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
2 |
|
|
<html>
|
3 |
|
|
<head>
|
4 |
|
|
|
5 |
|
|
<meta http-equiv="CONTENT-TYPE"
|
6 |
|
|
content="text/html; charset=iso-8859-1">
|
7 |
|
|
<title></title>
|
8 |
|
|
|
9 |
|
|
<meta name="GENERATOR" content="StarOffice/5.2 (Win32)">
|
10 |
|
|
|
11 |
|
|
<meta name="AUTHOR" content="Robert Paley">
|
12 |
|
|
|
13 |
|
|
<meta name="CREATED" content="20020728;14095738">
|
14 |
|
|
|
15 |
|
|
<meta name="CHANGEDBY" content="Robert Paley">
|
16 |
|
|
|
17 |
|
|
<meta name="CHANGED" content="20020728;15514460">
|
18 |
|
|
|
19 |
|
|
<style>
|
20 |
|
|
|
21 |
|
|
<!--
|
22 |
|
|
|
23 |
|
|
P.sdfootnote { margin-left: 0.2in; text-indent: -0.2in; margin-bottom: 0in; font-size: 10pt }
|
24 |
|
|
|
25 |
|
|
A.sdfootnoteanc { font-size: 57% }
|
26 |
|
|
|
27 |
|
|
-->
|
28 |
|
|
|
29 |
|
|
</style>
|
30 |
|
|
</head>
|
31 |
|
|
<body>
|
32 |
|
|
<p align="right"><font size="3">B"H</font></p>
|
33 |
|
|
<h1 style="text-align: center;"><font size="4" style="font-size: 16pt;">Description
|
34 |
|
|
of single_port memory and test environment.</font></h1>
|
35 |
|
|
<h2>Abstract: </h2>
|
36 |
|
|
<p>A single port memory with testbench is described. The memory is
|
37 |
|
|
implemented as three different architectures.</p>
|
38 |
|
|
<h2>Port Interface:</h2>
|
39 |
|
|
<table width="757" border="1" cellpadding="5" cellspacing="4">
|
40 |
|
|
<col width="108"> <col width="118"> <col width="483"> <thead> <tr
|
41 |
|
|
valign="top">
|
42 |
|
|
<th width="108">
|
43 |
|
|
<p>Port Name</p>
|
44 |
|
|
</th>
|
45 |
|
|
<th width="118">
|
46 |
|
|
<p>Type</p>
|
47 |
|
|
</th>
|
48 |
|
|
<th width="483">
|
49 |
|
|
<p>Description</p>
|
50 |
|
|
</th>
|
51 |
|
|
</tr>
|
52 |
|
|
</thead> <tbody>
|
53 |
|
|
<tr valign="top">
|
54 |
|
|
<td width="108">
|
55 |
|
|
<p>rnwtQ</p>
|
56 |
|
|
</td>
|
57 |
|
|
<td width="118">
|
58 |
|
|
<p>Time</p>
|
59 |
|
|
</td>
|
60 |
|
|
<td width="483">
|
61 |
|
|
<p>Time delay from rnw = read until data appears on q data bus.</p>
|
62 |
|
|
</td>
|
63 |
|
|
</tr>
|
64 |
|
|
<tr valign="top">
|
65 |
|
|
<td width="108">
|
66 |
|
|
<p>d</p>
|
67 |
|
|
</td>
|
68 |
|
|
<td width="118">
|
69 |
|
|
<p>data_inter_typ</p>
|
70 |
|
|
</td>
|
71 |
|
|
<td width="483">
|
72 |
|
|
<p>Input data bus, type specified in single_port_pkg</p>
|
73 |
|
|
</td>
|
74 |
|
|
</tr>
|
75 |
|
|
<tr valign="top">
|
76 |
|
|
<td width="108">
|
77 |
|
|
<p>q</p>
|
78 |
|
|
</td>
|
79 |
|
|
<td width="118">
|
80 |
|
|
<p>data_inter_typ</p>
|
81 |
|
|
</td>
|
82 |
|
|
<td width="483">
|
83 |
|
|
<p>Output data bus, type specified in single_port_pkg</p>
|
84 |
|
|
</td>
|
85 |
|
|
</tr>
|
86 |
|
|
<tr valign="top">
|
87 |
|
|
<td width="108">
|
88 |
|
|
<p>a</p>
|
89 |
|
|
</td>
|
90 |
|
|
<td width="118">
|
91 |
|
|
<p>addr_inter_typ</p>
|
92 |
|
|
</td>
|
93 |
|
|
<td width="483">
|
94 |
|
|
<p>Address bus, type specified in single_port_pkg</p>
|
95 |
|
|
</td>
|
96 |
|
|
</tr>
|
97 |
|
|
<tr valign="top">
|
98 |
|
|
<td width="108">
|
99 |
|
|
<p>rnw</p>
|
100 |
|
|
</td>
|
101 |
|
|
<td width="118">
|
102 |
|
|
<p>STD_LOGIC</p>
|
103 |
|
|
</td>
|
104 |
|
|
<td width="483">
|
105 |
|
|
<p>Read not write port</p>
|
106 |
|
|
</td>
|
107 |
|
|
</tr>
|
108 |
|
|
<tr valign="top">
|
109 |
|
|
<td width="108">
|
110 |
|
|
<p>dealloc_mem</p>
|
111 |
|
|
</td>
|
112 |
|
|
<td width="118">
|
113 |
|
|
<p>BOOLEAN</p>
|
114 |
|
|
</td>
|
115 |
|
|
<td width="483">
|
116 |
|
|
<p>When set to true, deallocate linked list memory.</p>
|
117 |
|
|
</td>
|
118 |
|
|
</tr>
|
119 |
|
|
|
120 |
|
|
</tbody>
|
121 |
|
|
</table>
|
122 |
|
|
<h2>Functional Description:</h2>
|
123 |
|
|
<p>The single_port memory is implemented as three different
|
124 |
|
|
architecures. The first architecture is called ArrayMemNoFlag, and
|
125 |
|
|
implements the memory core as an array of STD_LOGIC_VECTOR. The memory
|
126 |
|
|
is asynchronous and triggered on rnw'transaction. When rnw = '0', the
|
127 |
|
|
data on bus "d" is loaded into the memory at the location specified by
|
128 |
|
|
the addres bus "a". When rnw = '1', the data located in memory address
|
129 |
|
|
"a" is loaded onto the output data bus "q". If a memory location is read
|
130 |
|
|
which was not written to during the current simulation, 'U' are loaded
|
131 |
|
|
onto the memory bus.</p>
|
132 |
|
|
<p>The second architecture is called ArrayMem, and implements the
|
133 |
|
|
memory core as an array of BIT_VECTOR. This arrangement allows less
|
134 |
|
|
workstation memory to be used than the ArrayMemNoFlag architecture. The
|
135 |
|
|
memory is asynchronous and triggered on rnw'transaction. When rnw = '0',
|
136 |
|
|
the data on bus "d" is loaded into the memory at the location specified
|
137 |
|
|
by the addres bus "a". When rnw = '1', the data located in memory
|
138 |
|
|
address "a" is loaded onto the output data bus "q". If a memory location
|
139 |
|
|
is read which was not written to during the current simulation, 'U' are
|
140 |
|
|
loaded onto the memory bus.</p>
|
141 |
|
|
<p>The third architecture is called LinkedList, and implements the
|
142 |
|
|
memory core as a linked list of arrays of BIT_VECTOR. Each array in the
|
143 |
|
|
linked list is a page of memory whose size is specified in
|
144 |
|
|
single_port_pkg. This arrangement allows less workstation memory to be
|
145 |
|
|
used than either the ArrayMemNoFlag or ArrayMem architectures. The
|
146 |
|
|
memory is asynchronous and triggered on rnw'transaction. When rnw = '0',
|
147 |
|
|
the data on bus "d" is loaded into the memory at the location specified
|
148 |
|
|
by the addres bus "a". When rnw = '1', the data located in memory
|
149 |
|
|
address "a" is loaded onto the output data bus "q". If a memory location
|
150 |
|
|
is read which was not written to during the current simulation, 'U' are
|
151 |
|
|
loaded onto the memory bus. To de-allocate the memory in the linked
|
152 |
|
|
list, set dealloc_mem to true. </p>
|
153 |
|
|
<h2>Functional Timing:</h2>
|
154 |
|
|
<p>The single port memory is asynchronous and is triggered on
|
155 |
|
|
rnw'transaction. When rnw is cleared to '0', the write occurs at the
|
156 |
|
|
same time as rnw'transaction. When a read occurs, with rnw = '1' , data
|
157 |
|
|
appears on the Q bus rnwtQ ns after rnw is set to '1'. The below sample
|
158 |
|
|
timing diagram illustrates both a read and write operation.</p>
|
159 |
|
|
<p><img src="../images/timing.jpg" name="Graphic1" align="left"
|
160 |
|
|
width="958" height="251" border="0"><br clear="left">
|
161 |
|
|
</p>
|
162 |
|
|
<h2>Testbench Description:</h2>
|
163 |
|
|
<p>The test bench is arranged as a client server architecture as
|
164 |
|
|
specified by Bergeron<a class="sdfootnoteanc" name="sdfootnote1anc"
|
165 |
|
|
href="#sdfootnote1sym"><sup>1</sup></a>. A diagram illustrating the
|
166 |
|
|
testbench is given below.<br>
|
167 |
|
|
<br>
|
168 |
|
|
<img src="../images/tbschematic.jpg" name="Graphic2" align="left"
|
169 |
|
|
width="838" height="371" border="0"><br clear="left">
|
170 |
|
|
Two tests are specified in tc_single_port component. The first test
|
171 |
|
|
writes data to two logical memory pages, and then reads them back
|
172 |
|
|
verifying the correct data. The test case writes an error message to the
|
173 |
|
|
console for every miscompare. The second case verifies that the
|
174 |
|
|
single_port memory model outputs unknowns to the q bus if a read occurs
|
175 |
|
|
for an unwritten memory location. Six configurations are specified in
|
176 |
|
|
the test bench architecture tb_single_port, running both tests for each
|
177 |
|
|
single_port architecture. <br>
|
178 |
|
|
</p>
|
179 |
|
|
<h2>Usage:</h2>
|
180 |
|
|
<p>A Makefile is used to compile and run all of the tests in a Unix or
|
181 |
|
|
like environment, such as Cygwin. The compilation and simulation is
|
182 |
|
|
targetted to the SymphonyEDA tool available at <a
|
183 |
|
|
href="www.symphonyeda.com">www.symphonyeda.com</a> .</p>
|
184 |
|
|
<p>The source files and Makefile are located in {top}/VHDL<br>
|
185 |
|
|
<br>
|
186 |
|
|
To compile: make com</p>
|
187 |
|
|
<p>To simulate all of the tests: make sim<br>
|
188 |
|
|
</p>
|
189 |
|
|
<p>To clean the compiled library: make clean</p>
|
190 |
|
|
<p>The tests are labeled :</p>
|
191 |
|
|
<ul>
|
192 |
|
|
<li>ll_error</li>
|
193 |
|
|
<li>ll_main</li>
|
194 |
|
|
<li>mem_main<br>
|
195 |
|
|
</li>
|
196 |
|
|
<li>mem_error<br>
|
197 |
|
|
</li>
|
198 |
|
|
<li>memnoflag_main<br>
|
199 |
|
|
</li>
|
200 |
|
|
<li>memnoflag_error<br>
|
201 |
|
|
</li>
|
202 |
|
|
</ul>
|
203 |
|
|
<p>To simulate any of these tests, type make {testname}</p>
|
204 |
|
|
<p>Please contact Robert Paley at <a href="mailto:rpaley_yid@yahoo.com">rpaley_yid@opencores.org</a>
|
205 |
|
|
if you have any questions or comments. </p>
|
206 |
|
|
<div id="sdfootnote1">
|
207 |
|
|
<p class="sdfootnote" style="margin-bottom: 0.2in;"><a
|
208 |
|
|
class="sdfootnotesym" name="sdfootnote1sym" href="#sdfootnote1anc">1</a>Writing
|
209 |
|
|
Testbenches , Functional Verification of HDL Testbenches. Chapter 6 –
|
210 |
|
|
ISBN 0-7923-7766-4</p>
|
211 |
|
|
</div>
|
212 |
|
|
</body>
|
213 |
|
|
</html>
|