How to simulate eTPU in the Codewarrior for eTPU?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to simulate eTPU in the Codewarrior for eTPU?

跳至解决方案
685 次查看
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 项奖励
1 解答
621 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Actually it is stated in the manual:

davidtosenovjan_0-1662126126765.png

 

在原帖中查看解决方案

4 回复数
651 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

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

For rest, let me check it.

0 项奖励
644 次查看
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 项奖励
622 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Actually it is stated in the manual:

davidtosenovjan_0-1662126126765.png

 

628 次查看
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 项奖励