Re: Crim and the P21/F21
- To: misc
- Subject: Re: Crim and the P21/F21
- From: Jeff Fox <fox@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Jul 2000 09:04:44 -0700
- Organization: UltraTechnology
- References: <200007200719.EAA10714@ipanema.inx.com.br>
Dear MISC readers:
Eduardo Nahum Ochs wrote:
> so I have very little experience with it... Would it be easy to change
> the P21 eForth to make it communicate through a simulated serial line,
> to make the interface of the emulator trivial?
The approach I took in the original P21 simulator was to
assign an unused CPU opcode to be keyboard input and another
to be keyboard status. I just passed the events from DOS
via these special instructions.
The approach I took in simulators at iTV and what was done
on the emulator is that the actual board level interfaces
were emulated. That is certain pport pins were connected
to certain modem status lines and data lines. The
emulation software passed the signals from the PC into
the simulated pport pins. The I/O coprocessors were
also emulated. So if you point the serial output coprocessor
at data and turn it on via a bit in a control register
the emulator would recognize this and do it with the
PC serial hardware. We read scan code from the keyboard
this way, and serial I/O this way. It meant that the
emulators could run actual ROMs made for read boards
and handle I/O with exactly the same software on the
emulator that runs on the actual chips.
The latest variation on this theme was adding some
words to the emulator to emulate the level interface
to a mouse ball and to mouse buttons. It is just
a matter of adding code to support whatever custom
external hardware you plan to connect up to the chip.
These sorts of changes could be made to the original
P21 simulator but it would easier and more productive
to modify the F21 simulator to do a full P21. Since
P21 has only video output hardware you would have
to add support for whatever I/O hardware you plan
to add to your P21 system such as a serial port.
One version of the simulator written for win32Forth
simulated the serial port via Windows message passing.
This allowed multiple copies of the simulator to
be run at once and have them talk to each other
over their simulated serial lines. It was handy
for debugging the TCP/IP protocol code. It would
also be handy for debugging networked multiprocessor
configurations.
> And what about OK?
What about it? OK was provided as an example on MuP21
as well as being used by Chuck as the platform for OKAD
on a PC. OK runs on the p21 simulator at the present time.
Jeff Fox