94 fsm_hndl->
fsm->cb[RequestPhaseBeg] = [
this, fsm_hndl]() ->
void {
96 auto& f = protocol_cb[RequestPhaseBeg];
100 fsm_hndl->
fsm->cb[BegPartReqE] = [
this, fsm_hndl]() ->
void {
102 tlm::tlm_phase phase = axi::BEGIN_PARTIAL_REQ;
103 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
104 if(ret == tlm::TLM_UPDATED) {
107 if((
bool)protocol_cb[BegPartReqE])
108 cbpeq.notify(std::make_tuple(BegPartReqE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
110 fsm_hndl->
fsm->cb[EndPartReqE] = [
this, fsm_hndl]() ->
void {
121 if((
bool)protocol_cb[EndPartReqE])
122 cbpeq.notify(std::make_tuple(EndPartReqE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
124 fsm_hndl->
fsm->cb[BegReqE] = [
this, fsm_hndl]() ->
void {
129 tlm::tlm_phase phase = tlm::BEGIN_REQ;
130 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
131 if(ret == tlm::TLM_UPDATED) {
135 if((
bool)protocol_cb[BegReqE])
136 cbpeq.notify(std::make_tuple(BegReqE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
138 fsm_hndl->
fsm->cb[EndReqE] = [
this, fsm_hndl]() ->
void {
140 tlm::tlm_phase phase = tlm::END_REQ;
141 sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : SC_ZERO_TIME);
142 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
144 sc_assert(ext &&
"No ACE extension found for snoop access");
146 fsm_hndl->
trans->set_response_status(tlm::TLM_OK_RESPONSE);
148 if(bw_o.get_interface()) {
150 if(thread_avail == 0) {
151 sc_core::sc_spawn_options opts;
152 opts.set_stack_size(0x10000);
158 auto req = dispatch_queue.read();
159 sc_assert(thread_avail > 0);
161 auto latency = bw_o->transport(*req);
162 if(latency < std::numeric_limits<unsigned>::max()) {
165 auto evt = ext->is_snoop_data_transfer() && length > 1 ? BegPartRespE : BegRespE;
166 snp_resp_queue.push_back(std::make_tuple(evt, req.get(), latency));
172 dispatch_queue.write(fsm_hndl->
trans);
173 latency = std::numeric_limits<unsigned>::max();
174 }
else if(snoop_cb) {
175 latency = snoop_cb(*fsm_hndl->
trans);
177 ext->set_snoop_data_transfer(
false);
178 ext->set_snoop_error(
false);
179 ext->set_pass_dirty(
false);
180 ext->set_shared(
false);
181 ext->set_snoop_was_unique(
false);
183 if(latency < std::numeric_limits<unsigned>::max()) {
185 auto evt = ext->is_snoop_data_transfer() && length > 1 ? BegPartRespE : BegRespE;
186 snp_resp_queue.push_back(std::make_tuple(evt, fsm_hndl->
trans.
get(), latency));
190 if(fsm_hndl->
trans->is_write())
195 if((
bool)protocol_cb[EndReqE])
196 cbpeq.notify(std::make_tuple(EndReqE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
198 fsm_hndl->
fsm->cb[BegPartRespE] = [
this, fsm_hndl]() ->
void {
200 tlm::tlm_phase phase = axi::BEGIN_PARTIAL_RESP;
202 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
209 if((
bool)protocol_cb[BegPartRespE])
210 cbpeq.notify(std::make_tuple(BegPartRespE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
212 fsm_hndl->
fsm->cb[EndPartRespE] = [
this, fsm_hndl]() ->
void {
218 sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : SC_ZERO_TIME);
219 tlm::tlm_phase phase = axi::END_PARTIAL_RESP;
220 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
223 if((
bool)protocol_cb[EndPartRespE])
224 cbpeq.notify(std::make_tuple(EndPartRespE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
226 fsm_hndl->
fsm->cb[BegRespE] = [
this, fsm_hndl]() ->
void {
228 tlm::tlm_phase phase = tlm::BEGIN_RESP;
230 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
238 if((
bool)protocol_cb[BegRespE])
239 cbpeq.notify(std::make_tuple(BegRespE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
241 fsm_hndl->
fsm->cb[EndRespE] = [
this, fsm_hndl]() ->
void {
245 sc_time t(clk_if ? ::scc::time_to_next_posedge(clk_if) - 1_ps : SC_ZERO_TIME);
246 tlm::tlm_phase phase = tlm::END_RESP;
247 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
251 fsm_hndl->
finish.notify(sc_core::SC_ZERO_TIME);
253 if((
bool)protocol_cb[EndRespE])
254 cbpeq.notify(std::make_tuple(EndRespE, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);
256 fsm_hndl->
fsm->cb[Ack] = [
this, fsm_hndl]() ->
void {
258 tlm::tlm_phase phase = axi::ACK;
259 auto ret = socket_fw->nb_transport_fw(*fsm_hndl->
trans, phase, t);
260 fsm_hndl->
finish.notify(sc_core::SC_ZERO_TIME);
261 if((
bool)protocol_cb[Ack])
262 cbpeq.notify(std::make_tuple(Ack, fsm_hndl->
trans, fsm_hndl->
is_snoop), sc_core::SC_ZERO_TIME);