mem-if.html 4.06 KB
<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>