38#ifndef __MEM_RUBY_PROTOCOL_CHI_TLM_GENERATOR_HH__
39#define __MEM_RUBY_PROTOCOL_CHI_TLM_GENERATOR_HH__
42#include <unordered_map>
44#include <ARM/TLM/arm_chi.h>
47#include "params/TlmGenerator.hh"
205 std::string
str()
const;
271 return "CHI Transaction event";
279 void recv(ARM::CHI::Payload *payload, ARM::CHI::Phase *phase);
Tick _when
timestamp when event should be processed
Abstract superclass for simulation objects.
The tlm::chi::CacheController is a ruby CacheController which acts as a bridge between the AMBA TLM 2...
Action: Does something without condition checking.
std::function< bool(Transaction *tran) > Callback
virtual bool run(Transaction *tran)
Action(Callback _cb, bool waiting)
bool wait() const
Returns true if the action dispatcher should break the dispatching loop once the action has been exec...
Assertion: Will check for a specific condition and will fail if the condition is not met.
bool run(Transaction *tran) override
Assertion(std::string exp_name, Callback _cb)
Expectation: Will check for a specific condition and will warn if the condition is not met.
bool run(Transaction *tran) override
Expectation(std::string exp_name, Callback _cb)
Transaction object It stores ARM::CHI::Payload and ARM::CHI::Phase objects, and a list of action call...
bool failed() const
Returns true if the transaction has failed, false otherwise.
void addCallback(ActionPtr &&action)
Appends a callback to the list of actions.
std::unique_ptr< Action > ActionPtr
void runCallbacks()
Enters the dispatching loop and runs the callbacks in insertion order until a waiting callback is enc...
ARM::CHI::Payload * _payload
ARM::CHI::Phase & phase()
ARM::CHI::Payload * payload() const
Transaction(const Transaction &rhs)=delete
void setGenerator(TlmGenerator *gen)
Registers the TlmGenerator in the transaction.
bool hasCallbacks() const
Returns true if the transaction has some registered callbacks, false otherwise.
TlmGenerator: this class is basically a CHI-tlm traffic generator.
std::unordered_map< uint16_t, Transaction * > pendingTransactions
Map of pending (injected) transactions indexed by the txn_id.
void scheduleTransaction(Tick when, Transaction *tr)
SchedulingQueue scheduledTransactions
PQ of transactions whose injection needs to be scheduled.
void inject(Transaction *transaction)
void recv(ARM::CHI::Payload *payload, ARM::CHI::Phase *phase)
CacheController * controller
Pointer to the CHI-tlm controller.
std::priority_queue< TransactionEvent *, std::vector< TransactionEvent * >, TransactionEvent::Compare > SchedulingQueue
uint8_t cpuId
cpuId to mimic the behaviour of a CPU
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Tick
Tick count type.
bool operator()(const TransactionEvent *lhs, const TransactionEvent *rhs)
Transaction * transaction
TransactionEvent(Transaction *_transaction, Tick _when)
const char * description() const override
Return a C string describing the event.