33 #include "debug/RubyDma.hh"
34 #include "debug/RubyStats.hh"
35 #include "mem/ruby/protocol/SequencerMsg.hh"
36 #include "mem/ruby/protocol/SequencerRequestType.hh"
40 int bytes_completed,
int bytes_issued, uint8_t *
data,
42 : start_paddr(start_paddr),
len(
len), write(write),
43 bytes_completed(bytes_completed), bytes_issued(bytes_issued),
data(
data),
50 m_max_outstanding_requests(
p->max_outstanding_requests)
61 response_port->sendRangeChange();
68 return RequestStatus_BufferFull;
80 std::forward_as_tuple(line_addr),
81 std::forward_as_tuple(paddr,
len, write, 0,
83 DMARequest& active_request = emplace_pair.first->second;
88 if (!emplace_pair.second) {
89 DPRINTF(RubyDma,
"DMA aliased: addr %p, len %d\n", line_addr,
len);
90 return RequestStatus_Aliased;
93 DPRINTF(RubyDma,
"DMA req created: addr %p, len %d\n", line_addr,
len);
95 std::shared_ptr<SequencerMsg> msg =
96 std::make_shared<SequencerMsg>(
clockEdge());
97 msg->getPhysicalAddress() = paddr;
98 msg->getLineAddress() = line_addr;
99 msg->getType() = write ? SequencerRequestType_ST : SequencerRequestType_LD;
105 if (write && (
data != NULL)) {
106 if (active_request.
data != NULL) {
107 msg->getDataBlk().setData(
data,
offset, msg->getLen());
117 return RequestStatus_Issued;
131 DPRINTF(RubyDma,
"DMA request completed: addr %p, size %d\n",
132 address, active_request.
len);
140 std::shared_ptr<SequencerMsg> msg =
141 std::make_shared<SequencerMsg>(
clockEdge());
142 msg->getPhysicalAddress() = active_request.
start_paddr +
148 msg->getType() = (active_request.
write ? SequencerRequestType_ST :
149 SequencerRequestType_LD);
152 (active_request.
len -
157 if (active_request.
write) {
167 "DMA request bytes issued %d, bytes completed %d, total len %d\n",
184 assert(!active_request.
write);
185 if (active_request.
data != NULL) {
202 DPRINTF(RubyStats,
"Recorded statistic: %s\n",
203 DMASequencerRequestType_to_string(requestType));
207 DMASequencerParams::create()