DMA configurable receive channel with memory width N and with steering logic compressing N multiplexors
First Claim
1. A method of optimizing a data transfer to an N-byte wide memory system within a data processing system from an M-byte wide receive buffer using a bus master controller, wherein the data includes a plurality of control bits and is organized in data frames, wherein each data frame is to be stored in one or more data buffers in the memory system, and wherein each data buffer includes an associated descriptor block having a memory system address pointer field for holding an address pointer, a length field for holding a length value, a status field for holding a status value, and a command field for holding a command value, the method comprising the steps of:
- initializing first and second latched storage registers capable of holding the least significant bits of the address pointer and the length value, which together indicate the alignment of the start and end of the data buffer relative to N-byte wide boundaries within the memory system, to zero;
initializing third and fourth latched storage registers capable of holding intermediate values used to calculate the byte arrangement for transferring data into data buffers in the memory from the receive buffer;
loading the descriptor block values including the address pointer to the next data buffer to be filled, the length value of the next data buffer to be filled, the status value of the next data buffer to be filled, and the command value of the next data buffer to be filled, into the bus master controller;
loading and latching the first, second, third and fourth latched storage registers in response to loading the descriptor block values;
calculating a steer value based upon the values stored in the latched storage registers;
steering N bytes of the data into accumulator registers based upon the calculated steer value;
calculating a shuffle steer value based upon the values stored in the latched storage registers;
rearranging the data in the accumulator registers based upon the calculated shuffle steer value to align the data with the data buffer in memory;
transferring the rearranged data from the accumulator registers into the current data buffer in memory;
repeating the steps of loading the descriptor block values, loading and latching the first, second, third and fourth latched storage registers, calculating a steer value, steering N bytes of the data, calculating a shuffle steer value, rearranging the data in the accumulator registers, and transferring the rearranged data until the current data buffer is full;
repeating the steps of initializing the first, second, third, and fourth latched storage registers, loading the descriptor block values, loading and latching the first, second, third and fourth latched storage registers, calculating a steer value, steering N bytes of the data, calculating a shuffle steer value, rearranging the data in the accumulator registers, and transferring the rearranged data until the entire frame is transferred from the receive buffer into one or more data buffers writing one or more place holder bytes into the data buffer after the end of the transferred data frame to insure that the frame ends within a data buffer on a memory width boundary; and
writing a value into the status field of the descriptor block of the last data buffer of the transferred data frame to indicate that the frame has been transferred.
1 Assignment
0 Petitions
Accused Products
Abstract
A descriptor controlled transmit and receive scatter/gather Direct Memory Access Controller efficiently moves data frames comprised of scattered blocks of data from within memory to a destination interface via a multibyte-wide buffer. The transfer of frames into a transmit buffer and out of a receive buffer is optimized regardless of the total length of the component data blocks and regardless of whether the data blocks include an odd or even number of bytes, whether the data blocks begin at an odd or even address, or whether the data blocks are misaligned with regard to memory width boundaries. A DMAC in accordance with an embodiment of the present invention stores information provided by a descriptor before frame processing takes place. This information in conjunction with steering logic and accumulator registers is used to control the steering and storing of the frame data as it passes through the DMAC to the transmit buffer or from the receive buffer. An alternate embodiment of the present invention performs these functions based on the present values of the descriptor fields. Using predetermined data block descriptor information, the present invention is able to determine on the fly the most efficient way to arrange the bytes of data within the data buffers or memory and concatenate the component data buffers in a buffer or memory to assemble the frames, while inserting frame delineating control words to circumvent the necessity for logic to keep track of these boundaries. The use of the descriptor to steer the data into the transmit buffer or out of the receive buffer allows a simplified hardware implementation as compared to prior art methods that must examine and count the data as it is transferred.
44 Citations
8 Claims
-
1. A method of optimizing a data transfer to an N-byte wide memory system within a data processing system from an M-byte wide receive buffer using a bus master controller, wherein the data includes a plurality of control bits and is organized in data frames, wherein each data frame is to be stored in one or more data buffers in the memory system, and wherein each data buffer includes an associated descriptor block having a memory system address pointer field for holding an address pointer, a length field for holding a length value, a status field for holding a status value, and a command field for holding a command value, the method comprising the steps of:
-
initializing first and second latched storage registers capable of holding the least significant bits of the address pointer and the length value, which together indicate the alignment of the start and end of the data buffer relative to N-byte wide boundaries within the memory system, to zero;
initializing third and fourth latched storage registers capable of holding intermediate values used to calculate the byte arrangement for transferring data into data buffers in the memory from the receive buffer;
loading the descriptor block values including the address pointer to the next data buffer to be filled, the length value of the next data buffer to be filled, the status value of the next data buffer to be filled, and the command value of the next data buffer to be filled, into the bus master controller;
loading and latching the first, second, third and fourth latched storage registers in response to loading the descriptor block values;
calculating a steer value based upon the values stored in the latched storage registers;
steering N bytes of the data into accumulator registers based upon the calculated steer value;
calculating a shuffle steer value based upon the values stored in the latched storage registers;
rearranging the data in the accumulator registers based upon the calculated shuffle steer value to align the data with the data buffer in memory;
transferring the rearranged data from the accumulator registers into the current data buffer in memory;
repeating the steps of loading the descriptor block values, loading and latching the first, second, third and fourth latched storage registers, calculating a steer value, steering N bytes of the data, calculating a shuffle steer value, rearranging the data in the accumulator registers, and transferring the rearranged data until the current data buffer is full;
repeating the steps of initializing the first, second, third, and fourth latched storage registers, loading the descriptor block values, loading and latching the first, second, third and fourth latched storage registers, calculating a steer value, steering N bytes of the data, calculating a shuffle steer value, rearranging the data in the accumulator registers, and transferring the rearranged data until the entire frame is transferred from the receive buffer into one or more data buffers writing one or more place holder bytes into the data buffer after the end of the transferred data frame to insure that the frame ends within a data buffer on a memory width boundary; and
writing a value into the status field of the descriptor block of the last data buffer of the transferred data frame to indicate that the frame has been transferred.
-
-
2. A direct memory access data transfer apparatus comprising:
-
a configurable channel from a receive buffer to a memory; and
channel configuration means for configuring the channel to transfer data from the receive buffer aligned evenly on memory width boundaries, coupled to the channel, wherein the configurable channel includes;
steering logic coupled to the receive buffer; and
accumulator registers coupled to the steering logic and the memory; and
wherein the steering logic includes N multiplexors each having a single one byte-wide input coupled to the receive buffer, N one byte-wide outputs coupled to the accumulator registers, and ln(N)ln(2) control steering inputs coupled to the channel configuration means, wherein N equals the width of the memory in bytes. - View Dependent Claims (3, 4)
a first set of N−
1 one byte wide shift registers coupled to the steering logic; and
a second set of N one byte wide shift registers wherein N−
1 shift registers are coupled to the first set of shift registers and the memory; and
the remaining one shift register of the second set of shift registers is coupled to the steering logic and the memory whereby N equals the width of the memory in bytes.
-
-
5. A direct memory access data transfer apparatus comprising:
-
a configurable channel from a receive buffer to a memory; and
channel configuration means for configuring the channel to transfer data from the receive buffer aligned evenly on memory width boundaries, coupled to the channel, and wherein the configurable channel includes;
steering logic coupled to receive buffer; and
accumulator registers coupled to the steering logic and the memory, and wherein the steering logic includes N multiplexors each having a single one byte-wide input coupled to the receive buffer, N one byte-wide outputs coupled to the accumulator registers, and ln(N)/ln(2) control steering inputs coupled to the channel configuration means, wherein N equals the width of the memory in bytes, and wherein the channel configuration means includes;
one or more data descriptor registers; and
means for computing an arrangement of the data that will result in the data being written into the memory aligned on memory width boundaries, coupled to the data descriptor registers and the configurable channel. - View Dependent Claims (6, 7)
a data address register coupled to the means for computing; and
a data length register coupled to the means for computing.
-
-
7. The apparatus of claim 5 wherein the means for computing comprises:
-
a steer bits calculator coupled to the configurable channel and the data descriptor registers; and
a shuffle steer bits calculator coupled to the configurable channel, the data descriptor registers, and the steer bits calculator. 8.The apparatus of claim 7 wherein the means for computing includes logic for determining the number of dead bytes to append to a frame to cause it to end on a memory width boundary.
-
-
8. The apparatus of claim 8 wherein the means for computing further includes logic for preventing the appending of dead bytes that cause an additional data buffer in memory to be used.
Specification