why sim_cycle_counter always 0 in testapi?

Usage of VEX tools

Re: why sim_cycle_counter always 0 in testapi?

Postby frb » Mon Jun 26, 2006 3:56 pm

ppy wrote:extern double sim_cycle_counter;
extern double sim_stall_counter;

are 2 variables which can be read from API,

however I found in the testapi case trace.txt, print value is always zero.


I just realized that cachelib_api.h has a few obsolete declarations that didn't keep track of changes in other parts of VEX. Starting from line 130, use the following declaration in place of what is in the distribution

Code: Select all

/* Cycles and Stalls */
extern unsigned long long sim_cycle_counter;    /* Variable for the cycle counter */
extern unsigned long long sim_stall_counter;    /* Variable for the stall counter */

/* Statistics */
extern unsigned long long sim_bundle_index[];   /* ILP histogram counters */
extern unsigned long long sim_oper_counter;     /* Operation counter */
extern unsigned long long sim_bnt_counter;       /* Not-taken conditional branch counter */
extern unsigned long long sim_btc_counter;       /* Taken conditional branch counter */
extern unsigned long long sim_btu_counter;       /* Taken unconditional branch counter */
extern unsigned long long sim_nop_counter;      /* Nop counter */


In addition, in cachelib.c, where it prints the time, you should be using the appropriate formatting ("llu") for the printf, so for example, mem_trace_ld() becomes

Code: Select all
extern int mem_trace_ld(unsigned int address, int cluster, int size)
{
    if (!api_active)
        return address;
    _linux_fprintf(ftrace, "+++++ LOAD%d %x (t=%llu)\n",
        size, address, sim_cycle_counter);
    ++nld;
    return address;
}


and likewise for all the other places where statistics are being printed.

Sorry for the confusion. At some point in the future, I'll post an updated version with the fixes.
frb
 
Posts: 62
Joined: Thu Nov 12, 2009 3:44 pm

Return to VEX Tools



Who is online

Users browsing this forum: No registered users and 0 guests

cron