Dear All,
I want to calculate CPU utilization after flashing the s12z micro-controller or after loading the elf in PE debugger.
Please suggest me some tools or ideas that can help me to calculate utilization of S12z micro controller for my costume elf.
Is there any graphical or command line utility available for this ?
Thanks & Regards,
Charudatta
Solved! Go to Solution.
Hi Charudatta,
This feature is not existing.
The chip size (memory map) is giving by the datasheet of the device.
In the project you have a prm file containing the memory mapping.
For instance case of MC9S12ZVML128:
+++++++++++++++++++++++
/* This is a linker parameter file for the MC9S12ZVML128 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
/* Register space */
/* IO_SEG = PAGED 0x000000 TO 0x000FFF; intentionally not defined */
/* RAM */
RAM = READ_WRITE 0x001000 TO 0x002FFF;
/* EEPROM */
EEPROM = READ_ONLY 0x100000 TO 0x1001FF;
/* non-paged FLASHs */
ROM = READ_ONLY 0xFE0000 TO 0xFFFDFF;
/* VECTORS = READ_ONLY 0xFFFE00 TO 0xFFFFFF; intentionally not defined: used for VECTOR commands below */
//OSVECTORS = READ_ONLY 0xFFFE10 TO 0xFFFFFF; /* OSEK interrupt vectors (use your vector.o) */
END
...
+++++++++++++++++++++++
Here the memory mapping is:
RAM = READ_WRITE 0x001000 TO 0x002FFF;
so 0x2000 -> dec: 8192
EEPROM = READ_ONLY 0x100000 TO 0x1001FF;
so 0x200 -> dec: 512
ROM = READ_ONLY 0xFE0000 TO 0xFFFDFF;
so 0x1fe00 -> dec: 130560
Extract of my map file:
*********************************************************************************************
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
---------------------------------------------------------------------------------------------
.init 62 R 0xFE0000 0xFE003D ROM
.startData 27 R 0xFE003E 0xFE0058 ROM
.text 12 R 0xFE0059 0xFE0064 ROM
.copy 4 R 0xFE0065 0xFE0068 ROM
.stack 256 R/W 0x1000 0x10FF RAM
.__absdata_ADC1RBP__ 3 N/I 0x661 0x663 .absSeg0
...
.__absdata__INT_CFADDR__ | 1 N/I | 0x17 | 0x17 .absSeg398 |
.vectSeg399_vect | 3 | R 0xFFFFFD 0xFFFFFF .vectSeg399 |
Summary of section sizes per section type:
READ_ONLY (R): | 6C (dec: | 108) |
READ_WRITE (R/W): | 100 (dec: | 256) |
NO_INIT (N/I): | 1E4 (dec: | 484) |
Here you can quickly compare the memory used by the application vs to the memory available for the device.
What's about your map file ?
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
---------------------------------------------------------------------------------------------
.init 62 R 0xFE0000 0xFE003D ROM
.startData 27 R 0xFE003E 0xFE0058 ROM
.rodata 711 R 0xFE0059 0xFE031F ROM
.text 25370 R 0xFE0320 0xFE6639 ROM
.copy 150 R 0xFE663A 0xFE66CF ROM
PROMID 6 R 0xFFDFFA 0xFFDFFF PROMID_S
.stack 256 R/W 0x1000 0x10FF RAM
.data 162 R/W 0x1100 0x11A1 RAM
...
.bss | 2 R/W | 0x11A2 | 0x11A3 RAM |
.common | 2812 R/W | 0x11A4 | 0x1C9F RAM |
.vectSeg359_vect | 3 | R 0xFFFFFD 0xFFFFFF .vectSeg359 | |
ROM_360 | 96554 | R 0xFE66D0 0xFFDFF9 ROM |
Summary of section sizes per section type:
READ_ONLY (R): | 1E17D (dec: 123261) | |
READ_WRITE (R/W): | CA0 (dec: | 3232) |
NO_INIT (N/I): | 1AE (dec: | 430) |
Here you can determine the memory used by the application.
Check with the prm file to compare it with memory available on device.
Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Pascal,
Thanks for your help.
map file have all information it is difficult to read those information.
I am looking for some GUI utility/Script that can show me the details in more readable format.
but map file does not show the actual uses of S12z Micro-controller while currently executing the elf file on MCU..
For Example in windows task manager you can see actual CPU load/utilization in % while particular application is running.
Thanks & Regards,
Charudatta
Hi Charudatta,
This feature is not existing.
The chip size (memory map) is giving by the datasheet of the device.
In the project you have a prm file containing the memory mapping.
For instance case of MC9S12ZVML128:
+++++++++++++++++++++++
/* This is a linker parameter file for the MC9S12ZVML128 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
/* Register space */
/* IO_SEG = PAGED 0x000000 TO 0x000FFF; intentionally not defined */
/* RAM */
RAM = READ_WRITE 0x001000 TO 0x002FFF;
/* EEPROM */
EEPROM = READ_ONLY 0x100000 TO 0x1001FF;
/* non-paged FLASHs */
ROM = READ_ONLY 0xFE0000 TO 0xFFFDFF;
/* VECTORS = READ_ONLY 0xFFFE00 TO 0xFFFFFF; intentionally not defined: used for VECTOR commands below */
//OSVECTORS = READ_ONLY 0xFFFE10 TO 0xFFFFFF; /* OSEK interrupt vectors (use your vector.o) */
END
...
+++++++++++++++++++++++
Here the memory mapping is:
RAM = READ_WRITE 0x001000 TO 0x002FFF;
so 0x2000 -> dec: 8192
EEPROM = READ_ONLY 0x100000 TO 0x1001FF;
so 0x200 -> dec: 512
ROM = READ_ONLY 0xFE0000 TO 0xFFFDFF;
so 0x1fe00 -> dec: 130560
Extract of my map file:
*********************************************************************************************
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
---------------------------------------------------------------------------------------------
.init 62 R 0xFE0000 0xFE003D ROM
.startData 27 R 0xFE003E 0xFE0058 ROM
.text 12 R 0xFE0059 0xFE0064 ROM
.copy 4 R 0xFE0065 0xFE0068 ROM
.stack 256 R/W 0x1000 0x10FF RAM
.__absdata_ADC1RBP__ 3 N/I 0x661 0x663 .absSeg0
...
.__absdata__INT_CFADDR__ | 1 N/I | 0x17 | 0x17 .absSeg398 |
.vectSeg399_vect | 3 | R 0xFFFFFD 0xFFFFFF .vectSeg399 |
Summary of section sizes per section type:
READ_ONLY (R): | 6C (dec: | 108) |
READ_WRITE (R/W): | 100 (dec: | 256) |
NO_INIT (N/I): | 1E4 (dec: | 484) |
Here you can quickly compare the memory used by the application vs to the memory available for the device.
What's about your map file ?
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
---------------------------------------------------------------------------------------------
.init 62 R 0xFE0000 0xFE003D ROM
.startData 27 R 0xFE003E 0xFE0058 ROM
.rodata 711 R 0xFE0059 0xFE031F ROM
.text 25370 R 0xFE0320 0xFE6639 ROM
.copy 150 R 0xFE663A 0xFE66CF ROM
PROMID 6 R 0xFFDFFA 0xFFDFFF PROMID_S
.stack 256 R/W 0x1000 0x10FF RAM
.data 162 R/W 0x1100 0x11A1 RAM
...
.bss | 2 R/W | 0x11A2 | 0x11A3 RAM |
.common | 2812 R/W | 0x11A4 | 0x1C9F RAM |
.vectSeg359_vect | 3 | R 0xFFFFFD 0xFFFFFF .vectSeg359 | |
ROM_360 | 96554 | R 0xFE66D0 0xFFDFF9 ROM |
Summary of section sizes per section type:
READ_ONLY (R): | 1E17D (dec: 123261) | |
READ_WRITE (R/W): | CA0 (dec: | 3232) |
NO_INIT (N/I): | 1AE (dec: | 430) |
Here you can determine the memory used by the application.
Check with the prm file to compare it with memory available on device.
Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Charudatta,
The linker generates a map file which gives you all information regarding the application:
You will find more info in the \CW MCU v10.6.4\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf manual.
Refer to the "Smartlinker" Chapter page 35.
Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Pascal,
Thanks for your help.
map file have all information it is difficult to read those information.
I am looking for some GUI utility/Script that can show me the details in more readable format.
but map file does not show the actual uses of S12z Micro-controller while currently executing the elf file on MCU..
For Example in windows task manager you can see actual CPU load/utilization in % while particular application is running.
Thanks & Regards,
Charudatta