fdhwlib  2.0.25
PbusSim Class Reference

#include <pbussim.h>

Inheritance diagram for PbusSim:
PbusImp

List of all members.

Public Member Functions

Static Public Member Functions

Static Protected Attributes


Detailed Description

Pbus interface from simulation.

Only the framework (semaphores) - no real operation

14:53:55>ramspeed
              Access         N     T [s]    Rate [kB/s]  T_access [us]
    Read from Memory    163840     0.530       603773.6            3.2
   Pbus::readBlock()    163840     0.509       628683.7            3.1
    Read with Offset     40960     0.534       149812.7           13.0
  Read single access    163840     0.528         1212.1            3.2
14:54:08>

Simulation - Operation in the shared memory (PbusSim)

14:57:50>ramspeed
              Access         N     T [s]    Rate [kB/s]  T_access [us]
    Read from Memory     81920     0.569       281195.1            6.9
   Pbus::readBlock()     81920     0.564       283687.9            6.9
    Read with Offset     40960     0.798       100250.6           19.5
  Read single access    163840     0.578         1107.3            3.5
14:58:05>ramspeed
              Access         N     T [s]    Rate [kB/s]  T_access [us]
    Read from Memory     81920     0.568       281690.1            6.9
   Pbus::readBlock()     81920     0.562       284697.5            6.9
    Read with Offset     40960     0.804        99502.5           19.6
  Read single access    163840     0.583         1097.8            3.6
14:58:20>

Simulation - Operation in the memory of the Microenbale (PbusTest)

15:01:17>ramspeed
              Access         N     T [s]    Rate [kB/s]  T_access [us]
    Read from Memory      1280     0.721         3467.4          563.3
   Pbus::readBlock()      1280     0.716         3491.6          559.4
    Read with Offset       640     0.549         2276.9          857.8
  Read single access    163840     0.759          843.2            4.6
15:01:31>ramspeed
              Access         N     T [s]    Rate [kB/s]  T_access [us]
    Read from Memory      1280     0.719         3477.1          561.7
   Pbus::readBlock()      1280     0.712         3511.2          556.2
    Read with Offset       640     0.547         2285.2          854.7
  Read single access    163840     0.758          844.3            4.6

Definition at line 80 of file pbussim.h.


Constructor & Destructor Documentation

PbusSim::PbusSim ( )
PbusSim::~PbusSim ( )

Member Function Documentation

int PbusSim::checkIR ( ) [virtual]

Reimplemented from PbusImp.

int PbusSim::free ( int  host = 0) [virtual]

Reimplemented from PbusImp.

static void PbusSim::freeSimulation ( ) [static]

Free recources needed for the simulation mode.

int PbusSim::get ( std::string  item,
std::string *  value 
) [virtual]

Reimplemented from PbusImp.

int PbusSim::getChannelId ( unsigned long  addr)

Get the channel id from a valid address.

unsigned long PbusSim::getIRvector ( ) [virtual]

Reimplemented from PbusImp.

const char* PbusSim::getLibName ( ) [virtual]

Reimplemented from PbusImp.

const char* PbusSim::getMode ( ) [virtual]

Reimplemented from PbusImp.

int PbusSim::getModeId ( ) [virtual]

Reimplemented from PbusImp.

int PbusSim::getPixelNumber ( unsigned long  addr)

Get the pixel number (0..439)

int PbusSim::getSlotId ( unsigned long  addr)

Get the slot id from a valid address.

unsigned long PbusSim::getState ( ) [virtual]

Reimplemented from PbusImp.

int PbusSim::init ( char *  inifile,
int  host = 0 
) [virtual]

Initilaization of the Pbus interface.

The function will throw an error if the interface is not avaialble The missing or powered-off FD Electronic will cause a warning but no error.

Reimplemented from PbusImp.

static void PbusSim::initSimulation ( char *  inifile) [static]

Specific initialization for Pbus simulation mode.

bool PbusSim::isMemoryAccess ( unsigned long  addr)

Distinguish register and Memory access.

unsigned long PbusSim::rawRead ( unsigned long  addr) [virtual]

Read data from the electronics via a special interface.

Re-implement this function for every interface.

Reimplemented from PbusImp.

void PbusSim::rawWrite ( unsigned long  addr,
unsigned long  data 
) [virtual]

Write data to the electronics via a special interface.

Re-implement this function for every interface.

Reimplemented from PbusImp.

void PbusSim::readBlock ( unsigned long  addr,
unsigned long *  data,
unsigned long  n,
unsigned long  incr = 1 
) [virtual]

Read data a continuous block of data.

The function protects a loop of rawRead calls. Normally the function is overloaded using dedicated block transfer operation.

Reimplemented from PbusImp.

unsigned long PbusSim::readIRvector ( ) [virtual]

Reimplemented from PbusImp.

void PbusSim::reset ( ) [virtual]

Reset of the Pbus access layer.

Reimplemented from PbusImp.

unsigned long PbusSim::simAddress ( unsigned  long)

The 29bit address space has to be reduced significantly as there is only one shared memory segment with 4MByte available.

There are independant blocks for

  • Pbus Registers
  • FLT Registers
  • FLT ACD Memory
  • SLT Register + Memory

For the símulation mode the address space is mapped to addresses from 0x0000000 to 0x00200000. Each address refers to a 16bit word. Going down to 16bit addresses is necessary because of the organisation in the Flt Memory.

Address  Usage
---------------------------------
000000   Pbus Register

---------------------------------
000800   Flt Register     Slot  0
001000                    Slot  1
001800                    Slot  2
...
00A800                    Slot 20
---------------------------------
00B000   - not used -


---------------------------------
010000   Slt PixelTrigger
014000   Slt Multiplicity
018000   Slt Register
---------------------------------
01C000   - not used -


---------------------------------
020000   Flt Memory     Pixel   1
021000                  Pixel   2
022000                  Pixel   3
...

0FF000                  Pixel 480
---------------------------------
200000

unsigned long PbusSim::simRead ( unsigned long  addr)

Read from the memory block.

unsigned long PbusSim::simRegisterAddress ( int  addr)

Map the Pbus registers to the memory.

void PbusSim::simWrite ( unsigned long  addr,
unsigned long  data 
)

Write data to the memory block.

Some registers will automatically effect others! This is also done here within the protected path.

int PbusSim::waitForIR ( int  timeout) [virtual]

Reimplemented from PbusImp.

void PbusSim::writeIRvector ( unsigned long  vector) [virtual]

Reimplemented from PbusImp.


Member Data Documentation

unsigned long PbusSim::maxAddr [static, protected]

Size of the available RAM in test mode.

Definition at line 211 of file pbussim.h.

unsigned long* PbusSim::mem [static, protected]

Memory to simulate the Pbus memory.

Definition at line 214 of file pbussim.h.

SimPageController* PbusSim::pc [static, protected]

Implementation of the Slt page controller simulation.

Definition at line 235 of file pbussim.h.

Subrack* PbusSim::s [static, protected]

The implementation of the page controller for Pbus / Crate simulation mode requires access to some Slt registers.

Definition at line 232 of file pbussim.h.

sharedMemory* PbusSim::shm [static, protected]

Shared memory for extended simulation options.

Definition at line 225 of file pbussim.h.

unsigned short* PbusSim::sMem [static, protected]

Pointer to the memory of type unsigned short.

The structure of the Flt memory requires to access the two words of a long word seperatly.

Definition at line 220 of file pbussim.h.


The documentation for this class was generated from the following file: