Subject:
|
Re: RCX Replacement Firmware
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 8 Nov 2004 02:52:14 GMT
|
Viewed:
|
1232 times
|
| |
| |
"Philippe Hurbain" <philohome@free.fr> wrote in message
news:I6t5LD.1C8J@lugnet.com...
> > I have two versions of firmware . One operates ten times faster than
> > Lego's firmware and the other runs 100 times faster. It is the 10X
> > version that is ready for testing;
>
> Hello Dick,
>
> That sounds great, almost too good to be true (especially for the 100x
> version!)
Replacement firmware is up to 100 times faster than the Lego supplied
firmware. Lego firmware typically takes 3.2 milliseconds per opcode. In
enhanced firmware (100X version), a no-op (opcode 0x10) opcode takes
less than 10 microseconds to execute! New firmware interprets 16-bit add
or subtract opcodes in under 30 microseconds. 16-bit conditional branch
opcodes take 50 - 80 microseconds. Real-life measurements taken from
live firmware. Time for opcode execution includes all operating system
overhead (scheduler, sensor handling, LCD updates, interrupts, etc).
Typical performance appears to be 20,000 - 35,000 interpreter opcodes
executed per second; these are actual measurements from a variety of
sample programs. Standard Lego firmware does just over 300.
The performance improvements come from:
- Standard Lego firmware appears to use multiple levels of data
abstraction to "hide" data between different modules. Overkill for this
small application and lots of real time loss through procedure calls to
get at data that could be stored in an EXTERN variable.
- Selective coding of a few high-runner routines in hand-optimized
assembler to get the best performance. The critical routine is the one
that converts interpreter variables into actual values.
- Extremely efficient task scheduler compared to standard firmware.
Standard firmware interpreter executes one opcode and then relinquishes
control to other OS tasks. When opcode interpreter is given next time
slice, it moves to next task and tries to execute one opcode; I think it
'burns' a time slice to every task even if that task is inactive. I'm
guessing well over 2/3 of the time spent executing an opcode is in the
scheduling overhead. Enhanced firmware (100X) can be configured to
interpret several opcodes in a single task timeslice; it does not 'waste'
timeslices on interpreter tasks not able to run.
- Use of the Hitachi / Renesas tool chain for development. I found these
tools to be far more efficient than GCC and others in both the size of
generated code and its real time performance.
>
>
> Would you have also a modified NQC version to enable new features?
No. But I'm very willing to work with NQC development team (John?) on
making it happen. The obvious first step is to expand the number of
variables supported. [I use Microsoft Visual Studio tools and have not
used GCC for PC program development].
I am working on a NQH header file that will provide the #defines to
enable some of the new functionality like 1 millisecond timing. It
should be ready in a few days.
I also have my own home grown IDE that supports the new firmware
functionality. It's something I plan to review / announce in the next
few weeks.
|
|
Message has 2 Replies: | | Re: RCX Replacement Firmware
|
| (...) I hope you didn't took the "too good to be true" as a criticism - it was only an amazement mark!. BTW, is the 10x version a slow down of 100x one, or is it an older, less optimized version? (once again, I'm not criticizing, I fairly well (...) (20 years ago, 8-Nov-04, to lugnet.robotics)
| | | Re: RCX Replacement Firmware
|
| Hi Dick, Congratulations on your fabulous effort! I'm always pleased to find out about people who can get down and dirty at the hardware/software interface. Had you thought about the community developing a test plan for verifying LEGO firmware? (...) (20 years ago, 8-Nov-04, to lugnet.robotics)
|
Message is in Reply To:
| | Re: RCX Replacement Firmware
|
| (...) Hello Dick, That sounds great, almost too good to be true (especially for the 100x version!) Would you have also a modified NQC version to enable new features? Philo (20 years ago, 7-Nov-04, to lugnet.robotics)
|
13 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|