fdhwlib  2.0.25
Pbus Simulation Mode - Simulating the real hardware

by mapping the address space to a piece of memory

The simulation mode is intended to allow testing without being connected to the real FD Electronics. The first approach used a certain amount of memory. Cutting the address down to the last significant part. This method allowed some general but very limited tests. Some registers use same address and so data is mixed. Writing to special addresses at the real electronic causes side effects (broadcast, page controller, ...).

To improve simulation mode simulation

  • a larger amount of memory was allocated (now 4MB) and every register and memory block was mapped to a unique address in this memory (Pbus::simAddress).
  • Side effects are considered: For the Flt the broadcast commands are implemented, for the Slt the command registers that may change the state of the system are implemented (Pbus::simWrite).

The simulation mode under MS Windows is restricted to a single process. But the pbusdaemon can be used to allow more than one program to access the simulated electronic. This is necessary as beside the program that should be tested, other programs for diagnose and emulation of the electronics (e.g. generating events) are necessary. Under Linux a shared memory segment is used. All programs compiled for simulation will automatically use the same shared memory segment.

Todo:
Move the IR handling in simulation mode to the control class. The Pbus class should only contain the standard interface.