TransactionAndAccesses
Transaction and Accesses
PCIe transactions, phases and access classes are available in a static casts and a dynamic casts version.
The dynamic casts version was developed before the static casts version. Dynamic casts are slower so the default (and in future only) version is the static casts version.
In principle a PCIe dynamic casts version topology should be able to work together in parallel with a generic topology using (real) gp::GenericTransactions. But for code and usage clearness in both versions the define USE_PCIE_TRANSACTION has to be set. Then the generic transaction, phase and access classes are typedefed to PCIe classes which may be used in a generic or a PCIe manner.
Dynamic Casts Version
Inheritance of Transactions and access classes:
Implementation(2f)TransactionAndAccesses/attachments/UmbrelloClassDiagramTransactionsAccesses.jpg)
To access the quarks inside the PCIeTransaction the access classes (PCIe[Master|Slave|Router]Access, typedefed to [ROUTER|TARGET|MASTER]ACCESS and handles Generic[Router|Slave|Master]AccessHandle) have to be used. The direct usage of the PCIeTransaction leads to ambiguous errors.
Static Casts Version
Implementation(2f)TransactionAndAccesses/attachments/StaticTransactionDerivationTree.png)
Typedefs:
- typedef PCIe::PCIeTransaction GenericTransaction;
- typedef PCIe::PCIeSlaveAccess GenericSlaveAccess;
- typedef PCIe::PCIeMasterAccess GenericMasterAccess;
- typedef PCIe::PCIeRouterAccess GenericRouterAccess;
- typedef PCIe::PCIePhase GenericPhase;
Due to the typedefs all ports, routers, devices etc. that use the generic protocol, transactions and accesses use the PCIe classes without realizing that. The entire system uses PCIe Transactions and classes: PCIe devices and Ports are aware of the PCIe classes, the generic ones use that transparent.
The class PCIeTransaction has protected using statements for the GenericTransaction access methods so it is not possible to call the access methods on the transaction object itself. The PCIe specific access methods are protected, too. This is the concept of the access classes which have to be used instead.
TODO: In future the GenericTransaction class will have only protected access classes, too.
Separate Access Classes for Sender and Receiver
We use separate access classes (PCIeMasterAccess/PCIeSenderAccess and PCIeSlaveAccess/PCIeReceiverAccess) to manipulate and process TLPs at sender and receiver side. Although there is one combined API for sending and receiving the transaction handling at sender's and receiver's side it is different. A sending device uses a PCIeMasterAccessHandle to create a TLP. The receiving device gets a PCIeSlaveAccessHandle and uses its access methods which avoid wrong usage: a receiver is prevented from setting fields in the received transaction which may not be changed.
Posted January 8th, 2008 by MarkBurton