Deleted Added
sdiff udiff text old ( 7908:4e83ebb67794 ) new ( 7915:bc39c93a5519 )
full compact
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());
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);
163 memcpy(&active_request.data[active_request.bytes_completed],
164 dblk.getData(offset, len), len);
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}