> # HG changeset patch
> # User Brad Beckmann <[email protected]>
> # Date 1260657436 28800
> # Node ID 23ea85c0fc27eaa31f042bdc37238856ffc7769e
> # Parent  e68f680829daff5e16ea6d520c7302f7ed5055f9
> diff -r e68f680829da -r 23ea85c0fc27 configs/example/memtest-ruby.py
> --- a/configs/example/memtest-ruby.py   Sat Dec 12 14:37:16 2009 -0800
> +++ b/configs/example/memtest-ruby.py   Sat Dec 12 14:37:16 2009 -0800

> +                         debug = RubyDebug(),#filter_string = 'qQin',
> +                                           #verbosity_string = 'high',
> +                                           #protocol_trace = True),

More commented code.

> @@ -170,17 +168,51 @@
> +  (*m_periodic_output_file_ptr) << "ruby_cycles: "
> +                                << g_eventQueue_ptr->getTime()-m_ruby_start
> +                                << endl;
> +
> +  (*m_periodic_output_file_ptr) << "total_misses: "
> +                                << total_misses
> +                                << " "
> +                                << m_perProcTotalMisses
> +                                << endl;
> +
> +  (*m_periodic_output_file_ptr) << "simics_cycles_executed: "
> +                                << simics_cycles_executed
> +                                << " "
> +                                << perProcCycleCount
> +                                << endl;
> +
> +  (*m_periodic_output_file_ptr) << "transactions_started: "
> +                                << transactions_started
> +                                << " "
> +                                << m_perProcStartTransaction
> +                                << endl;
> +
> +  (*m_periodic_output_file_ptr) << "transactions_ended: "
> +                                << transactions_ended
> +                                << " "
> +                                << m_perProcEndTransaction
> +                                << endl;
> +
> +  (*m_periodic_output_file_ptr) << "mbytes_resident: "
> +                                << process_memory_resident()
> +                                << endl;
> +
> +  (*m_periodic_output_file_ptr) << "mbytes_total: "
> +                                << process_memory_total()
> +                                << endl;
> +
Seems like a temporary variable that has a much shorter name would
help clean this code up.  Also, you can use cprintf if you want to
clean it up even more.

> +    uint64 m_memReq = m_mc_profilers[mem_cntrl]->m_memReq;
> +    uint64 m_memRefresh = m_mc_profilers[mem_cntrl]->m_memRefresh;
> +    uint64 m_memInputQ = m_mc_profilers[mem_cntrl]->m_memInputQ;
> +    uint64 m_memBankQ = m_mc_profilers[mem_cntrl]->m_memBankQ;
> +    uint64 m_memWaitCycles = m_mc_profilers[mem_cntrl]->m_memWaitCycles;
> +    uint64 m_memRead = m_mc_profilers[mem_cntrl]->m_memRead;
> +    uint64 m_memWrite = m_mc_profilers[mem_cntrl]->m_memWrite;
> +    uint64 m_memBankBusy = m_mc_profilers[mem_cntrl]->m_memBankBusy;
> +    uint64 m_memRandBusy = m_mc_profilers[mem_cntrl]->m_memRandBusy;
> +    uint64 m_memNotOld = m_mc_profilers[mem_cntrl]->m_memNotOld;
> +    uint64 m_memArbWait = m_mc_profilers[mem_cntrl]->m_memArbWait;
> +    uint64 m_memBusBusy = m_mc_profilers[mem_cntrl]->m_memBusBusy;
> +    uint64 m_memTfawBusy = m_mc_profilers[mem_cntrl]->m_memTfawBusy;
> +    uint64 m_memReadWriteBusy = 
> m_mc_profilers[mem_cntrl]->m_memReadWriteBusy;
> +    uint64 m_memDataBusBusy = m_mc_profilers[mem_cntrl]->m_memDataBusBusy;
> +    Vector<uint64> m_memBankCount = 
> m_mc_profilers[mem_cntrl]->m_memBankCount;

I dont' have enough context to understand what is going on here, but
what is the point of all of these variables?  It seems that just using
a short temporary for "m_mc_profilers[mem_cntrl]" would make it easy
to avoid these temporaries


> +
> +void Profiler::profileMemBankBusy(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memBankBusy++;
> +}
> +
> +void Profiler::profileMemBusBusy(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memBusBusy++;
> +}
> +
> +void Profiler::profileMemReadWriteBusy(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memReadWriteBusy++;
> +}
> +
> +void Profiler::profileMemDataBusBusy(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memDataBusBusy++;
> +}
> +
> +void Profiler::profileMemTfawBusy(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memTfawBusy++;
> +}
> +
> +void Profiler::profileMemRefresh(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memRefresh++;
> +}
> +
> +void Profiler::profileMemRead(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memRead++;
> +}
> +
> +void Profiler::profileMemWrite(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memWrite++;
> +}
> +
> +void Profiler::profileMemWaitCycles(int mem_cntrl, int cycles) {
> +  m_mc_profilers[mem_cntrl]->m_memWaitCycles += cycles;
> +}
> +
> +void Profiler::profileMemInputQ(int mem_cntrl, int cycles) {
> +  m_mc_profilers[mem_cntrl]->m_memInputQ += cycles;
> +}
> +
> +void Profiler::profileMemBankQ(int mem_cntrl, int cycles) {
> +  m_mc_profilers[mem_cntrl]->m_memBankQ += cycles;
> +}
> +
> +void Profiler::profileMemArbWait(int mem_cntrl, int cycles) {
> +  m_mc_profilers[mem_cntrl]->m_memArbWait += cycles;
> +}
> +
> +void Profiler::profileMemRandBusy(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memRandBusy++;
> +}
> +
> +void Profiler::profileMemNotOld(int mem_cntrl) {
> +  m_mc_profilers[mem_cntrl]->m_memNotOld++;
> +}

M5 style would have a newline after the return type, and a newline
before the opening brace of the function.  If you're going to change
this, it'd be nice to make it follow the style.
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to