profiling

Usage of VEX tools

profiling

Postby Guest » Wed Feb 22, 2006 6:04 pm

HI everybody
I wanted to make a profiling of the code to know how many integer operations how many multiplication and so on are performed by my benchmark.Does somebody of you know how can I do it?
Thanks
Francesca
Guest
 

Re: profiling

Postby frb » Thu Feb 23, 2006 5:13 pm

Anonymous wrote:HI everybody
I wanted to make a profiling of the code to know how many integer operations how many multiplication and so on are performed by my benchmark.Does somebody of you know how can I do it?
Thanks
Francesca


It's not trivial, but it could be done. There's an example of a similar analysis in the share/apps/api directory. Basically, you have to redefine some of the macros that the compiled simulator generates.

-- Paolo
frb
 
Posts: 62
Joined: Thu Nov 12, 2009 3:44 pm

Postby ah105 » Sun Jan 07, 2007 6:54 pm

Hi,

To count the number of memory stores you declare “static int nst = 0;” in “cachelib.c” and you increment this variable in the normal memory store function “mem_trace_st”. The simulator calls this function whenever a STW operation is used, as appears in “*.cs.c” files.

The function declaration appears in:
vex/api/cachlib.c
api/cache_api.h
csim/cs_header.h

To count the number of add operations, can we declare a static variable in “cachelib.c” and define a macro that increments this variable whenever an ADD operation is used. How to make the simulator call the increment macro whenever the add operation is used?

Thanks,
Abed
ah105
 
Posts: 8
Joined: Sat Nov 04, 2006 7:32 pm

Postby frb » Thu Jan 11, 2007 6:58 pm

Because of performance issues, simple arithmetic operations don't go through function calls, but are directly inlined in the compiled simulator.
However, the compiled simulator does call a macro ADD() to implement the ADD (for example).

If you look at share/appi in the "filterlib" example, you can find an example of how to define a filter to do the substitution of the predefined macros with whatever you want. it's a bit painful because you have to substitute all macros, but it's doable.

-- Paolo
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 4 guests

cron