v4.80 bèta: wrong unit of rom size in logfile (and IDE)

Beta Testing discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

v4.80 bèta: wrong unit of rom size in logfile (and IDE)

#1 Post by Dany » 24 May 2011 09:57

Hi, after compiling a project with a P24FJ64GA002 (64 kBytes ROM),

* the romsize outcome in both the IDE (compiler messages) and the logfile show "bytes" in stead of "words".
hint: 0 1144 Used ROM (bytes): 1286 (3%) Free ROM (bytes): 42742 (97%) Used ROM (bytes): 1286 (3%) Free ROM (bytes): 42742 (97%)
The total romsize is 64Kbytes, but the sum of "used" and "free" is 44028, much less than 64K.

In reality the romsizes given are some kind of "words", not "bytes". Please correct this by mentioning the correct amount of bytes or change the unit from "bytes" to "words" (a word is not 2 bytes here!).
Additionally: the datasheet mentions the P24FJ64GA002 to have 22K words of Rom. This means the value shown by the compiler is an "unknown" unit, not equal to program "words" nor "bytes". :?

* In the logfile and the IDE message window the used and free values are mentioned twice.

* I have seen both above phenomena before (and signalled them in the mP PRO forums).
I am worried and surprised to see them again in the mP dsPic compiler... :? :? I hope sincerely that remarks
made for one compiler also be checked (and corrected if necessary) for other compilers.


[edited] About rom size:
Each "instruction word" is 3 bytes, in 2 addresses (each address holds a word -2 bytes-, but the high order byte of the odd addresses are not used).
So, this means 3/2 bytes per rom address. If the romsize is calculated according this "type" (taking into account "addresses" = 1.5 byte/address) then the mE calculation is correct: 44028 * 1.5 = 66042 bytes.

In the MircoChip method (22K "words"), the "instruction word" size is used: 3 bytes per word. This gives 22 * 3 = 66000 bytes (I assume the "22k" is 22 * 1000, and not 22 * 1024).
Sigh. :shock: :?
Last edited by Dany on 31 May 2014 17:39, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

User avatar
slavisa.zlatanovic
mikroElektronika team
Posts: 1321
Joined: 07 Apr 2009 09:39

Re: v4.80 bèta: wrong unit of rom size in logfile (and IDE)

#2 Post by slavisa.zlatanovic » 26 May 2011 14:34

Hi!
So, this means 3/2 bytes per rom address. If the romsize is calculated according this "type" (taking into account "addresses" = 1.5 byte/address) then the mE calculation is correct: 44028 * 1.5 = 66042 bytes.
This is an issue already discussed here at this forum. It was a developers decision to implement such method of calculating the ROM size used/available.
Best regards
Slavisa

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: v4.80 bèta: wrong unit of rom size in logfile (and IDE)

#3 Post by Dany » 26 May 2011 18:18

slavisa.zlatanovic wrote:Hi!
So, this means 3/2 bytes per rom address. If the romsize is calculated according this "type" (taking into account "addresses" = 1.5 byte/address) then the mE calculation is correct: 44028 * 1.5 = 66042 bytes.
This is an issue already discussed here at this forum. It was a developers decision to implement such method of calculating the ROM size used/available.
Thanks.

No problem with that decision, this seems fair, but then nevertheless the unit of romsize is not "bytes" as the IDE says (the unit is then "one_and_a_half" bytes), you will have to invent a new unit of romsize name :shock: .
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: v4.80 bèta: wrong unit of rom size in logfile (and IDE)

#4 Post by Dany » 10 Jul 2011 09:32

There a in fact 3 possibilities to solve the inconsistence, either
- the number shown has to be changed (showing really the number of "bytes"), or
- the unit of the number has to be changed in a newly to invent unit (one and a half bytes), or
- the number has to be changed in (usedaddresses/2) and the unit has to be changed in "program words"

I do prefer the first one, the latter is used by the mikroProg suite.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 Beta Testing”