fix: logs added to end req in router cs, ni tlm send to wrong laye error

This commit is contained in:
juanmanuel 2024-11-03 16:58:42 -05:00
parent 9e9949faa5
commit 4d63576d44
4 changed files with 24 additions and 5 deletions

View file

@ -473,11 +473,12 @@ void NetworkInterfaceTlm::target_peq_cb(tlm_gp& trans, const tlm::tlm_phase& pha
}
tlm::tlm_sync_enum NetworkInterfaceTlm::send_end_req(tlm_gp& trans){
string type_name = get_type_name(get_type_from_extension(trans));
// Queue the acceptance and the response with the appropriate latency
tlm::tlm_phase bw_phase = tlm::END_REQ;
sc_time delay = sc_time(REQ_END_DELAY, UNITS_DELAY); // Accept delay
tlm::tlm_sync_enum status = (*target[0])->nb_transport_bw(trans,
int lay = type_name == TYPE_STREAM ? 1:0;
tlm::tlm_sync_enum status = (*target[lay])->nb_transport_bw(trans,
bw_phase, delay);
if (status == tlm::TLM_COMPLETED) {
trans.release();
@ -486,8 +487,7 @@ tlm::tlm_sync_enum NetworkInterfaceTlm::send_end_req(tlm_gp& trans){
}
// Queue internal event to mark beginning of response
int type = get_type_from_extension(trans);
delay = get_type_name(type) != TYPE_STREAM ?
delay = type_name != TYPE_STREAM ?
delay + sc_time(INTERN_PROC_DELAY, UNITS_DELAY) :
SC_ZERO_TIME; // no processing on stream
target_peq.notify(trans, INTERNAL_PROC_PHASE, delay);

View file

@ -143,7 +143,7 @@ class TlmRouter : public sc_module{
* @param trans TLM generic payload object
* @param phase TLM current phase
*/
void init_peq_cb(tlm_gp& trans, const tlm_phase& phase);
virtual void init_peq_cb(tlm_gp& trans, const tlm_phase& phase);
/**
* Callback target Payload Event Queue (PEQ)

View file

@ -97,9 +97,20 @@ void TlmRouterCS::configure_router(int link, tlm_gp& trans){
tlm_sync_enum TlmRouterCS::nb_transport_bw_cb(int id, tlm_gp& trans,
tlm_phase& phase, sc_time& delay) {
log_info(id, trans, "Backward transport callback start CS");
init_peq.notify(trans, phase, delay);
return TLM_ACCEPTED;
}
void TlmRouterCS::init_peq_cb(tlm_gp& trans, const tlm_phase& phase){
int link = get_link_from_extension(trans);
log_info(link,trans, "Initiator PEQ callback start");
log_info(link,trans, "Phase "+string(phase.get_name())+" received");
if (phase != END_REQ){
log_error(link,trans,"Illegal transaction phase received by initiator");
}
check_transaction(link, trans);
}
/******************* TARGET SOCKET FUNCTIONS ********************/
void TlmRouterCS::target_peq_cb(tlm_gp& trans, const tlm_phase& phase){
int link = DIR::getOppositeDir(get_link_from_extension(trans));

View file

@ -116,6 +116,14 @@ class TlmRouterCS : public TlmRouter{
tlm_sync_enum nb_transport_bw_cb(int id, tlm_gp& trans,
tlm_phase& phase, sc_time& delay) override;
/**
* Callback initiator Payload Event Queue (PEQ)
*
* @param trans TLM generic payload object
* @param phase TLM current phase
*/
void init_peq_cb(tlm_gp& trans, const tlm_phase& phase) override;
/**
* Callback target Payload Event Queue (PEQ)
*