gem5 v24.1.0.1
|
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 |
TlmGenerator * | parent |
ARM::CHI::Payload * | _payload |
ARM::CHI::Phase | _phase |
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.
using gem5::tlm::chi::TlmGenerator::Transaction::ActionPtr = std::unique_ptr<Action> |
Definition at line 191 of file generator.hh.
Definition at line 192 of file generator.hh.
|
delete |
gem5::tlm::chi::TlmGenerator::Transaction::Transaction | ( | ARM::CHI::Payload * | pa, |
ARM::CHI::Phase & | ph | ||
) |
Definition at line 70 of file generator.cc.
References _payload.
gem5::tlm::chi::TlmGenerator::Transaction::~Transaction | ( | ) |
Definition at line 76 of file generator.cc.
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.
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.
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().
void gem5::tlm::chi::TlmGenerator::Transaction::inject | ( | ) |
Definition at line 94 of file generator.cc.
|
inline |
Definition at line 233 of file generator.hh.
References _payload.
Referenced by gem5::tlm::chi::TlmGenerator::inject().
|
inline |
Definition at line 234 of file generator.hh.
References _phase.
Referenced by gem5::tlm::chi::TlmGenerator::inject().
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.
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().
std::string gem5::tlm::chi::TlmGenerator::Transaction::str | ( | ) | const |
Definition at line 88 of file generator.cc.
References gem5::tlm::chi::transactionToString().
|
private |
Definition at line 241 of file generator.hh.
Referenced by payload(), and Transaction().
|
private |
Definition at line 242 of file generator.hh.
Referenced by phase().
|
private |
Definition at line 237 of file generator.hh.
|
private |
Definition at line 240 of file generator.hh.
|
private |
Definition at line 238 of file generator.hh.