1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>GXReadMemMetric</title> 10</head> 11 12<body> 13 14<h1 align="left">GXReadMemMetric</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/gx.h> 19 20void GXReadMemMetric( u32* cp_req, 21 u32* tc_req, 22 u32* cpu_rd_req, 23 u32* cpu_wr_req, 24 u32* dsp_req, 25 u32* io_req, 26 u32* vi_req, 27 u32* pe_req, 28 u32* rf_req, 29 u32* fi_req ); 30</pre></dd></dl> 31 32<h2>Arguments</h2> 33<TABLE class="arguments" border="1" > 34 <tr> 35<TH>cp_req</TH> 36<TD>Returns a CP request counter value as a 32-bit unsigned integer.</TD> 37 </tr> 38 <tr> 39<TH>tc_req</TH> 40<TD>Returns a TC request counter value as a 32-bit unsigned integer.</TD> 41 </tr> 42 <tr> 43<TH>cpu_rd_req</TH> 44<TD>Returns a CPU read request counter value as a 32-bit unsigned integer.</TD> 45 </tr> 46 <tr> 47<TH>cpu_wr_req</TH> 48<TD>Returns a CPU write request counter value as a 32-bit unsigned integer.</TD> 49 </tr> 50 <tr> 51<TH>dsp_req</TH> 52<TD>Returns a DPS request counter value as a 32-bit unsigned integer.</TD> 53 </tr> 54 <tr> 55<TH>io_req</TH> 56<TD>Returns an IO request counter value as a 32-bit unsigned integer.</TD> 57 </tr> 58 <tr> 59<TH>vi_req</TH> 60<TD>Returns a VI request counter value as a 32-bit unsigned integer.</TD> 61 </tr> 62 <tr> 63<TH>pe_req</TH> 64<TD>Returns a PE request counter value as a 32-bit unsigned integer.</TD> 65 </tr> 66 <tr> 67<TH>rf_req</TH> 68<TD>Returns an RF request counter value as a 32-bit unsigned integer.</TD> 69 </tr> 70 <tr> 71<TH>fi_req</TH> 72<TD>Returns an FI request counter value as a 32-bit unsigned integer.</TD> 73 </tr> 74</TABLE> 75 76<h2>Return Values</h2> 77<p>None.</p> 78 79<H2>Description</H2> 80<P>The graphics processor (GP) can count many internal events that give detailed information on performance. This function returns the number of memory requests made by each memory master. The counters can be cleared by calling the <A href="GXClearMemMetric.html"><CODE>GXClearMemMetric</CODE></A> function.</P> 81 82<P><STRONG>Note: This function can measure only access to internal memory (MEM1 region) of the system. It cannot measure access to external memory (MEM2 region).</STRONG></P> 83 84<DL><DD><CODE>u32 cp_req, tc_req, cpu_rd_req, cpu_wr_req, dsp_req, io_req, vi_req, pe_req;<BR> u32 rf_req, fi_req;<BR> <BR> GXClearMemMetric();<BR> <BR> // Draw Object(s)</CODE></DD></DL> 85<DL><DD><CODE>// wait until object drawn<BR> GXSetDrawSync(0xbeef);<BR> while (0xbeef != GXReadDrawSync())<BR> ;<BR> <BR> metric = GXReadMemMetric(&cp_req,<BR> &tc_req,<BR> &cpu_rd_req,<BR> &cpu_wr_req,<BR> &dsp_req,<BR> &io_req,<BR> &vi_req,<BR> &pe_req,<BR> &rf_req,<BR> &fi_req );<BR> <BR> OSReport("Number command processor requests: %d\n", cp_req);</CODE></DD></DL> 86<P>Each request results in a 32-byte transaction on the main memory bus.</P> 87 88<H3>Memory Counter Details</H3> 89<H4><SPAN class="argument">cp_req</SPAN></H4> 90<P>The command processor (CP) is responsible for reading the graphics FIFO, reading display lists (in the <A href="../DisplayList/GXCallDisplayList.html"><CODE>GXCallDisplayList</CODE></A> function), and servicing vertex cache misses. This metric returns the number of memory read requests issued by the command processor.</P> 91 92<H4><SPAN class="argument">tc_req</SPAN></H4> 93<P>Returns the number of memory read requests issued by the texture cache (TC).</P> 94 95<H4><SPAN class="argument">cpu_rd_req</SPAN></H4> 96<P>Returns the number of memory read requests made by the CPU.</P> 97 98<H4><SPAN class="argument">cp_wr_req</SPAN></H4> 99<P>Returns the number of memory write requests made by the CPU.</P> 100 101<H4><SPAN class="argument">dsp_req</SPAN></H4> 102<P>Returns the number of memory requests made by the audio DSP.</P> 103 104<H4><SPAN class="argument">io_req</SPAN></H4> 105<P>Returns the number of memory requests made by IO devices.</P> 106 107<H4><SPAN class="argument">vi_req</SPAN></H4> 108<P>Returns the number of memory read requests made by the video interface (VI).</P> 109 110<H4><SPAN class="argument">pe_req</SPAN></H4> 111<P>Returns the number of memory write requests made by the pixel engine (PE). These include texture copies (<A href="../Framebuffer/GXCopyTex.html"><CODE>GXCopyTex</CODE></A>) and display copies (<A href="../Framebuffer/GXCopyDisp.html"><CODE>GXCopyDisp</CODE></A>).</P> 112 113<H4><SPAN class="argument">rf_req</SPAN></H4> 114<P>Returns the number of memory refresh requests.</P> 115 116<H4><SPAN class="argument">fi_req</SPAN></H4> 117<P>Returns the number of forced idle (FI) requests, which are dummy requests required to switch the bus direction (read to write, or write to read).</P> 118 119<h2>See Also</h2> 120<P class="reference"> 121<a href="GXReadPixMetric.html">GXReadPixMetric</a>, 122<a href="GXClearPixMetric.html">GXClearPixMetric</a>, 123<a href="GXSetVCacheMetric.html">GXSetVCacheMetric</a>, 124<a href="GXReadVCacheMetric.html">GXReadVCacheMetric</a>, 125<a href="GXClearVCacheMetric.html">GXClearVCacheMetric</a>, 126<a href="GXSetGPMetric.html">GXSetGPMetric</a>, 127<a href="GXReadGPMetric.html">GXReadGPMetric</a>, 128<a href="GXClearGPMetric.html">GXClearGPMetric</a> 129</p> 130 131<H2>Revision History</H2> 132<P> 1332006/03/01 Initial version.<br> 134</P> 135 136<hr><p>CONFIDENTIAL</p></body> 137</html>