Failed to allocate region in address page for virtual memory .vpram_ovly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Failed to allocate region in address page for virtual memory .vpram_ovly

4,030 Views
xuedongyang
Contributor II

Hi, experts,

I got the compiling error (see attached) after replacing an assembly function with another assembly function. However, when I add some codes, the compiling error is gone. I can run the program and get the expected results. But after I remove those added codes, the compiling error will appear again.

I know that it is hard to get the answer from experts for the root cause of the problem. But I just would like to get some high level guidance/instruction, regarding how to debug such problem, like if I need to check certain section size, function size, and so on, and how to check.

Thanks,

Xuedong

0 Kudos
14 Replies

3,941 Views
xuedongyang
Contributor II

I am able to capture the map file, compiling log, and LCF files for good case and bad case. Both assembly functions are used/called in the good and bad cases.

Thanks!

0 Kudos

3,938 Views
yipingwang
NXP TechSupport
NXP TechSupport

in bad map, VCPU PMEM has 64KB free, I'm suspecting one of your overlay code section is too large (>64KB) so the linker  can't place it in the available 64KB

;*********************************************************************************

;Memory map:

;                Address space with id 0:

;    r-x |0x00000000..0x0000ffff|  memory .vpram (65536 bytes)

;        |0x00010000..0x0001ffff|  memory free space  (65536 bytes)

;*********************************************************************************

 

From your good map, the 6 overlay sections are listed as below. For example .pebm_code_du_ul_c (61880 bytes) , if you added more code in this section its size would be increased and >64KB

;*********************************************************************************

;                Address space with id 4:

;        |0x00000000..0xe037ffff|  memory free space  (3761766400 bytes)

;    r-x |0xe0380000..0xe0381297|  memory .pebm_code_du_ul_a (4760 bytes)

...

;    r-x |0xe0381400..0xe0381f6f|  memory .pebm_code_du_ul_b (2928 bytes)

;    r-x |0xe0381f70..0xe0391127|  memory .pebm_code_du_ul_c (61880 bytes)

...

;    r-x |0xe0394f00..0xe039afc7|  memory .pebm_code_du_dl_a (24776 bytes)

;    r-x |0xe039afc8..0xe039be47|  memory .pebm_code_du_dl_b (3712 bytes)

;    r-x |0xe039be48..0xe039d0df|  memory .pebm_code_du_dl_c (4760 bytes)

0 Kudos

3,908 Views
xuedongyang
Contributor II

Do you have conclusion what is the cause of the compiler issue? And do you have suggestions what we need to do, if we need the 2 functions in our code, to avoid the compiler issue?

Now we have to remove 1 function (acutally replace all the function calls using only one of the 2 functions).

Thanks.

0 Kudos

3,885 Views
yipingwang
NXP TechSupport
NXP TechSupport

your .vpram_ovly  is almost full , I suspect some small functions are inlined into the caller by compiler which increases code size,

 

for example ,

cpe_du_pusch_dmrs_process_single()

{

...

...

    chestNonAlign();         <-- chestNonAlign() may be inlined here

...

...

}

 

can you try adding the -inline noauto building option in your project (as attached, in Properties--> setting)?  this option tells compiler not to auto inline small functions

0 Kudos

3,802 Views
xuedongyang
Contributor II

Yes, it works with your suggestion. Thanks a lot.

Before we close the issue, just want to double-check with you about the pro and con for the solution:

My understanding is that if we use "-inline noauto" option when compiling, the small functions are not going to be put inline. In other words, they will be called as a function, which is located in somewhere else, but not in the overlay memory. It will help us avoid the overlay error when compiling. It also means that the execution time of the code will get a little bit longer, due to the context switch from function call (parameter passing, stack operation, etc). It is a trade-off issue between saving program memory and saving execution time. Correct?

Thank you again for your suggestion. Very helpful.

0 Kudos

3,801 Views
xuedongyang
Contributor II

BTW, attached is the compiler option we are using. Can you help to check if it looks good? With addition of "-inline noauto", we don't see the "overlay issue" any more.

Thanks.

0 Kudos

3,958 Views
xuedongyang
Contributor II

