Table of Contents

1. Logfiles
2. Traces and VCD files

Wsim can generate a lot of output and traces to monitor and benchmark embedded application behavior. Both logs and traces can be used to retreive information from the application running on top of the msp430 and its interaction with the ADC. Logfiles are more often used while debugging I/O while traces and VCD output are used for performance estimation and frequence/latency parameters tuning.

1. Logfiles

Wsim log files will contain, if the verbose level is set high enough (eg. 4), information about the internal behavior of the ADC12.

	
[...]
msp430:adc12: mode repeat, go to wait_trigger
msp430:adc12:     trigger ok
msp430:adc12:     sampling on config 0 hw_channel 1 (adc12_input_01) [375963]
msp430:adc12:     sample for input channel 1 - data/data2.dat
msp430:adc12:     convert = 0x0ffd (4093) 
msp430:adc12:     store sample in ADC12MEM0
msp430:intr: Interrupt 7 received but GIE = 0 (current PC = 0x40d6 [382629])
msp430:adc12: mode repeat, go to wait_trigger
msp430:adc12:     trigger ok
msp430:adc12:     sampling on config 0 hw_channel 1 (adc12_input_01) [402627]
msp430:adc12:     sample for input channel 1 - data/data2.dat
msp430:adc12:     convert = 0x0000 (0) 
msp430:adc12:     store sample in ADC12MEM0
msp430:adc12: mode repeat, go to wait_trigger
msp430:adc12:     trigger ok
msp430:adc12:     sampling on config 0 hw_channel 1 (adc12_input_01) [429291]
msp430:adc12:     sample for input channel 1 - data/data2.dat
[...]
	
      

Figure III.1. ADC12 command line option using HW channels 1 and 2 on two separate files


2. Traces and VCD files

Traces can be used when precise latency and frequency parameters are to be estimated. To use traces the simulation mode has to be modified using the command line option --trace=[wsim.trc] where wsim.trc is the filename of the output traces.

Value Change Dump (VCD) trace files and several other format can generated from traces. VCD files are often used to asses the quality of the emmbedded application. Traces can be used to monitor synchronization points between adc12 samples and other peripherals. Latency interrupt is very easily measured using the gtkwave program. The next two figures show a sample application on the adc12 for which the intr_num line corresponds to the IRQ.7 generated at each sample. Interrupt latency can be preceisely measured using the gtkwave timeline. Differences between the two figures are due to the reference clock modification for the MCLK frequency settings. The first version is too slow to handle the ADC sampling rate while the second one can keep up with it.

GtkWave output of WSim traces including IRQ.7, GIE and Main clock frequencies for the test program using a MCLK reference clock at 750kHz (msp430 default)

Figure III.2. GtkWave output of WSim traces including IRQ.7, GIE and Main clock frequencies for the test program using a MCLK reference clock at 750kHz (msp430 default)


GtkWave output of WSim traces including IRQ.7, GIE and Main clock frequencies for the test program using a MCLK reference clock à 8MHz.

Figure III.3. GtkWave output of WSim traces including IRQ.7, GIE and Main clock frequencies for the test program using a MCLK reference clock à 8MHz.