Here is the patch from mailing list of marss posted by Ishwar.

One more thing: When I see screen display, number of  instructions is not
same as -stopinsns X, but when I see log file, number of instructions, where
simulation stopped, is same as -stopinsns X. That means code may be correct,
but my understanding is not complete. Can you explain?

---------------------------
+++ b/ptlsim/x86/ptlhwdef.h
@@ -819,6 +819,7 @@ struct Context: public CPUX86State {
   W64 insns_at_last_mode_switch;
   W64 user_*instruction*s_commited;
   W64 kernel_*instruction*s_commited;
+  W64 total_*instruction*s_commited;
   W64 exception;
   W64 reg_trace;
   W64 reg_selfrip;
--------------------------------------
+++ b/ptlsim/*core*/ooopipe.cpp
@@ -2348,6 +2348,7 @@ int ReorderBufferEntry::commit() {

   if likely (uop.eom) {
     total_user_insns_committed++;
+    ctx.total_*instruction*s_commited++;
     per_context_ooo*core*_stats_update(threadid,
commit.insns++);
     thread.total_insns_committed++;
-----------------------------------
+++ b/ptlsim/sim/ptl-qemu.cpp
@@ -723,11 +723,11 @@ void Context::update_mode_count() {
     W64 prev_cycles = cycles_at_last_mode_switch;
     W64 prev_insns = insns_at_last_mode_switch;
     W64 delta_cycles = sim_cycle -
cycles_at_last_mode_switch;
-    W64 delta_insns = total_user_insns_committed -
+    W64 delta_insns =total_*instruction*s_commited -
         insns_at_last_mode_switch;

     cycles_at_last_mode_switch = sim_cycle;
-    insns_at_last_mode_switch = total_user_insns_committed;
+    insns_at_last_mode_switch =total_*instruction*s_commited;
------------------------------------
+++ b/ptlsim/sim/ptlsim.cpp
@@ -720,6 +720,7 @@ CPUX86State* ptl_create_new_context() {

        // Create a new CPU context and add it to contexts
array
        Context* ctx = new Context();
+        ctx->total_*instruction*s_commited = 0;
        ptl_contexts[ctx_counter] = ctx;
        ctx_counter++;
-------------------------------------


Thanks and Regards
Sparsh Mittal




On Thu, Sep 8, 2011 at 11:50 AM, avadh patel <[email protected]> wrote:

> Please can you email me that patch so I can confirm that its valid and not
> fixed in any branch.
>
> Thanks,
> Avadh
>
> On Thu, Sep 8, 2011 at 9:48 AM, sparsh1 mittal1 
> <[email protected]>wrote:
>
>> Hello
>> One user submitted a patch for counting instructions in multi-core. It
>> seems both master and core-models don't have this patch applied.
>> While doing simulations, I see that total committed instructions are not
>> same as -stopinsns X for multi-core.
>>
>> If the patch is correct, I can apply the patch in my code in my local
>> computer. Please let me know.
>>
>>
>> Thanks and Regards
>> Sparsh Mittal
>>
>>
>>
>> _______________________________________________
>> http://www.marss86.org
>> Marss86-Devel mailing list
>> [email protected]
>> https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
>>
>>
>
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel

Reply via email to