[Wsim-users] trace: access to memory

Antoine Fraboulet antoine.fraboulet at insa-lyon.fr
Sam 24 Juil 12:05:21 CEST 2010

you should use the two options combined:




The VCD or RAW file extracted from the traces can show you when 
a memory address is accessed.

If you want to have *all accessed addresses* then you can either
set the --monitor option to watch on nearly all addresses (which will 
give you a very long command line) or modify the file 

in void machine_monitor_vcd_start(void) just place a breakpoint (bp)
for every address as it is done on line 79. You have to do this inside
a loop that will scan all the RAM/observed memory space. The --monitor
option has to be used for machine_monitor_vcd_start() to be called.

In machine_monitor_add_trace() record a message for every access that
occured at line 146. machine_monitor_find_by_addr() is useless in your
case as you will bypass the tracer. The value can be obtained as in
the following swicth/case statement with mcu_jtag_read_byte(addr).

The read/write info and other things are available, you can read the
code of machine_monitor_add_trace() to copy/paste what you need.

I hope you can get all the information you need with these info. Tell
me if this is ok for your needs

Best regards,

At Thu, 22 Jul 2010 17:39:08 -0300 (UYT),
Leonardo Steinfeld <leo at fing.edu.uy> wrote:
> Hi Antoine,
> Thanks for your quick answer.
> I read again the tutorial you mention. Unfortunately, that feature is not 
> useful for my purpose. The same way the --msp430_trc_pc option enables to 
> record a each memory location read for instruction fetch, I need to record 
> the access to data memory. That is, any time the cpu goes to memory to 
> read or write data, I need to record the memory address accessed (and 
> clearly the time too).
> Thanks again,
> Leo Steinfeld
> _________________________________
> Instituto de Ingenieria Electrica
> Facultad de Ingenieria
> Julio Herrera y Reissig 565
> 11300 Montevideo - URUGUAY
> Tel.: (598 2) 7110974 int.107
> On Thu, 22 Jul 2010, Antoine Fraboulet wrote:
> > Hi,
> >
> > if you want to trace a specific variable of memory address you can use
> > the --monitor option described here:
> >
> > http://wsim.gforge.inria.fr/tutorials/monitor-option/index.html
> >
> > The option does what you are describing using traces and functions in
> > msp430_io to record all reads and writes.
> >
> > Using this option with the --msp430_trc_pc should give you the exact
> > history of all modification made to a global variable or address.
> >
> > Antoine
> >
> >
> > At Fri, 16 Jul 2010 17:22:17 -0300 (UYT),
> > Leonardo Steinfeld <leo at fing.edu.uy> wrote:
> >>
> >> Hi,
> >>
> >> I'm using wsim to run some experiments using tinyos code on telosb motes.
> >> I need to track the access to memory, i.e. trace the accessed memory
> >> location. As a first approximation I'm already using the --msp430_trc_pc
> >> so at least I get the PC.
> >>
> >> Are you planning adding this feature in the near future? If not... Could
> >> you give some advice about how to do it "correctly"?
> >> I guess it can be added a TRACER_TRACE_MEM (or sth like that) on the
> >> msp430.h and .c. Add the trace calling the tracer_event_add_id in the
> >> msp430_mcu_create function (with appropriate params) . Finally to record
> >> the event call the TRACER_TRACE_.. macro appropriately after the
> >> msp430_fetch_short, msp430_read_short and so on in the msp430_io.c file.
> >> Maybe it can be differentiate RD and WR. But surely there a lot of issues
> >> I'm missing...
> >>
> >> Thanks in advance for any help.
> >> Leo Steinfeld.
> >>
> >> _______________________________________________
> >> Wsim-users mailing list
> >> Wsim-users at lists.gforge.inria.fr
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/wsim-users
> >

More information about the Wsim-users mailing list