Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360296 - Incorrect memory page attribute handling in Utils.checkFit
Summary: Incorrect memory page attribute handling in Utils.checkFit
Status: CLOSED FIXED
Alias: None
Product: RTSC
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Sasha Slijepcevic CLA
QA Contact:
URL:
Whiteboard: target:3.23
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 20:02 EDT by Ramsey Harris CLA
Modified: 2012-01-23 21:00 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ramsey Harris CLA 2011-10-07 20:02:03 EDT
In xdc.platform.Utils.xs: checkFit(), the handling of the memory page attribute is not quite right. For internal memory, if the page attribute is defined by the platform, then it must be enforced. However, for external memory, the memory map should be allowed to set the page attribute as needed. This is required to create memory areas which can be used for either code or data. The current implementation restricts all of external memory to code, no data can be placed in external memory.

In addition, the checkFit() function simply returns T/F, there is no way to provide a detailed error message such that the user can distinguish errors from incorrect fit vs. incorrect page attributes.

See my xdc-x21x tree for a fix to this function for both issues above.
Comment 1 Sasha Slijepcevic CLA 2011-11-08 17:05:02 EST
The outcome of the work on this bug is that the improvement in error messages from Ramsey's xdc-x21x tree are added in xdc-y08. The handling of the 'page' attribute is little bit more lenient now, and an error is generated only if both a physical memory object and a custom memory object specify 'page' and the values are different. Previously we assumed that undefined 'page' means 'page'==0, so if one object defines 'page'=1 and another has 'page' undefined, an error was generated. The new code lets that case go through.

Also in xdc-y08, I added an environment property 'xdc.platform.custom.check'. If that property is undefined or set to 'true', we check the custom memory map against the physical memory. If it's set to 'false', the check is prevented.
Comment 2 Vikram Adiga CLA 2011-12-12 17:22:10 EST
Verified this to be working correctly on

XDC product: 3.23.00.33



I verified the following cases :



Page attribute test: Created custom memory for platforms (sim470xx and sim28xx) to check

   a) physical memory object and custom memory object having page attribute but have different values generates an error.
   
   Error generated:

   error: ti.platforms.sim28xx.Platform: "<PATH>/Linux/xdctools_3_23_00_33/packages/xdc/platform/Utils.xs", line 374: ti.platforms.sim28xx.Platform.Instance#0/customMemoryMap/'MEM2' : Memory object MEM2 has an invalid 'page' attribute.

   b) if one object defines 'page'=1 and another has 'page' undefined, no error was generated



Custom check property test: Created custom memory for platforms (sim470xx and sim28xx) to check

   a)When property is 'true' or undefined, custom memory map is tested and error is generated for wrong memory maps.

    Error generated:

error: ti.platforms.sim470xx.Platform: "<PATH>/xdctools_3_23_00_33/packages/xdc/platform/Utils.xs", line 365: ti.platforms.sim470xx.Platform.Instance#0/customMemoryMap/'MEM1' : Memory object MEM1 does not fit into any physical memory bank.
 
    b) When property is false, there is no check.
Comment 3 Dave Russo CLA 2012-01-23 21:00:06 EST
shipped in xdctools 3.23.00.33