How to simulate eTPU in the Codewarrior for eTPU?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to simulate eTPU in the Codewarrior for eTPU?

Jump to solution
405 Views
demian91
Contributor III

First im trying to understand the memory according to the default.lcf file and the debug view:

 

MEMORY {
// Data addresses 0-7 are resererved for internal compiler use
DATA (RW) : ORIGIN = d:0x20, LENGTH = 0 // Initialized data
BSS (RW) : ORIGIN = AFTER(DATA), LENGTH = 0 // Uninitialized data
ENGINE() :ORIGIN = 0, LENGTH = 0 // Engine
ETPU_INFO() : ORIGIN = 0, LENGTH = 0 // Internal compiler info - don't remove this line
ENTRY_TABLE(R) : ORIGIN = c:0, LENGTH = 0 // Entry table
TEXT (RX) : ORIGIN = 0x400, LENGTH = 0 // Code
}
SECTION {
...
_STACK_START = 0x1000;
}

 

What means the letters of origins of memory segment, d:0x20 and c:0? Where i can see information for that?

Where are each section when i debug for simulation? The sections that i try to locate are:

  • Internal compilator: the range [0x0000, 0x0020].
  • Registers: The location of registers i can see that his range seems that is [0x0000, 0x09FB]. That conflicts with the internal compilator, or is temporal?
  • Global and Data Ram: d:0x20 to infinite. I suppose that it ends in 0x1820 if i have 6KBytes available.
  • Stack: i dont sure where is but it seems that start in 0x1000 and it grows upward. But the function write_engine_relative_base_addr sets the ERBA with the value 0x200, it results that the ERBA field is 0x100? the ERBA field has 5 bits so the maximum value is 0x1F? i have a conflict with this.
  • Entry table: according with the init.tcl file, It sets with the function write_entry_table_base_addr in 0x0000 before de code.
  • Code: The code starts in 0x400.

You can see the ram data and code in the memory tab when you debug?

0 Kudos
1 Solution
341 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Actually it is stated in the manual:

davidtosenovjan_0-1662126126765.png

 

View solution in original post

4 Replies
371 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

“c:” and ”d:” stands for CODE and DATA

For rest, let me check it.

0 Kudos
364 Views
demian91
Contributor III

Thanks for answer, i could understand better the memory when i see that the Debug has the tab Memory Browser that divide into Ram, Code and Registers because the tab memory seems that only show the Ram section. For now, my doubt is for the stack where in the file lpm_default.lcf is written

_STACK_START = 0x1000.

But it seems that the procedure "write_engine_relative_base_addr" sets the position for ram memory for the stack finally. Also i have the doubt for the memory [0x00, 0x1F] that use the internal compiler, what section use the 32 bytes? Is only for the debug?

0 Kudos
342 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Actually it is stated in the manual:

davidtosenovjan_0-1662126126765.png

 

348 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

32 bytes of data are are used by eTPU compiler. So it should be not touched. Unfortunately I haven't found any further description.

0 Kudos