<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Ruby currently ignores software prefetches, as you point out. At one time, there was some internal code that did hardware prefetching, but I don&#39;t think that was ever released (however, its remnants remain scattered here and there, e.g., the prefetch bit).<div>
<br></div><div>Regards,</div><div>Dan</div></span><br><div class="gmail_quote">On Thu, May 20, 2010 at 12:30 AM, lori zhuang <span dir="ltr">&lt;<a href="mailto:lorizhuang@gmail.com">lorizhuang@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">List,<div>     I wonder if Ruby simulates the behavior of data prefetch. It seems like it does according to this link <a href="https://lists.cs.wisc.edu/archive/gems-users/2007-November/msg00102.shtml" target="_blank">https://lists.cs.wisc.edu/archive/gems-users/2007-November/msg00102.shtml</a>. But it seems like it doesn&#39;t according to the code in SimicsDriver.C:</div>

<div><br></div><div>int SimicsDriver::makeRequest(memory_transaction_t *mem_trans) {</div><div>    ...</div><div>    ...</div><div>    //<b> skip unsupported types</b></div><div>    if (<b>isUnhandledTransaction</b>(mem_trans)) {</div>

<div>    ret = Unhandled;</div><div>    } else {</div><div>     // perform makeRequest()</div><div>      int proc = SIMICS_get_proc_no(mem_trans-&gt;s.ini_ptr);</div><div>     ret = m_processors[proc]-&gt;makeRequest(mem_trans);</div>

<div>   }</div><div>   ...</div><div>  ...</div><div>}</div><div><br></div><div><div>bool SimicsDriver::<b>isUnhandledTransaction</b>(memory_transaction_t* mem_trans) {</div><div>  // only handle user data?</div><div>  if (USER_MODE_DATA_ONLY) {</div>

<div>    if(PRIV_MODE) {</div><div>      return true;</div><div>    }</div><div>    if(mem_trans-&gt;s.type == Sim_Trans_Instr_Fetch) {</div><div>      return true;</div><div>    }</div><div>  }</div><div><br></div><div>
  // no prefetches</div>
<div>  if (mem_trans-&gt;s.type == Sim_Trans_Prefetch) {</div><div>    return true;</div><div>  }</div><div><br></div><div>  // no cache flush</div><div>  if (mem_trans-&gt;s.type == Sim_Trans_Cache) {</div><div>    return true;</div>

<div>  }</div><div><br></div><div>  // no DMA &amp; IO</div><div>  if (IS_DEV_MEM_OP(mem_trans-&gt;s.ini_type) ||</div><div>      IS_OTH_MEM_OP(mem_trans-&gt;s.ini_type) ||</div><div>      mem_trans-&gt;s.physical_address &gt; uinteger_t(RubyConfig::memorySizeBytes())</div>

<div>     ) {</div><div>    return true;</div><div>  }</div><div><br></div><div>  return false;</div><div>}</div></div><div><br></div><div>Ruby skips supported types memory request and it threats Sim_Trans_Prefetch as unsupported types. Hence I think Ruby doesn&#39;t simulates data prefetching. Am I right?</div>

<div>Since I&#39;m going to add a prefetch instruction of the SPARC v9 instruction set to a benchmark and see if any speedups. That&#39;s why I care so much about prefetching. Any suggestion is highly appreciated. </div>
<div>
<br></div><div><br></div><div>Thanks,</div><div>lorizhuang</div><div><br></div><div><br></div><div><br></div>
<br>_______________________________________________<br>
Gems-users mailing list<br>
<a href="mailto:Gems-users@cs.wisc.edu">Gems-users@cs.wisc.edu</a><br>
<a href="https://lists.cs.wisc.edu/mailman/listinfo/gems-users" target="_blank">https://lists.cs.wisc.edu/mailman/listinfo/gems-users</a><br>
Use Google to search the GEMS Users mailing list by adding &quot;site:<a href="https://lists.cs.wisc.edu/archive/gems-users/" target="_blank">https://lists.cs.wisc.edu/archive/gems-users/</a>&quot; to your search.<br>
<br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.cs.wisc.edu/~gibson">http://www.cs.wisc.edu/~gibson</a> [esc]:wq!<br>