完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想减少在项目中使用的RAM。我前面有地图文件,但好像没什么帮助。因为我需要找出RAM消耗的变量,并减少数组或结构的大小。假设我需要检查MIN状态变量。映射文件有这样的信息:......_main_status bssBANK0 0000B3......好,我有关于内存中可变物理位置的信息,但是它的大小呢?有没有办法列出变量的列表,以及它们的大小?来自其他井手的连接器支持这个特性,所以我认为MPLAB也会支持这个特性。IDE中是否有这样的特性?提前感谢。
以上来自于百度翻译 以下为原文 I would like to reduce the used RAM in a project. I have the map file in front of me, but it doesn't seem to be much of a help. Because I need to spot the RAM consuming variables and reduce i.e. the size of an array or a structure. So let's say I need to examine the main_status variable. The map file has this information: ......... _main_status bssBANK0 0000B3 ......... So OK I have the information about the variable physical location in memory, but what about its size? Is there a way to have a list of the variables, together with their size? Linkers from other IDE's support this feature, so I thought that MPLAB would support that as well. Is there actually such a feature in the IDE? Thanks in advance. |
|
相关推荐
3个回答
|
|
|
|
|
|
嗨,一般来说,链接器处理来自每个编译单元(源文件)的全局属性,即全局或外部变量和结构、函数入口点和引用。对于本地代码和数据,链接器处理可执行代码的总体大小和布局。一般来说,对于局部变量、数组和结构,链接器处理要初始化的数据区域、为了便于访问而保持在一起的小数据区域和可能必须存储在远处存储器中的大数据区域。如果编译器被请求创建和保存.LIS文件,那么名字和大小的IL信息就在编译器的列表报告文件中。因此,除了映射之外,还可能需要从编译中学习列表文件。但是没有规则没有例外:对于C++之类的语言,部分代码基因。定量分析可能必须推迟到链接器分析了各个部分如何组合在一起,以及需要什么。对于高级优化,一些编译器可以在解决链接依赖关系之后进行代码优化。XC8编译器对PRO版本中的整个程序进行代码生成和优化。除了.lis和.map文件之外,目标文件中的调试信息中还包含信息,因此一些IDE可能还有其他的可能性来呈现报告。
以上来自于百度翻译 以下为原文 Hi, In general, the linker deal with global properties from each compilation unit (source file), That is global or external variables and structures, function entry points and references. For local code and data, the linker deal with total size and placement of the executable code as a black boks. Similarly, for local variables, arrays and structures, the linker deal with data areas to be initialized, small data areas to be kept together for easy access, and big data areas that may have to be stored in far away memory. For structures and arrays that are local, or static within a source file, detail information about names and sizes, is in the listing report file from the compiler, if the compiler was requested to create and keep a .lis file. So you may have to study list files from compilation, in addition to the map. But no rules without exceptions: For languages like C++, parts of code generation may have to be deferred until the linker have analyzed how pieces fit together, and what will be needed. For high levels of optimization, some compilers may do code optimization after linkage dependencies have been resolved. The XC8 compiler do code generation and optimization for the entire program in the PRO version. In addition to .lis and .map files, information is also present in debug information within object files, so some IDE may have additional possibilities to present reports. Regards, Mysil |
|
|
|
Mysil,非常感谢你的详细解释。所以我在lst文件:638,00013C_main_status:639 opt stack 0 640,00013C ds 17中发现了这一点。OK,这是一个进步,我现在可以看到MIN状态变量的大小。但是,是否有一个地方,所有的变量都被列在另一个下面,旁边的大小?我知道现在我有一个可靠的解决方案要研究(lst文件),但是我只是想知道是否能够让我的生活更轻松,就像我习惯了我正在使用的其他编译器一样。
以上来自于百度翻译 以下为原文 @Mysil thank you so much for the detailed explanation. So I found this inside the lst file: 638 00013C _main_status: 639 opt stack 0 640 00013C ds 17 This is what you are talking about? OK that's a progress, I can now see the main_status variable size. But is there a place where all the variables are listed one below the other with the size next to them? I know that I now have a solid solution to look into (lst file), but I was just wondering if I can make my life easier, like I'm used to the other compilers I am using. |
|
|
|
只有小组成员才能发言,加入小组>>
5243 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3208 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2258 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 22:08 , Processed in 1.204745 second(s), Total 51, Slave 44 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号