DMASequencer.cc (7908:4e83ebb67794) DMASequencer.cc (7915:bc39c93a5519)
1/*
2 * Copyright (c) 2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 83 unchanged lines hidden (view full) ---

92 msg->getPhysicalAddress() = Address(paddr);
93 msg->getLineAddress() = line_address(msg->getPhysicalAddress());
94 msg->getType() = write ? SequencerRequestType_ST : SequencerRequestType_LD;
95 int offset = paddr & m_data_block_mask;
96
97 msg->getLen() = (offset + len) <= RubySystem::getBlockSizeBytes() ?
98 len : RubySystem::getBlockSizeBytes() - offset;
99
1/*
2 * Copyright (c) 2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 83 unchanged lines hidden (view full) ---

92 msg->getPhysicalAddress() = Address(paddr);
93 msg->getLineAddress() = line_address(msg->getPhysicalAddress());
94 msg->getType() = write ? SequencerRequestType_ST : SequencerRequestType_LD;
95 int offset = paddr & m_data_block_mask;
96
97 msg->getLen() = (offset + len) <= RubySystem::getBlockSizeBytes() ?
98 len : RubySystem::getBlockSizeBytes() - offset;
99
100 if (write) {
101 msg->getDataBlk().setData(data, offset, msg->getLen());
100 if (write && (data != NULL)) {
101 if (active_request.data != NULL) {
102 msg->getDataBlk().setData(data, offset, msg->getLen());
103 }
102 }
103
104 assert(m_mandatory_q_ptr != NULL);
105 m_mandatory_q_ptr->enqueue(msg);
106 active_request.bytes_issued += msg->getLen();
107
108 return RequestStatus_Issued;
109}

--- 45 unchanged lines hidden (view full) ---

155DMASequencer::dataCallback(const DataBlock & dblk)
156{
157 assert(m_is_busy == true);
158 int len = active_request.bytes_issued - active_request.bytes_completed;
159 int offset = 0;
160 if (active_request.bytes_completed == 0)
161 offset = active_request.start_paddr & m_data_block_mask;
162 assert(active_request.write == false);
104 }
105
106 assert(m_mandatory_q_ptr != NULL);
107 m_mandatory_q_ptr->enqueue(msg);
108 active_request.bytes_issued += msg->getLen();
109
110 return RequestStatus_Issued;
111}

--- 45 unchanged lines hidden (view full) ---

157DMASequencer::dataCallback(const DataBlock & dblk)
158{
159 assert(m_is_busy == true);
160 int len = active_request.bytes_issued - active_request.bytes_completed;
161 int offset = 0;
162 if (active_request.bytes_completed == 0)
163 offset = active_request.start_paddr & m_data_block_mask;
164 assert(active_request.write == false);
163 memcpy(&active_request.data[active_request.bytes_completed],
164 dblk.getData(offset, len), len);
165 if (active_request.data != NULL) {
166 memcpy(&active_request.data[active_request.bytes_completed],
167 dblk.getData(offset, len), len);
168 }
165 issueNext();
166}
167
168void
169DMASequencer::ackCallback()
170{
171 issueNext();
172}
173
174void
175DMASequencer::printConfig(std::ostream & out)
176{
177}
178
179DMASequencer *
180DMASequencerParams::create()
181{
182 return new DMASequencer(this);
183}
169 issueNext();
170}
171
172void
173DMASequencer::ackCallback()
174{
175 issueNext();
176}
177
178void
179DMASequencer::printConfig(std::ostream & out)
180{
181}
182
183DMASequencer *
184DMASequencerParams::create()
185{
186 return new DMASequencer(this);
187}