Code download time.
Code download time.
Obviously, I'll find this out as soon as I have device and compiler in hand, but I am curious about the program download time for the N-mode devices vs. VM devices. Slightly longer I'm assuming.
-Don Kirby
-Don Kirby
Re: Code download time.
The native devices download about twice as fast. Here's some test data:Don_Kirby wrote:I am curious about the program download time for the N-mode devices vs. VM devices.
[table][mrow] Device[col]Code Size[col]Time
[row]ZX-24a[col]31646[col]~10 sec.
[row]ZX-24n[col]39676[col]~5 sec.
[/table]
The download format for the VM devices is based on the Intel Hex format using 16-byte records so there's a fair amount of overhead involved. Moreover, the data has to be shifted out the the external EEPROM serially.
In contrast, the download format for the native devices contains binary records that are of Flash page size (256 bytes). This means that fewer characters have to be transmitted over the serial link for the same code size.
- Don Kinzer
There is a code explosion for native mode which might be anything from 4 to 1 up to 20 to 1. So byte for byte the VM instructions are more powerful than AVR machine language. My guess is that the same program will nearly always download slower for native mode even though the download speed is actually 2x faster.
On the other hand I'm not sure it really matters that much one way or the other.
On the other hand I'm not sure it really matters that much one way or the other.
Mike Perks
Incidentally, the data in the table above was for the same program compiled for each device. This is an unusual case, however, where 31,553 bytes of the code are for a data table contained in Program Memory. The difference in code size for each case is the actual executable code.mikep wrote:My guess is that the same program will nearly always download slower for native mode even though the download speed is actually 2x faster.
- Don Kinzer
You have obviously never seen me write codespamiam wrote:Hehe, I like that phrase, "code explosion". I visualize a big bang with lots of smoke, and ASM and C statements flying every which way!
The point is that the ZVM instructions are very compact and can express quite powerful concepts in a small number of bytes. For example calling a system function in the VM is at most one byte or two. In AVR C this is a minimum of 4 bytes.
Mike Perks
Re: Code download time.
what serial port speed?dkinzer wrote:The native devices download about twice as fast. Here's some test data:Don_Kirby wrote:I am curious about the program download time for the N-mode devices vs. VM devices.
[table][mrow] Device[col]Code Size[col]Time
[row]ZX-24a[col]31646[col]~10 sec.
[row]ZX-24n[col]39676[col]~5 sec.
[/table]
The download format for the VM devices is based on the Intel Hex format using 16-byte records so there's a fair amount of overhead involved. Moreover, the data has to be shifted out the the external EEPROM serially.
In contrast, the download format for the native devices contains binary records that are of Flash page size (256 bytes). This means that fewer characters have to be transmitted over the serial link for the same code size.
My binary-block mode bootloader for AVRs runs at 57600 or more, with a low bit-rate error crystal.
Re: Code download time.
115.2K baud. At that speed and 40K of code, just sending the data bytes takes about 3.5 seconds. Additional time is required to send address, count, and error checking data, waiting for writes to be performed, and sending acknowledgements.stevech wrote:what serial port speed?
The approximate times that I reported were based on visual observation of a second hand and the download progress output. They could easily be off by a second either way.
- Don Kinzer
The rate is set at 115.2K. There is a protocol for switching to 19.2K baud but neither the IDE nor the zload utility currently implement it. This is the same situation with all other ZX devices.stevech wrote:is the bootloader's baud rate choice user defined? 115K may not work in many situaitons.
Under what circumstances do you believe that problems may arise?
- Don Kinzer
It is fairly easy to implement automatic baudrate detection based on the the bit times of a synch character sent by the host. It is about 100 extra bytes, likely less when coded in ASM.
At least the ability to drop down to 38.4K would be nice. This is because 38.4K has a low error when communicating to AVR devices which run at a multiple of 4MHz (at least it is true for 16Mhz, and 20MHz, and I am presuming the lower rates too).
-Tony
At least the ability to drop down to 38.4K would be nice. This is because 38.4K has a low error when communicating to AVR devices which run at a multiple of 4MHz (at least it is true for 16Mhz, and 20MHz, and I am presuming the lower rates too).
-Tony
Agreedspamiam wrote:It is fairly easy to implement automatic baudrate detection based on the the bit times of a synch character sent by the host. It is about 100 extra bytes, likely less when coded in ASM.
While true I suspect that the native devices will only come with a 14.7456 Mhz crystal as all of the ZBasic library code is built and tested around this frequency.spamiam wrote:At least the ability to drop down to 38.4K would be nice. This is because 38.4K has a low error when communicating to AVR devices which run at a multiple of 4MHz (at least it is true for 16Mhz, and 20MHz, and I am presuming the lower rates too).
Mike Perks