Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting m_gotRspSepData=true in HandleRxDat result in TLM_GENERIC_ERROR_RESPONSE? #23

Open
gxflying opened this issue Mar 19, 2024 · 1 comment

Comments

@gxflying
Copy link

gxflying commented Mar 19, 2024

Hi sir:
I am trying to integrated the chi here into a system, while I readed the implementation of the chi protocol , I found for a read transaction with seperate response (which is RespSepData and DataSepResp), if the DataSepResp comes first and we get all the data the transaction requested , the m_gotRspSepData will be set to true in HandleRxDat.
this may result in a TLM_GENERIC_ERROR_RESPONSE response when the RespSepData came sometime later after the DataSepResp in cache_chi::b_transport_rxrsp ?

m_gotRspSepData = true;

virtual void b_transport_rxrsp(tlm::tlm_generic_payload& trans, sc_time& delay)

       {
               trans.set_response_status(tlm::TLM_GENERIC_ERROR_RESPONSE);
                .....
		ret = t->HandleRxRsp(trans, chiattr);           // return false.  see the comment blow

		m_transmitter.Process(t);
	}
       // false here,  so the trans respoonse will he TLM_GENERIC_ERROR_RESPONSE 
       //  which is set at the first line of  b_transport_rxrsp
	if (ret) {                               
		trans.set_response_status(      
			tlm::TLM_OK_RESPONSE);
	}
@gxflying
Copy link
Author

because when the RespSepData comes and is handled by HandleRxRsp (with m_gotRspSepData=true being set by HandleRxDat aforementioned in the last comment )

virtual bool HandleRxRsp(tlm::tlm_generic_payload& gp,chiattr_extension *chiattr)
{
      bool acceptRspSepData = !m_gotRspSepData &&chiattr->GetOpcode() == Rsp::RespSepData;    //  false
      bool acceptReadReceipt = !m_gotRspSepData &&chiattr->GetOpcode() == Rsp::ReadReceipt;     //  false
      bool rspHandled = false;
      if (acceptRspSepData) {                         // false
	      m_gotRspSepData = true;
	      m_gotReadReceipt = true;
	      rspHandled = true;
      } else if (acceptReadReceipt) {               // false
	      m_gotReadReceipt = true;
	      rspHandled = true;
      }
      return rspHandled;                               // return false eventully
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant