mem-if.html
4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<html>
<head>
<title>
Project BB - Main Memory DV Interface
</title>
</head>
<body bgcolor="#ffffff" text="#000000"
link="#004868" vlink="#986424" alink="#00ffff">
<table width="100%" cellpadding=2 cellspacing=0 border=0>
<tr>
<td bgcolor="#e0e0e0">
Project BB - Main Memory DV Interface
</td>
<td align=right bgcolor="#f0c0c0" width="20%">
<font color=red>
<b>Broad<i>On</i> confidential</b>
</font>
</td>
</tr>
</table>
<p>
<b> Overview </b>
<p>
The DV environment requires a back door to main memory through which
tests of all the hardware blocks can seed and verify main memory
without going through another (possibly buggy) rtl block. It is not
sufficient to issue cpu writes to setup memory and cpu reads to verify
it later. In addition, memory areas not used by a test must be verified
to be unmodified. The back door is implemented through a set of pli
functions that reach into the behavioral memory areas of the memory
chips or into the behavioral ri model.
<p>
<dl>
<dt><b> $mem_fill_pattern(address, size, type) </b>
<dd> input [31:0] address;
<dd> input [31:0] size;
<dd> input [3:0] type;
<p>
<dd>
This function fills main memory starting at byte address <b>address</b>
of length <b>size</b> (in bytes) with pattern <b>type</b>. Both the
starting address and size must be 8-byte aligned. In x64 space, all 64
bits are written. In x36 space, the appropriate extend bits are set
automatically. Type is defined as follows:
<p>
<dl>
<dt> MEM_ADDR
<dd> Writes to main memory occur in 64-bit quantities.
<pre>
bits[63:56] address[7:0] ^ address[31:24]
bits[55:48] address[7:0] ^ address[15:8]
bits[47:40] ~address[7:0]
bits[39:32] ~address[15:8]
bits[31:24] ~address[23:16]
bits[23:16] address[23:16]
bits[15:8] address[15:8]
bits[7:0] address[7:0]
</pre>
<dt> MEM_RANDOM
<dd> Writes to main memory occur in 64-bit quantities. Two 32-bit random numbers
are combined to create a 64-bit random number. The seed of the random
generator should be different for each run, but must be settable as a
command line option for test reruns.
</dl>
</dl>
<p>
<dl>
<dt><b> $mem_cmp_pattern(address, size, type) </b>
<dd> input [31:0] address;
<dd> input [31:0] size;
<dd> input [3:0] type;
<p>
<dd>
This function compares main memory starting at byte address <b>address</b>
of length <b>size</b> (in bytes) with pattern <b>type</b>. Both the
starting address and size must be 8-byte aligned. In x64 space, all 64
bits are compared. In x36 space, the appropriate extend bits are generated
from the pattern and compared.
<p>
<dl>
<dt> MEM_ADDR
<dd> See $mem_fill_pattern for an explanation of the pattern.
</dl>
</dl>
<p>
<dl>
<dt><b> $mem_write(address, data, mask) </b>
<dd> input [31:0] address;
<dd> input [63:0] data;
<dd> input [7:0] mask;
<p>
<dd>
This function writes <b>data</b> bytes which have the corresponding
<b>mask</b> bit set to main memory. The address must be 8-byte aligned.
In x36 space, the appropriate extend bits are generated from <b>data</b>
automatically.
</dl>
<p>
<dl>
<dt><b> $mem_read(address, data) </b>
<dd> input [31:0] address;
<dd> output [63:0] data;
<p>
<dd>
This function returns <b>data</b> from main memory at address <b>address</b>.
The address must be 8-byte aligned and reading from x36 space is illegal.
</dl>
<p>
<dl>
<dt><b> $mem_read_file(file, offset, address, size) </b>
<dd> input [X;0] file;
<dd> input [31:0] offset;
<dd> input [31:0] address;
<dd> input [31:0] size;
<p>
<dd>
This function reads the given <b>file</b> from <b>offset</b> to main memory
starting at byte address <b>address</b> of length <b>size</b> (in bytes).
<dd> <b>TBD</b> layout of file
</dl>
<p>
<dl>
<dt><b> $mem_write_file(file, offset, address, size) </b>
<dd> input [X;0] file;
<dd> input [31:0] offset;
<dd> input [31:0] address;
<dd> input [31:0] size;
<p>
<dd>
This function writes main memory starting at byte address <b>address</b>
of length <b>size</b> (in bytes) to <b>file</b> at <b>offset</b>.
<dd> <b>TBD</b> layout of file
</dl>
<hr>
<font size="-1">
Problems and comments to
<a href="mailto:berndt@broadon.com">
berndt@broadon.com
</a>
</font>
</body>
</html>