gem5 v24.1.0.1
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
gem5::tlm::chi::TlmGenerator::Transaction Class Reference

Transaction object It stores ARM::CHI::Payload and ARM::CHI::Phase objects, and a list of action callables which will be executed in the order they have been registered once a transaction response arrives. More...

#include <generator.hh>

Classes

class  Action
 Action: Does something without condition checking. More...
 
class  Assertion
 Assertion: Will check for a specific condition and will fail if the condition is not met. More...
 
class  Expectation
 Expectation: Will check for a specific condition and will warn if the condition is not met. More...
 

Public Types

using ActionPtr = std::unique_ptr< Action >
 
using Actions = std::list< ActionPtr >
 

Public Member Functions

 Transaction (const Transaction &rhs)=delete
 
 Transaction (ARM::CHI::Payload *pa, ARM::CHI::Phase &ph)
 
 ~Transaction ()
 
void setGenerator (TlmGenerator *gen)
 Registers the TlmGenerator in the transaction.
 
std::string str () const
 
void inject ()
 
bool failed () const
 Returns true if the transaction has failed, false otherwise.
 
bool hasCallbacks () const
 Returns true if the transaction has some registered callbacks, false otherwise.
 
void addCallback (ActionPtr &&action)
 Appends a callback to the list of actions.
 
void runCallbacks ()
 Enters the dispatching loop and runs the callbacks in insertion order until a waiting callback is encountered (or if there is a failing assertion)
 
ARM::CHI::Payload * payload () const
 
ARM::CHI::Phase & phase ()
 

Private Attributes

Actions actions
 
bool passed
 
TlmGeneratorparent
 
ARM::CHI::Payload * _payload
 
ARM::CHI::Phase _phase
 

Detailed Description

Transaction object It stores ARM::CHI::Payload and ARM::CHI::Phase objects, and a list of action callables which will be executed in the order they have been registered once a transaction response arrives.

These could be: 1) Expectation callbacks (Transaction::Expectation) which will check a specific condition and will warn if the condition is not met 2) Assertion callbacks (Transaction::Assertion) Identical to expectations, they will fail simulation instead of warning, which means later conditions won't be checked. 3) Action callbacks (Transaction::Action) Does something without condition checking

Once the response arrives, the Transaction::runCallbacks will enter the dispatching loop. Actions/callbacks will be dispatched until the list is empty or until a waiting action is encountered. This will break the dispatching loop.

Definition at line 114 of file generator.hh.

Member Typedef Documentation

◆ ActionPtr

Definition at line 191 of file generator.hh.

◆ Actions

Definition at line 192 of file generator.hh.

Constructor & Destructor Documentation

◆ Transaction() [1/2]

gem5::tlm::chi::TlmGenerator::Transaction::Transaction ( const Transaction rhs)
delete

◆ Transaction() [2/2]

gem5::tlm::chi::TlmGenerator::Transaction::Transaction ( ARM::CHI::Payload *  pa,
ARM::CHI::Phase &  ph 
)

Definition at line 70 of file generator.cc.

References _payload.

◆ ~Transaction()

gem5::tlm::chi::TlmGenerator::Transaction::~Transaction ( )

Definition at line 76 of file generator.cc.

Member Function Documentation

◆ addCallback()

void gem5::tlm::chi::TlmGenerator::Transaction::addCallback ( ActionPtr &&  action)

Appends a callback to the list of actions.

Definition at line 112 of file generator.cc.

◆ failed()

bool gem5::tlm::chi::TlmGenerator::Transaction::failed ( ) const

Returns true if the transaction has failed, false otherwise.

Definition at line 106 of file generator.cc.

◆ hasCallbacks()

bool gem5::tlm::chi::TlmGenerator::Transaction::hasCallbacks ( ) const

Returns true if the transaction has some registered callbacks, false otherwise.

Definition at line 100 of file generator.cc.

Referenced by gem5::tlm::chi::TlmGenerator::inject().

◆ inject()

void gem5::tlm::chi::TlmGenerator::Transaction::inject ( )

Definition at line 94 of file generator.cc.

◆ payload()

ARM::CHI::Payload * gem5::tlm::chi::TlmGenerator::Transaction::payload ( ) const
inline

Definition at line 233 of file generator.hh.

References _payload.

Referenced by gem5::tlm::chi::TlmGenerator::inject().

◆ phase()

ARM::CHI::Phase & gem5::tlm::chi::TlmGenerator::Transaction::phase ( )
inline

Definition at line 234 of file generator.hh.

References _phase.

Referenced by gem5::tlm::chi::TlmGenerator::inject().

◆ runCallbacks()

void gem5::tlm::chi::TlmGenerator::Transaction::runCallbacks ( )

Enters the dispatching loop and runs the callbacks in insertion order until a waiting callback is encountered (or if there is a failing assertion)

Definition at line 118 of file generator.cc.

◆ setGenerator()

void gem5::tlm::chi::TlmGenerator::Transaction::setGenerator ( TlmGenerator gen)

Registers the TlmGenerator in the transaction.

This is used as a reference to the generator is required when injection the transaction

Definition at line 82 of file generator.cc.

Referenced by gem5::tlm::chi::TlmGenerator::scheduleTransaction().

◆ str()

std::string gem5::tlm::chi::TlmGenerator::Transaction::str ( ) const

Definition at line 88 of file generator.cc.

References gem5::tlm::chi::transactionToString().

Member Data Documentation

◆ _payload

ARM::CHI::Payload* gem5::tlm::chi::TlmGenerator::Transaction::_payload
private

Definition at line 241 of file generator.hh.

Referenced by payload(), and Transaction().

◆ _phase

ARM::CHI::Phase gem5::tlm::chi::TlmGenerator::Transaction::_phase
private

Definition at line 242 of file generator.hh.

Referenced by phase().

◆ actions

Actions gem5::tlm::chi::TlmGenerator::Transaction::actions
private

Definition at line 237 of file generator.hh.

◆ parent

TlmGenerator* gem5::tlm::chi::TlmGenerator::Transaction::parent
private

Definition at line 240 of file generator.hh.

◆ passed

bool gem5::tlm::chi::TlmGenerator::Transaction::passed
private

Definition at line 238 of file generator.hh.


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

Generated on Mon Jan 13 2025 04:29:17 for gem5 by doxygen 1.9.8