SpeedIndex

Processor

The processor on the current BrainStem modules is a Microchip PIC18C252.  It runs at 40MHz.  BrainStem modules include a Microchip 24FC128/256 EEPROM for storage of system data, reflex commands, and VM opcodes.  This EEPROM has an access rate of 1Mbit/sec.  The processor has IIC interface hardware that has a maximum data transfer rate of 1Mbit/sec.

Instruction Execution Rate

Reflex routines and VM programs must retrieve their data from the EEPROM.  This limits the speed of program execution.  The following benchmark TEA program provides a speed estimate.  When compiled, one iteration of the loop requires 13 instructions.  The program runs to completion in roughly 1.4 seconds.  That yields an execution rate of over 9000 instructions per second.

The instruction rate can vary significantly from program to program.  Each VM instruction takes a different amount of time.  Division and stack indexing take far more CPU cycles than simple branch commands and logical operations.  I/O operations can also slow a process considerably because the VM must halt until a pending I/O operation is complete.

In a multitasking application, the processor must switch back and forth between processes.  So a program that runs at 9000 instructions per second may run at only 4500 instructions per second when another process is active.  The other active process will also have its instruction rate cut in half.

Executing a reflex command takes about as much time as executing a VM instruction.  So the maximum execution rate of reflex commands is roughly 9000 per second.  The processor can only execute one reflex command or VM operation at a time.  When several reflexes and/or VM processes are active, the speeds of each process and the response times of each reflex will be slower.  However, due to the nature of reflexive routines, they tend to be inactive most of the time.  Therefore the speed penalties associated with running multiple reflexes are usually much smaller than those associated with running multiple VM processes.


version: 1.0, build 80903
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado.  All rights reserved.