Commit Graph

6 Commits

Author SHA1 Message Date
Greg Hewgill
15e174c02a rename --ui switch to --bus 2011-08-19 20:30:55 +12:00
Greg Hewgill
c9c609be1d Separate CPU core and UI processes
This is a first step toward separating the CPU core and UI.  The UI program
starts the CPU core as a subprocess and communicates through its standard input
and output. The protocol is deliberately simple at this point. Each bus request
from the core is exactly eight bytes:

    +-------------------------+
    | cpu cycle counter high  |
    +-------------------------+
    | cpu cycle counter       |
    +-------------------------+
    | cpu cycle counter       |
    +-------------------------+
    | cpu cycle counter low   |
    +-------------------------+
    | 0x00=read / 0x01=write  |
    +-------------------------+
    | address high            |
    +-------------------------+
    | address low             |
    +-------------------------+
    | value (unused for read) |
    +-------------------------+

A single-byte response from the UI is required for a read request, and a
response must not be sent for a write request.

The above protocol is expected to change. For example:

    - the UI should tell the CPU core which address ranges are of interest
    - needs ability to send memory images to the core (both ROM and RAM)

The stream communications is currently buggy because it expects that all eight
bytes will be read when requested (that is, partial reads are not handled). In
practice, this seems to work okay for the moment.

To improve portability, it may be better to communicate over TCP sockets
instead of stdin/stdout.
2011-08-16 12:54:23 +12:00
James Tauber
35c0e69991 pass in None for cycles so tests run 2011-08-15 00:26:52 -04:00
James Tauber
2e34927e7c got tests working again after memory refactor 2011-08-13 04:00:40 -04:00
James Tauber
44099ae4f2 improved implementation of indirect bug across page boundaries including indexed indirects as well 2011-08-07 01:22:48 -04:00
James Tauber
044c86325c added unit tests 2011-08-07 00:39:53 -04:00