<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'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"><<a href="mailto:lorizhuang@gmail.com">lorizhuang@gmail.com</a>></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'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->s.ini_ptr);</div><div> ret = m_processors[proc]->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->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->s.type == Sim_Trans_Prefetch) {</div><div> return true;</div><div> }</div><div><br></div><div> // no cache flush</div><div> if (mem_trans->s.type == Sim_Trans_Cache) {</div><div> return true;</div>
<div> }</div><div><br></div><div> // no DMA & IO</div><div> if (IS_DEV_MEM_OP(mem_trans->s.ini_type) ||</div><div> IS_OTH_MEM_OP(mem_trans->s.ini_type) ||</div><div> mem_trans->s.physical_address > 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't simulates data prefetching. Am I right?</div>
<div>Since I'm going to add a prefetch instruction of the SPARC v9 instruction set to a benchmark and see if any speedups. That'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 "site:<a href="https://lists.cs.wisc.edu/archive/gems-users/" target="_blank">https://lists.cs.wisc.edu/archive/gems-users/</a>" 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>