hi
in the last version of Proteus, 8.17SP4, I open the sample project: DHT22 Low Cost Humidity Sensor & PIC18
and I try the last xc8 compiler 2.50 in various optimization levels by applying the Top patch or the xclm-hack.exe or the XC8Fs.lic from the last post of patchjack.
To make Proteus consistent with the xc8.exe optimization options, I modified the xc8.xml (C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\VSM Studio\compilers\xc8.xml) from this:
<OPTION NAME="--opt=" DESC="Optimization options" PARAM="CHOICE">
<PARAM VALUE="1" DESC="Level 1"/>
<PARAM VALUE="2" DESC="Level 2"/>
<PARAM VALUE="3" DESC="Level 3"/>
<PARAM VALUE="4" DESC="Level 4"/>
<PARAM VALUE="5" DESC="Level 5"/>
<PARAM VALUE="6" DESC="Level 6"/>
<PARAM VALUE="7" DESC="Level 7"/>
<PARAM VALUE="8" DESC="Level 8"/>
<PARAM VALUE="9" DESC="Level 9"/>
<PARAM VALUE="asm" DESC="Optimize asm code generated from C"/>
<PARAM VALUE="asmfile" DESC="Optimize assembler files"/>
<PARAM VALUE="speed" DESC="Favor code generation for speed over space"/>
<PARAM VALUE="space" DESC="Favor code generation for space over speed"/>
<PARAM VALUE="all" DESC="All"/>
<PARAM VALUE="none" DESC="None"/>
<PARAM VALUE="default" DESC="Default" DEFAULT="1"/>
</OPTION>
to this:
<OPTION NAME="--opt=" DESC="Optimization options" PARAM="CHOICE">
<PARAM VALUE="1" DESC="Level 1"/>
<PARAM VALUE="2" DESC="Level 2"/>
<PARAM VALUE="3" DESC="speed over space PRO"/>
<PARAM VALUE="local" DESC="Localized optimizations"/>
<PARAM VALUE="asmfile" DESC="Optimize assembler files"/>
<PARAM VALUE="g" DESC="Favor code accurate debug"/>
<PARAM VALUE="s" DESC="space over speed PRO"/>
<PARAM VALUE="all" DESC="All the above"/>
<PARAM VALUE="none" DESC="None of the above"/>
<PARAM VALUE="default" DESC="Default" DEFAULT="2"/>
</OPTION>
Each time, I changed the optimization parameter only in the linker (LD) tool, since I had first added the --opt option. In the compiler (CC) and assembler (ASM) tool you don't need to add the --opt option.
I got the following results:
with the xclm-hack.exe & Top patch
none: Program space used 978h ( 2424) of 8000h bytes ( 7.4%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
1: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
2: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
3: Program space used 722h ( 1826) of 8000h bytes ( 5.6%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
g: Program space used 978h ( 2424) of 8000h bytes ( 7.4%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
s: Program space used 6D2h ( 1746) of 8000h bytes ( 5.3%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
local: Program space used B10h ( 2832) of 8000h bytes ( 8.6%)
Data space used 5Dh ( 93) of 600h bytes ( 6.1%)
asmfile: Program space used 978h ( 2424) of 8000h bytes ( 7.4%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
all: Program space used 858h ( 2136) of 8000h bytes ( 6.5%)
Data space used 5Dh ( 93) of 600h bytes ( 6.1%)
with XC8Fs.lic
none: Program space used 978h ( 2424) of 8000h bytes ( 7.4%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
1: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
2: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
3: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
g: Program space used 978h ( 2424) of 8000h bytes ( 7.4%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
s: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
local: Program space used B10h ( 2832) of 8000h bytes ( 8.6%)
Data space used 5Dh ( 93) of 600h bytes ( 6.1%)
asmfile: Program space used 978h ( 2424) of 8000h bytes ( 7.4%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
all: Program space used 7A6h ( 1958) of 8000h bytes ( 6.0%)
Data space used 5Ah ( 90) of 600h bytes ( 5.9%)
regards
mitsos
71
on: August 31, 2024, 03:54:52 15:54
|
||
Started by metal - Last post by mitsos | ||
72
on: August 31, 2024, 04:53:21 04:53
|
||
Started by metal - Last post by patchjack | ||
I Request XC8 Functional Safety Compiler Evaluation License. For a 15-day evaluation license.
Add this license to the License path folder C:\ProgramData\Microchip\xclm\license. 2.46 and 2.49 generate exactly the same object code. 2.49 is Functional Safety Compiler. 2.50 is the latest version. The generated object code is different from the first two. The generated object code is smaller. I no longer pursue the feature safety version. Because it just has one more functional safety certificate. Attached is a detailed comparison. |
73
on: August 28, 2024, 03:51:59 15:51
|
||
Started by metal - Last post by Manuel | ||
I understand your point of view, but consider that many application just accept industrial level product.
Anyhow, the PY32L020 is quite nice, but missing some peripheral. take care, X! |
74
on: August 28, 2024, 03:08:27 15:08
|
||
Started by metal - Last post by Mr. Spock | ||
Just wondering why people still use PIC 8 bits when you can get an ARM Cortex-M0 PY32F002A (SSOP20) from PUYA for US$0.075
|
75
on: August 26, 2024, 07:13:26 19:13
|
||
Started by microstick - Last post by microstick | ||
Hi,
Can you any body help me with schematics for the NI 9244 or similar ? Thank you in advance |
76
on: August 26, 2024, 11:11:16 11:11
|
||
Started by metal - Last post by Manuel | ||
Updated to v2.50.
Xo! |
77
on: August 26, 2024, 02:09:46 02:09
|
||
Started by chicowood - Last post by chicowood | ||
Hi mitsos
Quote is there a way to do this in the source file by adding the correct instructions? the #pragma ..... is not working at me This goes back 4 years so I apologize, my memory isn't the best...I'm still using the Arduino UNO-based EV J1850 charge controller I built with this project, but can barely remember the details of how I put it together Pulling up the old files, I see I was using both the Windows and MacOS versions of the Arduino IDE during development (I usually run Proteus under Windows on Parallels on a Mac). My most recent sketch that includes the lines "#pragma GCC optimize ("-O0")" and "#pragma GCC push_options" still compiles ok. Kind of rare to have something survive 4 years of tool chain changes! The compiler running on the Mac appears to be the one I used in the final stages of the project. It is the GCC AVR compiler. Here's a snippet of the compiler output from the Arduino IDE to show the compiler version: Code: Compiling core... As I recall I found the #pragma commands in the compiler documentation and they worked as expected. It's possible that the compiler on your Windows installation is different than the one on my Mac installation? I'm sure you know the following but I post it for anyone else who may be interested: (From Wikipedia) In C, the #pragma directive is a special purpose directive that is used to turn on or off some features. #pragma also allows us to provide some additional information or instructions to the compiler. It is compiler-specific i.e., the behavior of pragma directive varies from compiler to compiler. I hope that's helpful. Let me know if you would like any other info from this project... chico |
78
on: August 25, 2024, 10:35:38 10:35
|
||
Started by chicowood - Last post by mitsos | ||
hi
in IDE 1.8.19, the only way to change optimization level to -O0 or -Og for best debugging in Proteus, is to edit the platform.txt (you can find this here C:\Users\user_name\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4\platform.txt) and change the three options -Os in the following lines compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11....... compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11..... is there a way to do this in the source file by adding the correct instructions? the #pragma ..... is not working at me regards mitsos |
79
on: August 23, 2024, 07:12:26 19:12
|
||||||
Started by rommel100 - Last post by rommel100 | ||||||
|
80
on: August 22, 2024, 08:26:53 08:26
|
||||||
Started by flipper - Last post by flipper | ||||||
|