By the way, how can I see how much free space is left for .text section from the map file?

0 Kudos

3,952 Views
yipingwang
NXP TechSupport
NXP TechSupport

when building project, there is a panel named 'console' in which shows the building log, it's also where building error is printed.

 

In map file you can see below Memory map showing .vpram and .vpram_ovly and free space.

 

;*********************************************************************************

;Memory map:

;                Address space with id 0:

;    r-x |0x00000000..0x0000ff3f|  memory .vpram (65344 bytes)

;    r-x |0x0000ff40..0x0001f0e7|  memory .vpram_ovly (61864 bytes)

;        |0x0001f0e8..0x0001ffff|  memory free space  (3864 bytes)

;*********************************************************************************

0 Kudos

3,958 Views
xuedongyang
Contributor II

Thank you for checking!

Yes, both functions are small functions. I did not change the 2 functions at all. Looks like we have free space to hold both functions. Probably some other reasons....

Every time I did clean build. I click "Clean(All)" and click "Build (All)" in CW commander window every time I built.

Can you guide me how to collect the complete building log in CW? I will collect it and send it to you.

Thank you!

 

0 Kudos

3,999 Views
xuedongyang
Contributor II

Those assembly functions have different name: _chEst and _chEstNonAlign.The prototypes also look good.

Both functions are in the same .text section, I believe.

The extra code I added does not have call to these assembly functions.

Attached are lcf files and map file when I build the executable and see the compiling error of overlay.

Thanks!

0 Kudos

3,995 Views
yipingwang
NXP TechSupport
NXP TechSupport

So _chEst and _chEstNonAlign are NOT in any overlay section, right?
Still need the map file of the successful building

0 Kudos

4,009 Views
yipingwang
NXP TechSupport
NXP TechSupport

May need customer lcf and map file for analysis.

Are those assembly functions having same name, and prototypes correct?

Are those assembly functions allocated in same text section?

"when I add some codes, the compiling error is gone" --  does this added code have call of the asm function being impacted?

0 Kudos

3,993 Views
xuedongyang
Contributor II

I tried but failed to get successful build with same code modification I made before.

I am not sure if both functions are NOT in any overlay section. Probably you can guide me how to check that. In map file? 

Looking the 2 assembly functions in more detail, I observed that if the both functions are used/called in our code, we got this compiling error. But if I replaced all calling function statements to call only one of the 2 functions, the compiling error is gone. It seems to me that if both functions are needed, the program space is not big enough to hold the two functions. But if only one function is needed, the program space is big enough.

So my question is if we need both functions, how should we do? increase program memory size? how to increase the program memory size?

Attached is the good case map file and lcf files. I replaced all _chEst() call with _chEstNonAlign() call in all calling functions to get the good build.

0 Kudos

3,964 Views
yipingwang
NXP TechSupport
NXP TechSupport

Did you change _chEst() or_chEstNonAlign() ? these two functions are small, and your .vpram has free space to hold both of them. They're in .text , not in overlay section.
Can you clean your project then rebuild (not increment build)?
Can you send your complete building log ?

;*********************************************************************************
;Memory map:
; Address space with id 0:
; r-x |0x00000000..0x0000ff3f| memory .vpram (65344 bytes)
; r-x |0x0000ff40..0x0001f0e7| memory .vpram_ovly (61864 bytes)
; |0x0001f0e8..0x0001ffff| memory free space (3864 bytes)
;*********************************************************************************


0x00007af0 176 Section: .text(Z:/l1software/DU/vspa_common/vspa-lib/bin/la1224/rdb/libvspa-dsp.elb(chEst.eln))
0x00007af0 0 _chEst (run_address 0x00007af0)
0x00007af0 176 _chEstNonAlign (run_address 0x00007af0)


;*MODULE: Z:/l1software/DU/vspa_common/vspa-lib/bin/la1224/rdb/libvspa-dsp.elb(chEst.eln)
;* GLOBAL 160 160 0 _chEst Z:/l1software/DU/vspa_common/vspa-lib/bin/la1224/rdb/libvspa-dsp.elb(chEst.eln)

0 Kudos