US6314478B1 - System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue - Google Patents

System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue Download PDF

Info

Publication number
US6314478B1
US6314478B1 US09/222,378 US22237898A US6314478B1 US 6314478 B1 US6314478 B1 US 6314478B1 US 22237898 A US22237898 A US 22237898A US 6314478 B1 US6314478 B1 US 6314478B1
Authority
US
United States
Prior art keywords
queue
storage elements
circular
pointer
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
US09/222,378
Inventor
William R. Etcheverry
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp of America
Original Assignee
NEC America Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC America Inc filed Critical NEC America Inc
Priority to US09/222,378 priority Critical patent/US6314478B1/en
Assigned to NEC AMERICA, INC. reassignment NEC AMERICA, INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: ETECHVERY, WILLIAM R.
Application granted granted Critical
Publication of US6314478B1 publication Critical patent/US6314478B1/en
Assigned to NEC CORPORATION OF AMERICA reassignment NEC CORPORATION OF AMERICA MERGER (SEE DOCUMENT FOR DETAILS). Assignors: NEC AMERICA, INC.
Assigned to NEC CORPORATION OF AMERICA reassignment NEC CORPORATION OF AMERICA CORRECTIVE ASSIGNMENT TO REMOVE AN ERRORNEOUSLY RECORDED PATENT NUMBER 5878039 FROM A DOCUMENT PREVIOUSLY RECORDED AT REEL 018239 FRAME 0350. THE ASSIGNOR HEREBY CONFIRMS THE MERGER DOCUMENT. Assignors: NEC AMERICA, INC.
Assigned to NEC CORPORATION OF AMERICA reassignment NEC CORPORATION OF AMERICA ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: NEC AMERICA, INC.
Assigned to NEC AMERICA, INC. reassignment NEC AMERICA, INC. CHANGE OF NAME (SEE DOCUMENT FOR DETAILS). Assignors: NEC CORPORATION OF AMERICA
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/06Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor
    • G06F5/10Methods or arrangements for data conversion without changing the order or content of the data handled for changing the speed of data flow, i.e. speed regularising or timing, e.g. delay lines, FIFO buffers; over- or underrun control therefor having a sequence of storage locations each being individually accessible for both enqueue and dequeue operations, e.g. using random access memory

Definitions

  • the present invention generally relates to the field of queues or buffers as used in computing systems. More specifically, the present invention relates to those queues or buffers which behave or are intended to behave as circular queues or buffers. Particularly, the invention relates to those circular queues or buffers which are used for high speed communications between a first processor or system and a second processor or system.
  • FIFO buffers or queues exist for numerous purposes including utilizing available memory resources effectively and repetitively, storing information where short term data transfer rates exceed the available temporary processing or transferring ability of the microprocessors or the like, and for temporary storage of data where the data size is limited but presently unknown or likely to be variable.
  • FIFO buffers or queues can also be used for servicing hardware interrupts, cycling of software programs, for data shifting or manipulations, and for other purposes well known in the art.
  • Circular FIFO buffers have likewise proven beneficial in the transfer of data both to and from communication devices and for other communication related applications.
  • the FIFO buffer or queue is first implemented in the hardware transmitting data or the hardware receiving data. Additional circular buffers or queues can be employed to move the received or transmitted data from or to the receiving or transmitting hardware.
  • Current FIFO buffers can be realized using one or more of many different mechanisms, including hardware implementation, software allocation, or a combination employing both hardware and software.
  • a hardware implementation could include dedicated memory of a Central Processing Unit (CPU) using Dynamic Random Access Memories (DRAM), high speed memory, cache memory, or the like.
  • DRAM Dynamic Random Access Memories
  • the write pointer maintains the next or current available position in or for writing in the DRAM, memory, or storage space.
  • the read pointer maintains the next or current position for retrieving data from the DRAM, memory, or storage space. It is customary to refer to the read pointer and write pointer as head pointer and tail pointer, or vice-versa, and therefore, herein they will be referred to specifically as ‘read pointer’ and ‘write pointer’ for clarity.
  • control elements may be implemented in a circular queue or buffer.
  • Optional pointers can exist for control in a circular FIFO buffer or system, including a data end pointer, one or more transfer pointers for execution of branching instructions, as well as others.
  • one or more indexes or flags or the actual queue or buffer data can be used to implement queue or buffer control.
  • Optional control elements for the queue include buffer status indicators such as queue full, queue almost full, queue empty, queue almost empty, as well as other optional indicators such as data packet size, data size, transfer complete, data overrun, invalid request, free-count, used-count, a data loaded flag, and the like. These control elements have been added to circular queues to monitor or implement the ‘circular’ behavior of the queue, while actually implementing the circular queue using a linear physical addressing scheme or in a linear or matrixed (x by y addressing) memory array or data storage structure.
  • FIG. 2 a shown is a general overview of a prior art circular queue, or FIFO buffer, comprising numerous individual buffer storage elements 104 , a physical start address 117 which may be referenced by a logical start address 116 , a physical end address 121 which may be referenced by a logical end address 120 , a write address pointer 108 , and a read address pointer 112 .
  • the ‘circular’ nature of this FIFO queue is shown by demonstrative return path 125 , whereby upon reaching logical end address 120 or physical end address 121 , the appropriate pointer resets to the logical start address 116 or physical start address 117 .
  • any particular logical or physical pointer referencing storage elements within the circular queue 200 results in the pointer crossing the physical end address 121 to be reset to the logical or physical address at the physical start address 117 .
  • a multiplicative factor of physical end address 121 minus physical start address 117 is subtracted from the pointer address to reduce its value to an address value less than the physical end address 121 but greater than or equal to the physical start address 117 . In most present day systems, this is typically done by taking the modulus of the address divided by logical end address 120 when the logical start address 116 address is zero.
  • the buffer storage elements 104 are entirely empty.
  • the write address pointer 108 points to the first available data storage element which is unused and available for data storage.
  • the read address pointer 112 likewise points to the last used buffer storage elements 104 , or initialized (as shown therein) to the logical end address 120 .
  • the buffer storage elements 104 fill as necessary to store data.
  • a check is made to ensure write address pointer 108 has not exceeded logical end address 120 (or physical end address 121 ) and read address pointer 112 . Thereafter, write address pointer 108 moves to point to the next available storage element address, as is shown in FIG.
  • the operation of the circular queue 200 has completed data storage into each of the buffer storage elements 104 , and has begun the reading process as data groups less than Data Group ( 24 ) have been read, as indicated by the shift in position of read address pointer 112 .
  • Also shown in FIG. 2 c is the write of Data Group ( 31 ) across physical end address 121 , resulting in a first data group portion being written (identified as Data Group ( 31 A)) up to logical end address 120 , and a second portion being written (identified as Data Group ( 31 B)) starting from logical start address 116 .
  • Data Group ( 31 A) in combination with Data Group ( 31 B) is computationally or logically treated as a continuous single data group by the appropriate use of pointers, control functions, logic circuits and the like to effectively make a linear storage system of circular queue 200 appear or function ‘circular’.
  • circular queue 200 where the queue is functionally full of data comprised of the Data Groups ( 41 )-( 50 ).
  • write address pointer 108 is not permitted to proceed to (or in certain designs pass) the exact position of read address pointer 112 .
  • read address pointer 112 is not permitted to proceed to (or in certain designs pass) the exact position of write address pointer 108 .
  • write address pointer 108 could proceed up to the exact position of read address pointer 112 , or vice-versa.
  • Such a design may require queue empty and/or queue full status bits, depending upon whether a read or whether a write procedure was occuring immediately prior to the equivalency of addresses for write address pointer 108 and read address pointer 112 .
  • one embodiment of the present invention provides a mirror space which functions to permit read and write operations to the circular queue to proceed whereby the present position of a queue pointer need not be known or verified until after the access (a read or a write or combination thereof) process is substantially completed.
  • a circular queue and its operation is described which is intended to overcome certain disadvantages of the existing art, namely, permitting read or write access to the circular queue in a manner wherein a pointer address is not verified after each and every read from or write to a storage element of the circular queue, while optionally simultaneously maintaining the functionality of a circular queue for existing functions or subroutine calls.
  • It is one object of the present invention is to provide a new and improved circular queue whereby the accessing of data to and from the circular queue can occur at a faster rate than existing circular queues or at an efficiency which is higher than an equivalent circular only queue.
  • FIG. 1 is a block diagram the circular queue according to the present invention
  • FIG. 2 a is a block diagram of an empty or unused prior art circular queue
  • FIG. 2 b is a block diagram of partly written prior art circular queue
  • FIG. 2 c is a block diagram of prior art circular queue which is being read
  • FIG. 2 d is a block diagram of completely full prior art circular queue
  • FIG. 3 is a block diagram of an empty circular queue according to the present invention.
  • FIG. 4 is a block diagram of partly written circular queue using a mirror space according to one embodiment of the present invention.
  • FIG. 5 is a flow chart diagram of the prior art implementation of the write process
  • FIG. 6 a is a flow chart diagram of a first write process as implemented in an embodiment of the present invention.
  • FIG. 6 b is a flow chart diagram of a second write process as implemented in an embodiment of the present invention.
  • FIG. 7 a is flow chart diagram of a third write process as implemented in an embodiment off present invention.
  • FIG. 7 b is a flow chart diagram of a fourth write process as implemented in an embodiment of the present invention.
  • FIG. 8 is a block diagram of a data transfer or transmission system using a preferred embodiment of the present invention.
  • Appendix A is a software listing of a program implementing an embodiment of the present invention.
  • FIG. 1 shows an overall block diagram of a first preferred embodiment of the invention incorporating and including the inventive concepts disclosed herein, as well as one combination of functional blocks which include the inventive concepts of this invention. Shown in FIG. 1 are related components of a first preferred embodiment, namely, buffer storage elements 104 , write address pointer 108 , read address pointer 112 , mirror space storage elements 137 , and logical end address 120 .
  • ‘storage element’ can typically comprise one or more of many particular implementing methods or devices, and may include: 1) a single bit; 2) a byte; 3) a programming array addressable element; 4) a block of bytes; 5) a hardware addressable memory byte; 6) a hardware addressable memory block of bytes; 7) blocks of memory; and 8) the like.
  • ‘data’ or ‘data group’ will comprise one or more of many particular implementing methods or programmatic structures including: 1) a program variable; 2) computer bits or bytes; 3) program instructions; 4) fixed records; 5) combinations of variable pieces of digital information; and, 6) the like.
  • the terms ‘data’ or ‘data group’ may also refer one or more parts of the representational information expected to be stored or actually as stored in the storage elements.
  • the term ‘address’ as used herein will define the physical or logical method of locating one, or perhaps more than one, storage element for either reading or writing the identified storage element or elements.
  • FIG. 1 shows in a first embodiment the inventive concepts of the invention.
  • the circular queue 100 is designed or implemented in such a way that the first storage element of mirror space storage elements 137 is at least logically continuous by logical address to logical end address 120 .
  • addressing of the circular queue 100 is by physical addresses as opposed to logical addresses, then mirror space storage elements 137 will be physically address continuous as well as logically address continuous at the boundary of physical end address 121 (or logical end address 120 ). Therefore, where the addressing scheme used to address buffer storage elements 104 and mirror space storage elements 137 requires physical addressing, then mirror space storage elements 137 , namely its first constituent storage element, must be next or sequential in both physical and logical address sequence to physical end address 121 and logical end address 120 , respectively.
  • logical end address 120 will denote the last available physical address within the circular portion of circular queue 100
  • mirror space logical start address 129 will denote the first available physical address for the mirror space storage elements 137 , i.e., those elements not within the circular portion of circular queue 100 or occurring after physical end address 121 .
  • logical end address 120 and mirror space logical start address 129 need only be logically address sequential, and can be optionally physically address non-sequential.
  • the circular queue 100 of FIG. 1 and FIG. 3 operates in a similar manner except for: 1) operations relating to the storage or retrieval of data into storage elements of buffer storage elements 104 wherein no addressing checking or verification is done on a storage element by storage element basis; and 2) the operations relating to the operation of mirror space storage elements 137 and circular queue copy storage elements 142 , if applicable.
  • FIG. 3 an entirely empty queue is shown, wherein write address pointer 108 points to the first available storage element, and read address pointer 112 points to the last storage element read, or as shown, initialized to the last storage element of buffer storage elements 104 .
  • the storage elements of circular queue copy storage elements 142 are ‘mirrored’ by the storage elements of mirror space storage elements 137 .
  • the corresponding storage elements of mirror space storage elements 137 will be identical in function to their corresponding storage elements of circular queue copy storage elements 142 , except that the storage elements of mirror space storage elements 137 are at different physical addresses and logical addresses from their ‘identical’ counterparts in circular queue copy storage elements 142 .
  • the addresses of mirror space storage elements 137 will be offset by the size of buffer storage elements 104 .
  • Data Group ( 31 ) is effectively divided into two subgroups comprising Data Group 31 (A) and Data Group 31 (B).
  • Data Group ( 31 ) is written or stored into buffer storage elements 104 up to physical end address 121 , thereby creating Data Group ( 31 A).
  • Data Group ( 31 B) is effectively created by continuing to write Data Group ( 31 ) after the write process exceeds or traverses physical end address 121 and continues to write into mirror space storage elements 137 .
  • the write process (or read process) of the present invention differs from prior art in that all the data to be written (read) is first written (read) and then a positional update of the appropriate pointer is made subsequent to the writing or storing process (or reading or retrieving process).
  • a positional update of the appropriate pointer is made subsequent to the writing or storing process (or reading or retrieving process).
  • those storage elements within mirror space storage elements 137 are then copied to their corresponding storage elements of circular queue copy storage elements 142 within buffer storage elements 104 , thereby creating an identical alternative Data Group ( 31 B).
  • Data Group ( 31 B) is located entirely within the circular portion of the circular queue.
  • the pointer address is next updated or “repositioned” to reflect the next available write address within the circular queue.
  • Subsequent write operations proceed in storing future data groups into buffer storage elements 104 and updating the pointer address upon completion until physical end address 121 is once again traversed.
  • each occurrence of writing across physical end address 121 results in copies of the portion of the most recent data or data group which is written into mirror space storage elements 137 to be copied from mirror space storage elements 137 to circular queue copy storage elements 142 .
  • the pointer address may be updated at any time after the read, write, or access process has substantially completed, and may occur before, during, or after the copying from mirror space storage elements 137 to circular queue copy storage elements 142 . As described herein, the pointer update will be after the copying.
  • mirror space storage elements 137 it is preferable to the size of mirror space storage elements 137 to a size sufficient to store the maximum possible data group of all possible data groups to be transmitted.
  • the size of mirror space storage elements 137 will be at least the fixed data size or largest possible data group size, respectively.
  • the mirror space storage elements 137 cannot be sized to insure operation without overflowing the mirror space storage elements 137 .
  • each data group must be pre-divided by the transmitter such that they do not exceed the cumulative size of mirror space storage elements 137 . This division will be required prior to transferring the data or each data group into circular queue 100 to insure proper operation. Regardless, the mirror space must be sized to avoid any overflow while accessing the storage elements within the mirror space.
  • the circular queue of the present invention does not check for the positional or address status of the particular pointer or pointers in use during a substantial portion of the read or write process to the circular queue.
  • the address status of the read or write process is determined after the one (if only one storage element need be accessed) or more (where multiple storage elements need be accessed) accesses to the storage elements is completed. This permits much more efficient use of time for the read and write processes by deleting the repetitive step of address checking or verification before or after each storage element access. This is particularly beneficial where the data rate approaches the ability of the controlling processor, controller, or input output device, system component, time available, or the like, to read or write such data, such as in a high speed serial data transfer system.
  • FIG. 5 a flow diagram for a prior art write process to a circular queue is shown.
  • the data is input via data input step 501 .
  • a check of the position or address of write address pointer 108 is done as shown by the step identified as circular queue end traversed check 509 .
  • the position or address of the write address pointer 108 points to a next storage element within the boundary of circular queue 200 , then a single storage element is written as identified by the write storage element data step 513 .
  • the write address pointer 108 is then incremented (by a storage element address unit) as shown by update pointer address step 517 .
  • the pointer is ‘reset’, i.e., returned to the position which references logical start address 116 and physical start address 117 , and the write process resumes writing storage elements at the reset pointer address.
  • the write process within circular queue 200 then continues until such time as the write process fully completes, the read address pointer 112 is encountered, or a system event halts or terminates the write process, or the like.
  • the transfer of data from the circular queue to another transfer function, routine or device is enabled as designated by enable data transmission step 551 and the data is read from the circular queue 200 and provided to the application, function, routine or device.
  • terminate queue access step 555 all data has been written to the queue, held by the queue, and provided to the next application, function, routine, device, or the like.
  • FIG. 6 a The flow diagram of the first embodiment of this invention is shown in FIG. 6 a.
  • Such a process flow accomplishes a write process to circular queue 100 in a manner which reduces the time to achieve the fully completed write process.
  • data input step 501 the data is inputted to the queue.
  • the write process proceeds until all data input elements are written, i.e., the write process is substantially complete, as shown by write all data to storage elements step 613 .
  • the write process continues into mirror space storage elements 137 , wherein as many storage elements of mirror space storage elements 137 are used as required to substantially complete the write process to the storage elements.
  • the write address pointer 108 is re-determined or calculated by adding its previously known position to the number of storage elements that were written by the write process since the prior re-determination or calculation of the reposition pointer step 617 . A check or verification of the pointer position is then made to determine whether or not the write process traversed the logical end address 120 or physical end address 121 of the circular queue.
  • the write process and therefore the write address pointer 108 address traverses the logical end address 120 or physical end address 121 , then the data written into the storage elements of mirror space storage elements 137 during this write process are copied to circular queue copy storage elements 142 .
  • This copy process can be implemented using linear system level copy functions or calls, wherein only the recently written storage elements having current valid data and within mirror space storage elements 137 are copied into circular queue copy storage elements 142 .
  • This copy process is preferably accomplished by specifying the data start address (the first storage location in mirror space storage elements 137 ), the number of storage elements to be copied (i.e., the number of storage elements written into mirror space storage elements 137 ), and a first address position to write or store the data (the first storage location in circular queue copy storage elements 142 or buffer storage elements 104 ).
  • the data for circular queue 100 can be read both by those calling or system routines or functions which operate on circular queues, and also those calling or system routines or queues which operate on (or only on) linear arrays of storage elements. Therefore, by implementing the mirror space, the write process or read process efficiency is improved and the higher level programming can be simplified or implemented by using those calling routines or functions that operate on linear only or circular only storage elements, as well as a combination of linear only and circular only functions or routines.
  • FIG. 6 a it is possible to implement the scheme of FIG. 6 a, by relocating write all data to storage elements step 613 and reposition pointer step 617 to immediately precede enable data transmission step 551 and to be subsequent to circular queue end traversed check 509 ‘NO’ path and reposition pointer step 647 . Effectively, by restructuring in such a manner, a change occurs wherein the pointer position is not tested until such time as the next write or read process is beginning or scheduled.
  • FIG. 6 b Such a restructured implementation is shown in FIG. 6 b. Either implementation functions in a similar manner.
  • the write and read functions to the queue occur in a similar manner as the first preferred embodiment, except where after the logical end address 120 or physical end address 121 is traversed, the data within the mirror space storage elements 137 is not copied to the storage elements within circular queue 100 .
  • the data ‘borrows’ storage elements from mirror space storage elements 137 to complete the write process and then accesses the borrowed storage elements to complete the read process. Consequently, this particular embodiment functions best typically as a ‘linear’ circular queue and may not be functionally compatible with circular queue calling fuctions or routines, i.e., those circular queues which return at a particular address.
  • the second embodiment is advantageous where the mirror space storage elements 137 copy time is sufficient to impact the ability of the queue or buffer to accept or receive data. It is also advantageous where the programming environment uses only linear type functions and subroutines, as the necessity of maintaining circular queue structures may not justify the increased complexity of programming for various applications.
  • the write address pointer 108 address traverses the logical end address 120 or physical end address 121 , then the data written into the storage elements of mirror space storage elements 137 during this write process is not copied to circular queue copy storage elements 142 , as described above in the first embodiment, rather, the write address pointer 108 is reset to logical start address 116 or physical start address 117 . After resetting write address pointer 108 , the operation of the circular queue continues. Since no data is copied to the beginning of the circular queue, and the last valid storage element varies over time, then usually only linear type functions or routines will reliably function with this embodiment of the inventive concepts employed by this circular queue.
  • FIG. 7 a The flow diagram of the second embodiment of this invention is shown in FIG. 7 a.
  • Such a process flow accomplishes a write process to circular queue 100 in a manner which also reduces the time to achieve the fully completed write process.
  • data input step 501 the data is inputted to the queue.
  • the write process proceeds until all data input elements are written, i.e., the write process is substantially complete, as shown by write all data to storage elements step 613 .
  • the write process continues into mirror space storage elements 137 , wherein as many storage elements of mirror space storage elements 137 are used as required to substantially complete the write process to the storage elements.
  • the write address pointer 108 is re-determined or calculated by adding its previously known position to the number of storage elements that were written by the write process since the prior re-determination or calculation of the reposition pointer step 617 .
  • a check or verification of the pointer position is then made to determine whether or not the write process traversed the logical end address 120 or physical end address 121 of the circular queue, as is shown by circular queue end traversed check 509 .
  • the write address pointer 108 address traversed the logical end address 120 or physical end address 121 , then the data written into the storage elements of mirror space storage elements 137 during this write process are not copied to circular queue copy storage elements 142 . Instead, the write address pointer 108 is reset, as shown by reset pointer step 526 , to either logical start address 116 or physical start address 117 . Thereafter, transmission of the circular queue data is enabled, as identified by enable data transmission step 551 , and the write process to the circular queue 100 has entirely completed, as shown by end queue processes step 530 .
  • FIG. 7 a it is possible to implement the scheme of FIG. 7 a, by relocating circular queue end traversed check 509 and reset pointer step 526 to immediately precede write all data to storage elements step 613 and to be subsequent to data input step 501 . Effectively, by restructuring in such a manner, a change occurs wherein the pointer position is not tested until such time as the next write or read process is beginning or scheduled.
  • FIG. 7 b Such a restructured implementation is shown in FIG. 7 b. Either implementation functions in a similar manner.
  • FIG. 8 shown is an embodiment employing the circular queue with additional buffer space wherein the functionality of the improved circular queue is employed to transfer data a higher efficiency rate or efficiency of use of the transferring input/output hardware devices.
  • serial input/output (I/O) device could include: 1) one or more simple buffers and drivers; 2) a modem device; 3) an infra-red input/output device; 4) a modem; 5) a UART device; or, more generally, 6) those devices or class of devices used to transfer data from a first device or processing unit to a second device or processing unit or to another function or area within the first device or first processing unit.
  • a UART 978 is shown.
  • the UART 978 is capable of full duplex transmission of data, and functions as the serial I/O device which transmits data across serial transmit link 981 .
  • a first prior art scheme permits the operating system, such as Operating System 901 , to arbitrate and allocate as to which one of many potential using program will actually access the serial (I/O) device and for what amount of time.
  • operating system such as Operating System 901
  • complete control and or use of the device can be returned to the operating system, thereby permitting other using programs to access the serial (I/O) device.
  • a second prior art scheme permits the using program to maintain exclusive control over the serial I/O device (commonly referred to as ‘locking’ the serial I/O device) until such time as the selected using program completes its data transfer, or is terminated.
  • Such a scheme has typically been previously employed in transferring data to printers, or where the using program transfers data employing modems.
  • Such schemes generally require the non-selected using programs to wait until such time as the selected using program completes its task.
  • RTOS real time operating systems
  • certain tasks or using programs must be completed within a specific time. Consequently, in order to complete all such tasks in timely manners, the using programs must share the input/output resources.
  • a manager program such as implemented by Circular Queue Manager Program 926 permits multiple access while allowing each using program to have apparent dedicated access to the limited number of serial (I/O) devices or a system's single serial I/O device.
  • Program A 905 a Program B 905 b, Program C 905 c, to Program n 905 n to transfer data to a corresponding program
  • the transferring program such as Program A 905 a first registers with Circular Queue Manager Program 926 , thereby obtaining a unique identifier.
  • Program A 905 a begins transfer of data by communicating with software interface driver 911 .
  • this will be done using one or more system calls and/or using system hardware or busses which interface with software interface driver 911 identified by Program A transfer interlink 907 a, Program B transfer interlink 907 b, Program C transfer interlink 907 c, to Program n transfer interlink 907 n, for Program A 905 a Program B 905 b, Program C 905 c, to Program n 905 n, respectively.
  • the software interface driver 911 incorporates with the data to be transferred control and transfer information bytes, and supplies circular queue 100 with the data, control and transfer information bytes, and then transfers all the data or functional control of the data to Circular Queue Manager Program 926 .
  • Circular Queue Manager Program 926 adds additional transferring information and either directs or transfers all of the data as modified to circular queue 100 , either directly from software interface driver 911 to circular queue 100 , or using transfer data interlink 913 to transfer the data from software interface driver 911 to receive buffer 965 and then to circular queue 100 .
  • the data, control and transfer bytes are written into circular queue 100 using system function calls and/or internal buses associated with central processing unit (cpu) or Operating System 901 .
  • Pointer methods to identify the data within main memory are not preferred or used as the data is being consolidated into circular queue 100 for real time transfer.
  • Such a consolidation is implemented to permit one or more programs such as Program A 905 a and Program B 905 b to share access to a single serial I/O device or to a limited number of serial I/O devices.
  • Transmit ISR 973 or UART 978 signals the controlling cpu system or operating system its availability or status to transfer data. Bytes of data are transferred from circular queue 100 to UART 978 .
  • the Transmit ISR 973 communicates with Operating System 901 to effect a transfer of the desired data with control bytes as stored in circular queue 100 from it to UART 978 . Since circular queue 100 is a FIFO type buffer, the read address pointer 112 identifies the next available data byte for transfer. As implemented here, the number of storage elements or bytes to be transferred is designated, and the read process of buffer storage elements 104 and mirror space storage elements 137 continues until all storage elements or bytes are transferred to UART 978 using Transmit ISR 973 .
  • a check or verification is then done as to whether or not the read address pointer 112 traversed the logical end address 120 or physical end address 121 , and the read address pointer 112 is updated.
  • the UART 978 Upon receipt of one or more of the bytes, the UART 978 processes the received data bytes, serializes the bytes into data bits, as necessary, and transmits the serialized data using serial transmit link 981 or the like.
  • the receive data path can also be shown by FIG. 8 .
  • transmitted data is received from serial transmit link 981 by a corresponding receive UART 978
  • the data is transferred from the receive UART 978 using Receive ISR 968 , and stored into receive buffer 965 .
  • the receive buffer 965 may be implemented using either a conventional write-check after every write process or a multiple-write then check process as described herein, supra. As shown in FIG. 8, the conventional write-check after every write process is implemented to avoid any possibility of data overrun of any memory past the mirror space memory address, if implemented.
  • the data Upon receipt of data by UART 978 , the data is transferred using Receive ISR 968 to receive buffer 965 . Once the data is stored or written into receive buffer 965 , the data is transferred using a received side corresponding Circular Queue Manager Program 926 and received side corresponding software interface driver 911 to received side corresponding Program A 905 a, Program B 905 b, Program C 905 c, and/or to Program n 905 n using received side corresponding Program A transfer interlink 907 a, Program B transfer interlink 907 b, Program C transfer interlink 907 c, and/or Program n transfer interlink 907 n, respectively.
  • Such data is delivered by the interlink to the appropriate receiving program or programs and is delivered using the system calls and/or hardware or busses of the receiving system. Typically, the data Will go through the reverse of the process of adding control and transfer data bytes as was implemented for transmission.
  • the received side Circular Queue Manager Program 926 will control the transfer data from receive buffer 965 to received side corresponding software interface driver 911 using receive buffer interlink 964 and receive data interlink 914 . Once received at software interface driver 911 , the data is transferred to the appropriate receiving program or programs as designated by the control and transfer information.
  • Attached in Appendix A is a modified program listing written in the “C” programming language and which implements another embodiment of the inventive concepts described herein.
  • the structure of the program is such that a global read pointer (IsrIndex), global write pointer (FreeIndex), global queue free space available count (FreeBytesCount) integer and global transmit buffer (TxQBuf) and a local temporary pointer (tmp) are defined.
  • the values of the read pointer and write pointer are initialized to ‘MAX_SIZE_TX_QUEUE’, i.e., the queue is empty (not shown).
  • the value of the queue free space available count is initially set to the circular size of tide queue, i.e., MAX_SIZE_TX_QUEUE (initialization not shown).
  • the program operates by next copying data into the buffer using a memcpy call specifying the destination with tmp pointer, the source as RduRecPtr ⁇ SrcPtr and the quantity as RduRecPtr ⁇ Length.
  • tmp pointer is adjusted by adding RduRecPtr ⁇ Length, the number of bytes written.
  • a check or verification is then made to determine whether or not the write process to the tmp pointer exceeded or traversed the circular end or overflowed into the mirror space.
  • a second memcpy call is made to copy the mirror space data into the beginning of the circular queue (&LTxQMgr.TxQBuf[ 0 ]) by the number of bytes written into the mirror space, and the twp pointer is then set to the write address within the circular portion of the queue, by subtracting MAX_SIZE_TX_QUEUE from the current position of tmp.
  • the transmission of queue data is enabled by ENABLETXINT( ).
  • the UART will be inactive and the call to ENABLETXINT( ) will cause the cpu to register an interrupt and the interrupt service routine (ISR) will be called,
  • the code will proceed to and make a call to LTxLoadIsr( ) and a location and a count of the data to transmit will be passed to the ISR routine.
  • the ISR routine will load into the UART the lesser of the number of bytes to transmit or the maximum size that the UART can handle. Where the UART has been previously transmitting, then there will be additional requests for data bytes after the current data bytes have been transmitted. If there are no additional data bytes for transmission, then the ISR routine will disable transmission of data from the UART by calling DISABLETXINT( ).
  • LTxLoadIsr is called by the ISR when additional data bytes are requested by the ISR for transmission. If more the data is available, then LTxLoadIsr will update the data pointer in the ISR and return a count of the data bytes available in the circular queue awaiting transmission.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

A circular queue system is implemented using either a ‘mirror space’ appended to the circular portion of the queue (or buffer) or an ‘borrow’ space appended to the circular portion of the queue (or buffer). In each implementation, address verification or checking within the queue is not implemented until such time as the read or write portion to the queue has substantially completed. Where the address would normally exceed the physical or logical end address of the circular queue, the ‘mirror space’ or ‘borrow’ space provides sufficient storage to prevent overflow into other valid data. Upon substantial completion of the read or write to the queue (or buffer), the present address of the pointer is determined, and where the circular portion of the queue (or buffer) has been traversed, the data in the ‘mirror space’ is copied into the circular queue (or buffer) and the pointer's address is repositioned to be within the circular queue (or buffer), or for a ‘borrow’ space, the pointer's address is reset to the queue's (or buffer's) physical or logical start address.

Description

FIELD OF THE INVENTION
The present invention generally relates to the field of queues or buffers as used in computing systems. More specifically, the present invention relates to those queues or buffers which behave or are intended to behave as circular queues or buffers. Particularly, the invention relates to those circular queues or buffers which are used for high speed communications between a first processor or system and a second processor or system.
BACKGROUND OF THE INVENTION
Typically, circular First In—First Out (FIFO) buffers or queues exist for numerous purposes including utilizing available memory resources effectively and repetitively, storing information where short term data transfer rates exceed the available temporary processing or transferring ability of the microprocessors or the like, and for temporary storage of data where the data size is limited but presently unknown or likely to be variable. FIFO buffers or queues can also be used for servicing hardware interrupts, cycling of software programs, for data shifting or manipulations, and for other purposes well known in the art. Circular FIFO buffers have likewise proven beneficial in the transfer of data both to and from communication devices and for other communication related applications. Typically, in certain communications applications or data transfer applications, the FIFO buffer or queue is first implemented in the hardware transmitting data or the hardware receiving data. Additional circular buffers or queues can be employed to move the received or transmitted data from or to the receiving or transmitting hardware.
Current FIFO buffers can be realized using one or more of many different mechanisms, including hardware implementation, software allocation, or a combination employing both hardware and software. A hardware implementation could include dedicated memory of a Central Processing Unit (CPU) using Dynamic Random Access Memories (DRAM), high speed memory, cache memory, or the like. Generally, at least two pointers are implemented in a circular FIFO buffer or queue. For example, the write pointer maintains the next or current available position in or for writing in the DRAM, memory, or storage space. The read pointer maintains the next or current position for retrieving data from the DRAM, memory, or storage space. It is customary to refer to the read pointer and write pointer as head pointer and tail pointer, or vice-versa, and therefore, herein they will be referred to specifically as ‘read pointer’ and ‘write pointer’ for clarity.
Additional types of control elements may be implemented in a circular queue or buffer. Optional pointers can exist for control in a circular FIFO buffer or system, including a data end pointer, one or more transfer pointers for execution of branching instructions, as well as others. Furthermore, one or more indexes or flags or the actual queue or buffer data can be used to implement queue or buffer control.
Optional control elements for the queue include buffer status indicators such as queue full, queue almost full, queue empty, queue almost empty, as well as other optional indicators such as data packet size, data size, transfer complete, data overrun, invalid request, free-count, used-count, a data loaded flag, and the like. These control elements have been added to circular queues to monitor or implement the ‘circular’ behavior of the queue, while actually implementing the circular queue using a linear physical addressing scheme or in a linear or matrixed (x by y addressing) memory array or data storage structure.
Referring briefly to FIG. 2a, shown is a general overview of a prior art circular queue, or FIFO buffer, comprising numerous individual buffer storage elements 104, a physical start address 117 which may be referenced by a logical start address 116, a physical end address 121 which may be referenced by a logical end address 120, a write address pointer 108, and a read address pointer 112. The ‘circular’ nature of this FIFO queue is shown by demonstrative return path 125, whereby upon reaching logical end address 120 or physical end address 121, the appropriate pointer resets to the logical start address 116 or physical start address 117. In effect and by deliberate implementation, as physical end address 121 is reached, the incrementation of any particular logical or physical pointer referencing storage elements within the circular queue 200, including either read address pointer 112 or write address pointer 108, results in the pointer crossing the physical end address 121 to be reset to the logical or physical address at the physical start address 117. For pointer addresses which exceed physical end address 121, then to determine the appropriate pointer address within the circular queue, a multiplicative factor of physical end address 121 minus physical start address 117 is subtracted from the pointer address to reduce its value to an address value less than the physical end address 121 but greater than or equal to the physical start address 117. In most present day systems, this is typically done by taking the modulus of the address divided by logical end address 120 when the logical start address 116 address is zero.
As demonstrated in FIG. 2a, the buffer storage elements 104 are entirely empty. The write address pointer 108 points to the first available data storage element which is unused and available for data storage. The read address pointer 112 likewise points to the last used buffer storage elements 104, or initialized (as shown therein) to the logical end address 120. As data is written into the circular queue 200, the buffer storage elements 104 fill as necessary to store data. As each portion or piece of data is written, a check is made to ensure write address pointer 108 has not exceeded logical end address 120 (or physical end address 121) and read address pointer 112. Thereafter, write address pointer 108 moves to point to the next available storage element address, as is shown in FIG. 2b by the storage of Data Groups (1) through (9), Upon reaching logical end address 120 or physical end address 121, the address of write address pointer 108 is reset to logical start address 116 or physical start address 117. As shown in FIG. 2b, no read process has yet occurred in the queue of FIG. 2b as the read address pointer 112 remains at its initialized position.
As shown in FIG. 2c, the operation of the circular queue 200 has completed data storage into each of the buffer storage elements 104, and has begun the reading process as data groups less than Data Group (24) have been read, as indicated by the shift in position of read address pointer 112. Also shown in FIG. 2c is the write of Data Group (31) across physical end address 121, resulting in a first data group portion being written (identified as Data Group (31A)) up to logical end address 120, and a second portion being written (identified as Data Group (31B)) starting from logical start address 116. Data Group (31A) in combination with Data Group (31B) is computationally or logically treated as a continuous single data group by the appropriate use of pointers, control functions, logic circuits and the like to effectively make a linear storage system of circular queue 200 appear or function ‘circular’.
Referring next to FIG. 2d, shown is circular queue 200 where the queue is functionally full of data comprised of the Data Groups (41)-(50). The storage element wherein write address pointer 108 and read address pointer 112 both reside in the same storage element wherein no presently valid data exists. Typically, write address pointer 108 is not permitted to proceed to (or in certain designs pass) the exact position of read address pointer 112. Likewise, read address pointer 112 is not permitted to proceed to (or in certain designs pass) the exact position of write address pointer 108. However, contingent upon the particular circular queue design, write address pointer 108 could proceed up to the exact position of read address pointer 112, or vice-versa. Such a design may require queue empty and/or queue full status bits, depending upon whether a read or whether a write procedure was occuring immediately prior to the equivalency of addresses for write address pointer 108 and read address pointer 112.
BRIEF SUMMARY OF THE INVENTION
An arrangement is described wherein one embodiment of the present invention provides a mirror space which functions to permit read and write operations to the circular queue to proceed whereby the present position of a queue pointer need not be known or verified until after the access (a read or a write or combination thereof) process is substantially completed.
In one embodiment of the present invention, a circular queue and its operation is described which is intended to overcome certain disadvantages of the existing art, namely, permitting read or write access to the circular queue in a manner wherein a pointer address is not verified after each and every read from or write to a storage element of the circular queue, while optionally simultaneously maintaining the functionality of a circular queue for existing functions or subroutine calls.
It is one object of the present invention is to provide a new and improved circular queue whereby the accessing of data to and from the circular queue can occur at a faster rate than existing circular queues or at an efficiency which is higher than an equivalent circular only queue.
It is another object of the present invention to provide a circular queue which does not check for the positional or address status of the particular pointer or pointers in use during a read or write operation to the circular queue until such time as the read or write operation is substantially completed.
It is still another object of the present invention to not update the position of pointer after each and every write or read to a storage element. This permits much more efficient use of time for the write and read operations, and is particularly beneficial where the data transfer rate into the circular queue approaches the ability of the controlling processor, controller, or input output device, system component, time available, or the like, to write or read such data.
BRIEF DESCRIPTION OF THE DRAWINGS
The present invention will be described in further detail with reference to the accompanying drawings, in which:
FIG. 1 is a block diagram the circular queue according to the present invention;
FIG. 2a is a block diagram of an empty or unused prior art circular queue;
FIG. 2b is a block diagram of partly written prior art circular queue;
FIG. 2c is a block diagram of prior art circular queue which is being read;
FIG. 2d is a block diagram of completely full prior art circular queue;
FIG. 3 is a block diagram of an empty circular queue according to the present invention;
FIG. 4 is a block diagram of partly written circular queue using a mirror space according to one embodiment of the present invention;
FIG. 5 is a flow chart diagram of the prior art implementation of the write process,
FIG. 6a is a flow chart diagram of a first write process as implemented in an embodiment of the present invention;
FIG. 6b is a flow chart diagram of a second write process as implemented in an embodiment of the present invention;
FIG. 7a is flow chart diagram of a third write process as implemented in an embodiment off present invention;
FIG. 7b is a flow chart diagram of a fourth write process as implemented in an embodiment of the present invention; and,
FIG. 8 is a block diagram of a data transfer or transmission system using a preferred embodiment of the present invention.
Appendix A is a software listing of a program implementing an embodiment of the present invention.
To further assist in understanding the inventive concepts contained herein, and for clarity, those descriptive elements which are similar in nature or which function similarly will maintain their numbering throughout all the figures herein.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
Referring generally to FIG. 1, it shows an overall block diagram of a first preferred embodiment of the invention incorporating and including the inventive concepts disclosed herein, as well as one combination of functional blocks which include the inventive concepts of this invention. Shown in FIG. 1 are related components of a first preferred embodiment, namely, buffer storage elements 104, write address pointer 108, read address pointer 112, mirror space storage elements 137, and logical end address 120.
For clarity, most terms used herein will be discussed as they are contemporarily used or likely to be understood by those practicing in the art of software programming. However, certain terms are generalized to convey the generalization of the inventive concepts described herein. For instance, ‘storage element’, as used herein, can typically comprise one or more of many particular implementing methods or devices, and may include: 1) a single bit; 2) a byte; 3) a programming array addressable element; 4) a block of bytes; 5) a hardware addressable memory byte; 6) a hardware addressable memory block of bytes; 7) blocks of memory; and 8) the like. Likewise, as used herein, ‘data’ or ‘data group’ will comprise one or more of many particular implementing methods or programmatic structures including: 1) a program variable; 2) computer bits or bytes; 3) program instructions; 4) fixed records; 5) combinations of variable pieces of digital information; and, 6) the like. Furthermore, as used herein, the terms ‘data’ or ‘data group’ may also refer one or more parts of the representational information expected to be stored or actually as stored in the storage elements. Typically, the term ‘address’ as used herein will define the physical or logical method of locating one, or perhaps more than one, storage element for either reading or writing the identified storage element or elements.
The discussion below will typically described in regards to a write process to the circular queue; however, the inventive concepts discussed herein are equally adaptable to a read process in the circular queue and are also adaptable to generic read and/or write access processes within the circular queue and its related storage elements. Likewise, address pointers, as described herein, will typically refer to the next available storage element; however, the inventive concepts described herein are equally adaptable to other pointing schemes or methods which may be used for circular queues,
FIG. 1 shows in a first embodiment the inventive concepts of the invention. The circular queue 100 is designed or implemented in such a way that the first storage element of mirror space storage elements 137 is at least logically continuous by logical address to logical end address 120. Where addressing of the circular queue 100 is by physical addresses as opposed to logical addresses, then mirror space storage elements 137 will be physically address continuous as well as logically address continuous at the boundary of physical end address 121 (or logical end address 120). Therefore, where the addressing scheme used to address buffer storage elements 104 and mirror space storage elements 137 requires physical addressing, then mirror space storage elements 137, namely its first constituent storage element, must be next or sequential in both physical and logical address sequence to physical end address 121 and logical end address 120, respectively. As shown, logical end address 120 will denote the last available physical address within the circular portion of circular queue 100, while mirror space logical start address 129 will denote the first available physical address for the mirror space storage elements 137, i.e., those elements not within the circular portion of circular queue 100 or occurring after physical end address 121.
When using a only a logical addressing scheme, logical end address 120 and mirror space logical start address 129 need only be logically address sequential, and can be optionally physically address non-sequential. Typically, it is preferable to maintain both the physical sequence and logical sequence of buffer storage elements 104 and mirror space storage elements 137, thereby permitting both physical and logical addressing to the circular queue 100.
As is similar to the description of operation described regarding FIG.'s 2 a-d, the circular queue 100 of FIG. 1 and FIG. 3 operates in a similar manner except for: 1) operations relating to the storage or retrieval of data into storage elements of buffer storage elements 104 wherein no addressing checking or verification is done on a storage element by storage element basis; and 2) the operations relating to the operation of mirror space storage elements 137 and circular queue copy storage elements 142, if applicable.
As shown in FIG. 3, an entirely empty queue is shown, wherein write address pointer 108 points to the first available storage element, and read address pointer 112 points to the last storage element read, or as shown, initialized to the last storage element of buffer storage elements 104. However, the storage elements of circular queue copy storage elements 142 are ‘mirrored’ by the storage elements of mirror space storage elements 137. Functionally, the corresponding storage elements of mirror space storage elements 137 will be identical in function to their corresponding storage elements of circular queue copy storage elements 142, except that the storage elements of mirror space storage elements 137 are at different physical addresses and logical addresses from their ‘identical’ counterparts in circular queue copy storage elements 142. Usually, the addresses of mirror space storage elements 137 will be offset by the size of buffer storage elements 104.
Referring again to FIG. 1, the state of buffer storage elements 104 is shown after a period of writing and reading data to and from the queue. As shown in FIG. 1, Data Group (31) is effectively divided into two subgroups comprising Data Group 31(A) and Data Group 31(B). Data Group (31) is written or stored into buffer storage elements 104 up to physical end address 121, thereby creating Data Group (31A). Data Group (31B) is effectively created by continuing to write Data Group (31) after the write process exceeds or traverses physical end address 121 and continues to write into mirror space storage elements 137. The write process (or read process) of the present invention differs from prior art in that all the data to be written (read) is first written (read) and then a positional update of the appropriate pointer is made subsequent to the writing or storing process (or reading or retrieving process). Once the storage of Data Group (31) has completed, those storage elements within mirror space storage elements 137 are then copied to their corresponding storage elements of circular queue copy storage elements 142 within buffer storage elements 104, thereby creating an identical alternative Data Group (31B). Data Group (31B) is located entirely within the circular portion of the circular queue. The pointer address is next updated or “repositioned” to reflect the next available write address within the circular queue. Subsequent write operations proceed in storing future data groups into buffer storage elements 104 and updating the pointer address upon completion until physical end address 121 is once again traversed. In the first embodiment, each occurrence of writing across physical end address 121 results in copies of the portion of the most recent data or data group which is written into mirror space storage elements 137 to be copied from mirror space storage elements 137 to circular queue copy storage elements 142. The pointer address may be updated at any time after the read, write, or access process has substantially completed, and may occur before, during, or after the copying from mirror space storage elements 137 to circular queue copy storage elements 142. As described herein, the pointer update will be after the copying.
It is preferable to the size of mirror space storage elements 137 to a size sufficient to store the maximum possible data group of all possible data groups to be transmitted. To properly determine the number of storage elements within mirror space storage elements 137, the type of data, and whether the data is fixed in size, limited in size, or unknown in size is significant, For fixed and limited sized data groups, the size of mirror space storage elements 137 will be at least the fixed data size or largest possible data group size, respectively. For unknown data group sizes, the mirror space storage elements 137 cannot be sized to insure operation without overflowing the mirror space storage elements 137. As a result, for data group sizes exceeding a certain predetermined size, each data group must be pre-divided by the transmitter such that they do not exceed the cumulative size of mirror space storage elements 137. This division will be required prior to transferring the data or each data group into circular queue 100 to insure proper operation. Regardless, the mirror space must be sized to avoid any overflow while accessing the storage elements within the mirror space.
The circular queue of the present invention does not check for the positional or address status of the particular pointer or pointers in use during a substantial portion of the read or write process to the circular queue. The address status of the read or write process is determined after the one (if only one storage element need be accessed) or more (where multiple storage elements need be accessed) accesses to the storage elements is completed. This permits much more efficient use of time for the read and write processes by deleting the repetitive step of address checking or verification before or after each storage element access. This is particularly beneficial where the data rate approaches the ability of the controlling processor, controller, or input output device, system component, time available, or the like, to read or write such data, such as in a high speed serial data transfer system.
Referring now to FIG. 5, a flow diagram for a prior art write process to a circular queue is shown. Typically, the data is input via data input step 501. When as the write process to the circular queue begins, a check of the position or address of write address pointer 108 is done as shown by the step identified as circular queue end traversed check 509. Where the position or address of the write address pointer 108 points to a next storage element within the boundary of circular queue 200, then a single storage element is written as identified by the write storage element data step 513. The write address pointer 108 is then incremented (by a storage element address unit) as shown by update pointer address step 517. Next, an evaluation is made as to whether or not additional data remains to be written, as identified by the write complete determination step 522. Where the write to the circular queue 200 has not finished, then the steps of circular queue end traversed check 509, write storage element data step 513, update pointer address step 517, and write complete determination step 522 repeat until either all the data is written to the queue or write address pointer 108 reaches physical end address 121.
Where the position or address of write address pointer 108 points to a next storage element outside the end boundary of the circular queue 200, the pointer is ‘reset’, i.e., returned to the position which references logical start address 116 and physical start address 117, and the write process resumes writing storage elements at the reset pointer address. The write process within circular queue 200 then continues until such time as the write process fully completes, the read address pointer 112 is encountered, or a system event halts or terminates the write process, or the like. After the write process fully completes, then the transfer of data from the circular queue to another transfer function, routine or device is enabled as designated by enable data transmission step 551 and the data is read from the circular queue 200 and provided to the application, function, routine or device. When the queue or buffer transfer process has entirely completed, as is designated by terminate queue access step 555, all data has been written to the queue, held by the queue, and provided to the next application, function, routine, device, or the like.
The flow diagram of the first embodiment of this invention is shown in FIG. 6a. Such a process flow accomplishes a write process to circular queue 100 in a manner which reduces the time to achieve the fully completed write process. As shown in FIG. 6a, by data input step 501, the data is inputted to the queue. The write process proceeds until all data input elements are written, i.e., the write process is substantially complete, as shown by write all data to storage elements step 613. Where the data to be written exceeds the number of storage elements remaining until logical end address 120 or physical end address 121 is reached, the write process continues into mirror space storage elements 137, wherein as many storage elements of mirror space storage elements 137 are used as required to substantially complete the write process to the storage elements. After all storage elements are written, the write address pointer 108 is re-determined or calculated by adding its previously known position to the number of storage elements that were written by the write process since the prior re-determination or calculation of the reposition pointer step 617. A check or verification of the pointer position is then made to determine whether or not the write process traversed the logical end address 120 or physical end address 121 of the circular queue.
If the circular queue 100 physical or logical end boundary was not traversed, then transmission of the circular queue data is enabled, as identified by enable data transmission step 551, and the write process to the circular queue 100 has entirely completed.
If the write process and therefore the write address pointer 108 address traverses the logical end address 120 or physical end address 121, then the data written into the storage elements of mirror space storage elements 137 during this write process are copied to circular queue copy storage elements 142. This copy process can be implemented using linear system level copy functions or calls, wherein only the recently written storage elements having current valid data and within mirror space storage elements 137 are copied into circular queue copy storage elements 142. This copy process is preferably accomplished by specifying the data start address (the first storage location in mirror space storage elements 137), the number of storage elements to be copied (i.e., the number of storage elements written into mirror space storage elements 137), and a first address position to write or store the data (the first storage location in circular queue copy storage elements 142 or buffer storage elements 104).
As a result the copy process, all the data within circular queue 100 exists in two types of recognized and unique queue spaces. First, all written data exists within the circular portion of circular queue 100. Second, the data likewise resides in an address continuous linear space, which starts within the circular portion of circular queue 100 and includes some or all of the storage elements within mirror space storage elements 137.
Consequently, the data for circular queue 100 can be read both by those calling or system routines or functions which operate on circular queues, and also those calling or system routines or queues which operate on (or only on) linear arrays of storage elements. Therefore, by implementing the mirror space, the write process or read process efficiency is improved and the higher level programming can be simplified or implemented by using those calling routines or functions that operate on linear only or circular only storage elements, as well as a combination of linear only and circular only functions or routines.
Alternatively, it is possible to implement the scheme of FIG. 6a, by relocating write all data to storage elements step 613 and reposition pointer step 617 to immediately precede enable data transmission step 551 and to be subsequent to circular queue end traversed check 509 ‘NO’ path and reposition pointer step 647. Effectively, by restructuring in such a manner, a change occurs wherein the pointer position is not tested until such time as the next write or read process is beginning or scheduled. Such a restructured implementation is shown in FIG. 6b. Either implementation functions in a similar manner.
In a second embodiment, the write and read functions to the queue occur in a similar manner as the first preferred embodiment, except where after the logical end address 120 or physical end address 121 is traversed, the data within the mirror space storage elements 137 is not copied to the storage elements within circular queue 100. This creates a circular queue or buffer wherein the precise address or storage element which is last used before resetting the appropriate pointer to logical start address 116 or physical start address 117 varies due to the current written data. In effect, the data ‘borrows’ storage elements from mirror space storage elements 137 to complete the write process and then accesses the borrowed storage elements to complete the read process. Consequently, this particular embodiment functions best typically as a ‘linear’ circular queue and may not be functionally compatible with circular queue calling fuctions or routines, i.e., those circular queues which return at a particular address.
The second embodiment is advantageous where the mirror space storage elements 137 copy time is sufficient to impact the ability of the queue or buffer to accept or receive data. It is also advantageous where the programming environment uses only linear type functions and subroutines, as the necessity of maintaining circular queue structures may not justify the increased complexity of programming for various applications.
If the write process and therefore the write address pointer 108 address traverses the logical end address 120 or physical end address 121, then the data written into the storage elements of mirror space storage elements 137 during this write process is not copied to circular queue copy storage elements 142, as described above in the first embodiment, rather, the write address pointer 108 is reset to logical start address 116 or physical start address 117. After resetting write address pointer 108, the operation of the circular queue continues. Since no data is copied to the beginning of the circular queue, and the last valid storage element varies over time, then usually only linear type functions or routines will reliably function with this embodiment of the inventive concepts employed by this circular queue.
The flow diagram of the second embodiment of this invention is shown in FIG. 7a. Such a process flow accomplishes a write process to circular queue 100 in a manner which also reduces the time to achieve the fully completed write process. As shown in FIG. 7a, by data input step 501, the data is inputted to the queue. The write process proceeds until all data input elements are written, i.e., the write process is substantially complete, as shown by write all data to storage elements step 613. Where the data to be written exceeds the number of storage elements remaining until logical end address 120 or physical end address 121 is reached, the write process continues into mirror space storage elements 137, wherein as many storage elements of mirror space storage elements 137 are used as required to substantially complete the write process to the storage elements. After all storage elements are written, the write address pointer 108 is re-determined or calculated by adding its previously known position to the number of storage elements that were written by the write process since the prior re-determination or calculation of the reposition pointer step 617. A check or verification of the pointer position is then made to determine whether or not the write process traversed the logical end address 120 or physical end address 121 of the circular queue, as is shown by circular queue end traversed check 509.
If the circular queue 100 physical or logical end boundary was not traversed, then transmission of the circular queue data is enabled, as identified by enable data transmission step 551, and the write process to the circular queue 100 has entirely completed, as shown by end queue processes step 530.
If the write process and therefore the write address pointer 108 address traversed the logical end address 120 or physical end address 121, then the data written into the storage elements of mirror space storage elements 137 during this write process are not copied to circular queue copy storage elements 142. Instead, the write address pointer 108 is reset, as shown by reset pointer step 526, to either logical start address 116 or physical start address 117. Thereafter, transmission of the circular queue data is enabled, as identified by enable data transmission step 551, and the write process to the circular queue 100 has entirely completed, as shown by end queue processes step 530.
Alternatively, it is possible to implement the scheme of FIG. 7a, by relocating circular queue end traversed check 509 and reset pointer step 526 to immediately precede write all data to storage elements step 613 and to be subsequent to data input step 501. Effectively, by restructuring in such a manner, a change occurs wherein the pointer position is not tested until such time as the next write or read process is beginning or scheduled. Such a restructured implementation is shown in FIG. 7b. Either implementation functions in a similar manner.
Referring next to FIG. 8, shown is an embodiment employing the circular queue with additional buffer space wherein the functionality of the improved circular queue is employed to transfer data a higher efficiency rate or efficiency of use of the transferring input/output hardware devices.
Generally, one or more of many programs will be competing for a limited number of or perhaps only one serial output device. As implied here, a serial input/output (I/O) device could include: 1) one or more simple buffers and drivers; 2) a modem device; 3) an infra-red input/output device; 4) a modem; 5) a UART device; or, more generally, 6) those devices or class of devices used to transfer data from a first device or processing unit to a second device or processing unit or to another function or area within the first device or first processing unit. As an example of the serial input/output device, and as in FIG. 8, a UART 978 is shown. The UART 978 is capable of full duplex transmission of data, and functions as the serial I/O device which transmits data across serial transmit link 981.
As using programs compete for the transfer of data using a serial I/O scheme, various implementations have been employed in the art and are well known. A first prior art scheme permits the operating system, such as Operating System 901, to arbitrate and allocate as to which one of many potential using program will actually access the serial (I/O) device and for what amount of time. Upon apparent completion of use or upon actual completion of use of the serial (I/O) device by the selected using program, complete control and or use of the device can be returned to the operating system, thereby permitting other using programs to access the serial (I/O) device. A second prior art scheme, similar to the first scheme, permits the using program to maintain exclusive control over the serial I/O device (commonly referred to as ‘locking’ the serial I/O device) until such time as the selected using program completes its data transfer, or is terminated. Such a scheme has typically been previously employed in transferring data to printers, or where the using program transfers data employing modems. Such schemes generally require the non-selected using programs to wait until such time as the selected using program completes its task.
In real time operating systems (RTOS) such as those implemented in cellular phones, certain tasks or using programs must be completed within a specific time. Consequently, in order to complete all such tasks in timely manners, the using programs must share the input/output resources. A manager program such as implemented by Circular Queue Manager Program 926 permits multiple access while allowing each using program to have apparent dedicated access to the limited number of serial (I/O) devices or a system's single serial I/O device.
In this embodiment, for Program A 905 a, Program B 905 b, Program C 905 c, to Program n 905 n to transfer data to a corresponding program, then the transferring program such as Program A 905 a first registers with Circular Queue Manager Program 926, thereby obtaining a unique identifier. Using the identifier, Program A 905 a begins transfer of data by communicating with software interface driver 911. Typically, this will be done using one or more system calls and/or using system hardware or busses which interface with software interface driver 911 identified by Program A transfer interlink 907 a, Program B transfer interlink 907 b, Program C transfer interlink 907 c, to Program n transfer interlink 907 n, for Program A 905 a Program B 905 b, Program C 905 c, to Program n 905 n, respectively. The software interface driver 911, incorporates with the data to be transferred control and transfer information bytes, and supplies circular queue 100 with the data, control and transfer information bytes, and then transfers all the data or functional control of the data to Circular Queue Manager Program 926. Whereupon, Circular Queue Manager Program 926 adds additional transferring information and either directs or transfers all of the data as modified to circular queue 100, either directly from software interface driver 911 to circular queue 100, or using transfer data interlink 913 to transfer the data from software interface driver 911 to receive buffer 965 and then to circular queue 100.
As implemented in the embodiment of FIG. 8, the data, control and transfer bytes are written into circular queue 100 using system function calls and/or internal buses associated with central processing unit (cpu) or Operating System 901. Pointer methods to identify the data within main memory are not preferred or used as the data is being consolidated into circular queue 100 for real time transfer. Such a consolidation is implemented to permit one or more programs such as Program A 905 a and Program B 905 b to share access to a single serial I/O device or to a limited number of serial I/O devices.
Once transfer of data is enabled, then Transmit ISR 973 or UART 978 signals the controlling cpu system or operating system its availability or status to transfer data. Bytes of data are transferred from circular queue 100 to UART 978. The Transmit ISR 973 communicates with Operating System 901 to effect a transfer of the desired data with control bytes as stored in circular queue 100 from it to UART 978. Since circular queue 100 is a FIFO type buffer, the read address pointer 112 identifies the next available data byte for transfer. As implemented here, the number of storage elements or bytes to be transferred is designated, and the read process of buffer storage elements 104 and mirror space storage elements 137 continues until all storage elements or bytes are transferred to UART 978 using Transmit ISR 973. A check or verification is then done as to whether or not the read address pointer 112 traversed the logical end address 120 or physical end address 121, and the read address pointer 112 is updated. Upon receipt of one or more of the bytes, the UART 978 processes the received data bytes, serializes the bytes into data bits, as necessary, and transmits the serialized data using serial transmit link 981 or the like.
The receive data path can also be shown by FIG. 8. As transmitted data is received from serial transmit link 981 by a corresponding receive UART 978, the data is transferred from the receive UART 978 using Receive ISR 968, and stored into receive buffer 965. The receive buffer 965 may be implemented using either a conventional write-check after every write process or a multiple-write then check process as described herein, supra. As shown in FIG. 8, the conventional write-check after every write process is implemented to avoid any possibility of data overrun of any memory past the mirror space memory address, if implemented.
Upon receipt of data by UART 978, the data is transferred using Receive ISR 968 to receive buffer 965. Once the data is stored or written into receive buffer 965, the data is transferred using a received side corresponding Circular Queue Manager Program 926 and received side corresponding software interface driver 911 to received side corresponding Program A 905 a, Program B 905 b, Program C 905 c, and/or to Program n 905 n using received side corresponding Program A transfer interlink 907 a, Program B transfer interlink 907 b, Program C transfer interlink 907 c, and/or Program n transfer interlink 907 n, respectively. Such data is delivered by the interlink to the appropriate receiving program or programs and is delivered using the system calls and/or hardware or busses of the receiving system. Typically, the data Will go through the reverse of the process of adding control and transfer data bytes as was implemented for transmission. The received side Circular Queue Manager Program 926 will control the transfer data from receive buffer 965 to received side corresponding software interface driver 911 using receive buffer interlink 964 and receive data interlink 914. Once received at software interface driver 911, the data is transferred to the appropriate receiving program or programs as designated by the control and transfer information.
Without losing generality, and except where noted, the further description of the inventive concepts will now be described in reference to a software program as shown in Appendix A which employs a circular queue including a mirror space. It will be apparent to those skilled in the arts of programming, operating system implementation, and computer design that the inventive concepts disclosed herein are equally applicable to those arts, and extend beyond those arts.
Attached in Appendix A is a modified program listing written in the “C” programming language and which implements another embodiment of the inventive concepts described herein. The structure of the program is such that a global read pointer (IsrIndex), global write pointer (FreeIndex), global queue free space available count (FreeBytesCount) integer and global transmit buffer (TxQBuf) and a local temporary pointer (tmp) are defined. The values of the read pointer and write pointer are initialized to ‘MAX_SIZE_TX_QUEUE’, i.e., the queue is empty (not shown). Likewise the value of the queue free space available count is initially set to the circular size of tide queue, i.e., MAX_SIZE_TX_QUEUE (initialization not shown).
The program operates by next copying data into the buffer using a memcpy call specifying the destination with tmp pointer, the source as RduRecPtr→SrcPtr and the quantity as RduRecPtr→Length. Next, tmp pointer is adjusted by adding RduRecPtr→Length, the number of bytes written. A check or verification is then made to determine whether or not the write process to the tmp pointer exceeded or traversed the circular end or overflowed into the mirror space. Where the circular end was traversed or exceeded or the data overflowed, then a second memcpy call is made to copy the mirror space data into the beginning of the circular queue (&LTxQMgr.TxQBuf[0]) by the number of bytes written into the mirror space, and the twp pointer is then set to the write address within the circular portion of the queue, by subtracting MAX_SIZE_TX_QUEUE from the current position of tmp. Next, the transmission of queue data is enabled by ENABLETXINT( ).
Initially, the UART will be inactive and the call to ENABLETXINT( ) will cause the cpu to register an interrupt and the interrupt service routine (ISR) will be called, The code will proceed to and make a call to LTxLoadIsr( ) and a location and a count of the data to transmit will be passed to the ISR routine. The ISR routine will load into the UART the lesser of the number of bytes to transmit or the maximum size that the UART can handle. Where the UART has been previously transmitting, then there will be additional requests for data bytes after the current data bytes have been transmitted. If there are no additional data bytes for transmission, then the ISR routine will disable transmission of data from the UART by calling DISABLETXINT( ).
LTxLoadIsr is called by the ISR when additional data bytes are requested by the ISR for transmission. If more the data is available, then LTxLoadIsr will update the data pointer in the ISR and return a count of the data bytes available in the circular queue awaiting transmission.
The above description of the preferred embodiments are provided to enable any person skilled in the art to make or use the present invention. Various modifications to these preferred embodiments will be readily apparent and capable of implementation to those persons skilled in the art. Further, various modifications to the herein disclosed preferred embodiments will be feasible without the employment of inventive faculties. Therefore, the present invention is not intended to be limited to the embodiments shown herein, rather, it should be accorded the widest permissible scope consistent with the appropriate principles and pursuant to the novel features and their disclosures herein.
APPENDIX A
//***********************************************************************
//
// COPYRIGHT 1998 Unpublished NEC America, Inc.
// All Rights Reserved, EXCEPT PERMISSION IS HEREBY GRANTED TO REPRODUCE
// THIS FIGURE FOR THE LIMITED PURPOSE OF COPYING ANY US OR FOREIGN PATENT
// THAT MAY ISSUE CONTAINING THIS FIGURE.
//
// THIS FILE MAY NOT BE COPIED, PRINTED OR DISTRIBUTED TO ANY UNAUTHORIZED
// PERSON, COMPUTER, NETWORK, OR MAGNETIC MEDIA OF ANY KIND WITHOUT THE
// EXPRESS WRITTEN CONSENT OF NEC AMERICA, INC., NEC CORP., OR THEIR
// ASSIGNS.
//
// PERMISSION IS HEREBY GRANTED TO REPRODUCE THIS FIGURE FOR THE LIMITED
// PURPOSE OF COPYING ANY US OR FOREIGN PATENT THAT MAY ISSUE.
//
//
// “. . .” will be used throughout to indicate 1 or more lines of code not
shown.
//
// “//” will be used to describe the purpose of the following line of code.
//
// This is the Link Layer Transmit Queue Manager Structure
//
// The key elements pertaining to this invention are
// the IsrIndex, (where the TX Isr gets the next byte to transmit)
// the FreeIndex, (where the next open spot is to load the TX queue)
// the FreeBytesCount, (how much room is left in the TX queue)
// and the TxQBuf. (which is the space allocated for the TX queue)
//
typedef struct LTxQManager
{
. . .
unsigned int IsrIndex; // read pointer
unsigned int FreeIndex; // write pointer
unsigned int FreeBytesCount; // of circular queue
unsigned char TxQBuf[MAX_SIZE_TX_QUEUE + MAX_SIZE_PACKET_LDU − 1];
}LTxQManager;
//
// This makes an instance of type LTxQManager, as opposed to providing a
// description of the structure like the typedef command above does.
//
static LTxQManager LTxQMgr;
//
//
//
// This routine, LTxStaffQueue, puts data into the TX queue. How the space
is
// allocated in the TX queue is not shown. Source data is in the RDuInfo
// structure pointed to by RduRecPtr and QDestPtr is the same as
// LTxQMgr.IsrIndex before the space in the TX queue was allocated.
//
unsigned char *LTxStaffQueue(RDuInfo *RduRecPtr, unsigned char *QDestPtr)
{
unsigned char *tmp = QDestPtr;
. . .
/* Staff the data bytes */
memcpy(tmp, // destination
RduRecPtr−>SrcPtr, // source
RduRecPtr−>Length); // quantity
tmp = tmp + (RduRecPtr−>Length); // update pointer position
. . .
/*check for overflow */
if ((char *)tmp >= (char *)&LTxQMgr.TxQBuf[MAX_SIZE_TX_QUEUE])
{
/* we have written into mirror space so */
/* copy overflow to the beginning of Tx Queue */
memcpy(&LTxQMgr.TxQBuf[0],
/* copy to start of circular queue */
&LTxQMgr.TxQBuf[MAX_SIZE_TX_QUEUE],
/* from start of mirror space */
(unsigned int) (tmp − &LTxQMgr.TxQBuf[MAX_SIZE_TX_QUEUE]));
/* relay seq number byte minus last byte in circular buffer =
   overflow size */
/* correct pointer */
tmp = tmp − MAX_SIZE_TX_QUEUE;
}
. . .
/* Enable the Tx Isr */
 ENABLETXINT( );
. . .
}
//
// The LTxLoadIsr routine is called by the TX Isr when it has completed
// transmitting all of the characters in the last block it was given.
//
unsigned int near LTxLoadIsr(unsigned char **LduStartAdrPtr)
{
unsigned int Return_Value = 0;
. . .
/* Check if next data bytes are ready to be transmitted */
if (LTxQMgr.TxQBuf[LTxQMgr.IsrIndex] == 0xAA)
{
/* tell the Isr where to get the data */
*LduStartAdrPtr = &LTxQMgr.TxQBuf[LTxQMgr,IsrIndex];
. . .
Return_Value = ‘length of data to transmit’
}
. . .
}
return Return_Value; // zero for no data otherwise length of data
}
//
// This Interrupt Service Routine (ISR) handles both RX and TX interrupts
// from the UART. Note! In the RX part that each time the pointer is
// incremented, there is a test for queue overflow. In the TX part, no test
for
// queue overflow is required. Data is guaranteed to be contiguous.
//
int S0RcvIsr (void)
{
. . .
// get a snap shot of interrupt reason
Mask = (unsigned char)inportb(FM_MISR);
if ((Mask & IMR_RXLEV) || (Mask & IMR_RXSTALE))
{
// RX interrupt part
do
{
Ch = (unsigned char)inportb( FM_RF );
//check if not full
if (LRxQMgr.RxBytesCount < MAX_SIZE_RX_QUEUE)
{
LRxQMgr.RxQBuf[LRxQMgr.RxTailIndex] = Ch;
LRxQMgr.RxTailIndex = LRxQMgr.RxTailIndex + 1;
if (LRxQMgr,RxTailIndex >= MAX_SIZE_RX_QUEUE)
{
LRxQMgr.RxTailIndex = 0;
}
LRxQMgr.RxBytesCount = LRxQMgr.RxBytesCount + 1;
}
. . .
}
while (SR_RXRDY & inportb(FM_SR)); //empty all the RX FIFO
}
// is this a TX interrupt?
if (IMR_TXLEV & inportb(FM_MISR))
{
// TX interrupt part
if (TxBytesCount <= 0)
{
//reload next service
TxBytesCount = (int) (*LTxLoadIsrPtr) (&Ptr);
if (TxBytesCount == 0)
{
//nothing to transmit
DISABLETXINT( );
. . .
return 0;
}
}
if (TxBytesCount <= MAX_TX_LOAD_CHRS)
{
Cnt = TxBytesCount;
}
else
{
Cnt = MAX_TX_LOAD_CHRS.;
}
TxBytesCount = TxBytesCount − Cnt;
// load in TX FIFO 32 bytes or remaining bytes
while (Cnt)
{
outportb((unsigned int) (FM_TF), *Ptr);
Ptr = Ptr + 1; // pointer is incremented without checking for
overflow
Cnt = Cnt − 1;
}
}
return 0;
}

Claims (34)

What is claimed is:
1. A method of using a circular queue comprising:
accessing a queue first storage element within a circular portion of the queue and identified by an access pointer;
accessing a queue second storage element outside the circular portion of the queue after traversing an end of the circular portion; and
adjusting the access pointer by a value representing the number of storage elements accessed.
2. The method of claim 1, wherein the step of adjusting the access pointer includes updating and checking the access pointer.
3. The method of claim 2, wherein the step of updating the access pointer includes adding to the access pointer a value representing the number of storage elements accessed.
4. The method of claim 3, wherein the value is derived from the number of storage elements accessed since a prior adjusting of the access pointer.
5. The method of claim 3, wherein the step of adjusting the access pointer is done using the number of storage elements accessed and the number of storage elements within the circular portion.
6. The method of claim 3, wherein the step of adjusting the access pointer is done using a modulus of the sum of the number of storage elements accessed since a prior adjusting of the access pointer and a prior access pointer value, and wherein the modulus is calculated by using the number of storage elements within the circular portion.
7. The method of claim 3, wherein the step of checking the access pointer includes determining whether the access pointer traversed the end of the circular portion by comparing the access pointer's position to the end of the circular portion.
8. The method of claim 7, wherein the step of determining whether the access pointer traversed the end includes comparing an address of the access pointer to an address of the end of the circular portion.
9. The method of claim 7, wherein the step of determining whether the access pointer traversed the end includes verifying the access pointer exceeded the end address of the circular portion.
10. The method of claim 7, wherein the access pointer is a read pointer and wherein the step of accessing a queue second storage element includes reading a storage element.
11. The method of claim 7, wherein the access pointer is a write pointer and wherein the step of accessing a queue second storage element includes writing a storage element.
12. The method of claim 1, wherein in the step of adjusting the access pointer the value used derives from the logical address representing the start of the circular queue.
13. The method of claim 1, wherein in the step of adjusting the access pointer the value used derives from the physical address representing the start of the circular queue.
14. The method of using a circular queue of claim 1 further comprising copying data from the second storage element to a storage element within the circular queue.
15. A method of using a circular queue comprising:
accessing a first plurality of storage elements within a circular portion of the queue wherein one of the first plurality of storage elements is identified by an access pointer;
accessing a second plurality of storage elements outside the circular portion of the queue after traversing an end of the circular portion; and
adjusting the access pointer by a value representing the number of storage elements accessed.
16. The method of claim 15, wherein the step of adjusting the access pointer includes updating and checking the access pointer.
17. The method of claim 16, wherein the step of updating the access pointer includes adding to the access pointer a value representing the number of storage elements accessed.
18. The method of claim 17, wherein the value is derived from the number of storage elements accessed since a prior adjusting of the access pointer.
19. The method of claim 17, wherein the step of adjusting the access pointer is done using the number of storage elements accessed and the number of storage elements within the circular portion.
20. The method of claim 17, wherein the step of adjusting the access pointer is done using a modulus of the sum of the number of storage elements accessed since a prior adjusting of the access pointer and a prior access pointer value, and wherein the modulus is calculated by the number of storage elements within the circular portion.
21. The method of claim 17, wherein the step of checking the access pointer includes determining whether the access pointer traversed the end of the circular portion by comparing the access pointer's position to the end of the circular portion.
22. The method of claim 21, wherein the step of determining whether the access pointer traversed the end includes comparing an address of the access pointer to an address of the end of the circular portion.
23. The method of claim 21, wherein the step of determining whether the access pointer traversed the end includes verifying the access pointer exceeded the end address of the circular portion.
24. The method of claim 21, wherein the access pointer is a read pointer and wherein the step of accessing a queue second storage element includes reading a storage element.
25. The method of claim 21, wherein the access pointer is a write pointer and wherein the step of accessing a queue second storage element includes writing a storage element.
26. The method of claim 15, wherein in the step of adjusting the access pointer the value used derives from the logical address representing the start of the circular queue.
27. The method of claim 15, wherein in the step of adjusting the access pointer the value used derives from the physical address representing the start of the circular queue.
28. The method of using a circular queue of claim 15 further comprising copying data within the second plurality of storage elements to within the circular queue.
29. A circular queue comprising:
a first plurality of storage elements including an end storage element each storage element being within a circular path of the queue for storing a first portion of first data;
a second plurality of storage elements each outside the circular path of the queue wherein one of the second plurality of storage elements is address continuous to one of the first plurality of storage elements and for storing a second portion of first data;
a write pointer for designating a storage element within the first plurality of storage elements to write; and
a read pointer for designating a storage element within the first plurality of storage elements to read.
30. The circular queue of claim 29, wherein each of the plurality of first storage elements and each of the plurality of second storage elements are logically address continuous.
31. The circular queue of claim 29, wherein each of the plurality of first storage elements and each of the plurality of second storage elements are physically address continuous.
32. The circular queue of claim 29, further comprising a plurality of designated storage elements within the first plurality of storage elements for storing the second portion of first data in the circular path and address sequential with the first portion of first data.
33. The circular queue of claim 32, wherein address sequential includes repositioning the write pointer.
34. The circular queue of claim 32, wherein address sequential includes repositioning the read pointer.
US09/222,378 1998-12-29 1998-12-29 System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue Expired - Fee Related US6314478B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US09/222,378 US6314478B1 (en) 1998-12-29 1998-12-29 System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US09/222,378 US6314478B1 (en) 1998-12-29 1998-12-29 System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue

Publications (1)

Publication Number Publication Date
US6314478B1 true US6314478B1 (en) 2001-11-06

Family

ID=22831953

Family Applications (1)

Application Number Title Priority Date Filing Date
US09/222,378 Expired - Fee Related US6314478B1 (en) 1998-12-29 1998-12-29 System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue

Country Status (1)

Country Link
US (1) US6314478B1 (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030005025A1 (en) * 2001-06-27 2003-01-02 Shavit Nir N. Load-balancing queues employing LIFO/FIFO work stealing
US20030007396A1 (en) * 2001-01-27 2003-01-09 Walker Anthony Mark Direct memory access controller for circular buffers
US20030056020A1 (en) * 2001-07-16 2003-03-20 Shailender Chaudhry Hardware message buffer for supporting inter-processor communication
US6538467B2 (en) * 2001-08-20 2003-03-25 Micron Technology, Inc. Multi-access FIFO queue
US6557053B1 (en) * 2000-01-04 2003-04-29 International Business Machines Corporation Queue manager for a buffer
US20030081542A1 (en) * 2001-11-01 2003-05-01 International Business Machines Corporation Empty indicators for weighted fair queues
US6823351B1 (en) * 2000-05-15 2004-11-23 Sun Microsystems, Inc. Work-stealing queues for parallel garbage collection
US6826583B1 (en) 2000-05-15 2004-11-30 Sun Microsystems, Inc. Local allocation buffers for parallel garbage collection
US20040267979A1 (en) * 2003-06-30 2004-12-30 Futral William T. Readdressable virtual DMA control and status registers
US20050129046A1 (en) * 2003-12-12 2005-06-16 Alok Kumar Method and system to determine whether a circular queue is empty or full
US6961727B2 (en) * 2001-03-15 2005-11-01 International Business Machines Corporation Method of automatically generating and disbanding data mirrors according to workload conditions
US20060029053A1 (en) * 2000-05-03 2006-02-09 At&T Laboratories-Cambridge Ltd. Data transfer, synchronising applications, and low latency networks
US20070032930A1 (en) * 2005-08-08 2007-02-08 Calsonic Kansei Corporation Vehicle data recording device
US20070255888A1 (en) * 2006-04-26 2007-11-01 Quanta Computer Inc. Method and apparatus for managing input data buffer of MP3 decoder
US20080013562A1 (en) * 2004-12-02 2008-01-17 Sony Corporation Apparatus And Method For Demultiplication
EP1923781A1 (en) * 2006-11-14 2008-05-21 Thomson Holding Germany GmbH & Co. OHG Method and device for sequentially processing a plurality of programs
US20080222370A1 (en) * 2007-03-09 2008-09-11 Texas Instruments Incorporated Method and apparatus for data stream management
US8024632B1 (en) * 2008-01-11 2011-09-20 Victor Konrad Method and mechanism for implementation-independent, on-line, end-to-end detection of faults in self-checking queues in digital hardware systems
US8086580B2 (en) 2005-01-11 2011-12-27 International Business Machines Corporation Handling access requests to a page while copying an updated page of data to storage
CN108733344A (en) * 2018-05-28 2018-11-02 深圳市道通智能航空技术有限公司 Data read-write method, device and circle queue
US20190332436A1 (en) * 2018-04-26 2019-10-31 SK Hynix Inc. Memory controller and operating method thereof
EP3567485A1 (en) * 2018-05-09 2019-11-13 Nxp B.V. A writing block for a receiver
DE10317904B4 (en) * 2002-04-19 2021-02-04 Denso Corporation Vehicle communication device and communication method for receiving from and transmitting to an external device

Citations (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5235676A (en) * 1988-04-18 1993-08-10 Sci Systems, Inc. Printing apparatus and method with interrupted protection and automated unattended secure operations
US5446839A (en) 1993-05-26 1995-08-29 Intel Corporation Method for controlling dataflow between a plurality of circular buffers
US5450544A (en) 1992-06-19 1995-09-12 Intel Corporation Method and apparatus for data buffering and queue management of digital motion video signals
US5515082A (en) 1994-06-08 1996-05-07 Trans-Lux Corporation Device for selectively displaying text received from a high-speed communication
US5519701A (en) 1995-03-29 1996-05-21 International Business Machines Corporation Architecture for high performance management of multiple circular FIFO storage means
US5584038A (en) 1994-03-01 1996-12-10 Intel Corporation Entry allocation in a circular buffer using wrap bits indicating whether a queue of the circular buffer has been traversed
US5623608A (en) 1994-11-14 1997-04-22 International Business Machines Corporation Method and apparatus for adaptive circular predictive buffer management
US5623621A (en) 1990-11-02 1997-04-22 Analog Devices, Inc. Apparatus for generating target addresses within a circular buffer including a register for storing position and size of the circular buffer
US5689693A (en) 1994-04-26 1997-11-18 Advanced Micro Devices, Inc. Range finding circuit for selecting a consecutive sequence of reorder buffer entries using circular carry lookahead
US5694125A (en) 1995-08-02 1997-12-02 Advance Hardware Architecture Sliding window with big gap data compression system
US5699530A (en) 1995-10-03 1997-12-16 Intel Corporation Circular RAM-based first-in/first-out buffer employing interleaved storage locations and cross pointers
US5832307A (en) 1996-08-19 1998-11-03 Hughes Electronics Corporation Satellite communication system overwriting not validated message stored in circular buffer with new message in accordance with address stored in last valid write address register
US5845092A (en) 1992-09-03 1998-12-01 Industrial Technology Research Institute Endpoint detection in a stand-alone real-time voice recognition system
US5870627A (en) 1995-12-20 1999-02-09 Cirrus Logic, Inc. System for managing direct memory access transfer in a multi-channel system using circular descriptor queue, descriptor FIFO, and receive status queue
US5873089A (en) 1995-09-04 1999-02-16 Hewlett-Packard Company Data handling system with circular queue formed in paged memory
US5968107A (en) * 1997-10-31 1999-10-19 Cummins Engine Company, Inc. System and method for engine parameter trending
US6000001A (en) 1997-09-05 1999-12-07 Micron Electronics, Inc. Multiple priority accelerated graphics port (AGP) request queue
US6044419A (en) * 1997-09-30 2000-03-28 Intel Corporation Memory handling system that backfills dual-port buffer from overflow buffer when dual-port buffer is no longer full
US6044434A (en) 1997-09-24 2000-03-28 Sony Corporation Circular buffer for processing audio samples
US6112266A (en) 1998-01-22 2000-08-29 Pc-Tel, Inc. Host signal processing modem using a software circular buffer in system memory and direct transfers of samples to maintain a communication signal
GB2350533A (en) 1999-05-28 2000-11-29 Mitel Corp Avoiding underflow or overflow in a circular buffer

Patent Citations (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5235676A (en) * 1988-04-18 1993-08-10 Sci Systems, Inc. Printing apparatus and method with interrupted protection and automated unattended secure operations
US5623621A (en) 1990-11-02 1997-04-22 Analog Devices, Inc. Apparatus for generating target addresses within a circular buffer including a register for storing position and size of the circular buffer
US5450544A (en) 1992-06-19 1995-09-12 Intel Corporation Method and apparatus for data buffering and queue management of digital motion video signals
US5845092A (en) 1992-09-03 1998-12-01 Industrial Technology Research Institute Endpoint detection in a stand-alone real-time voice recognition system
US5446839A (en) 1993-05-26 1995-08-29 Intel Corporation Method for controlling dataflow between a plurality of circular buffers
US5584038A (en) 1994-03-01 1996-12-10 Intel Corporation Entry allocation in a circular buffer using wrap bits indicating whether a queue of the circular buffer has been traversed
US5689693A (en) 1994-04-26 1997-11-18 Advanced Micro Devices, Inc. Range finding circuit for selecting a consecutive sequence of reorder buffer entries using circular carry lookahead
US5515082A (en) 1994-06-08 1996-05-07 Trans-Lux Corporation Device for selectively displaying text received from a high-speed communication
US5623608A (en) 1994-11-14 1997-04-22 International Business Machines Corporation Method and apparatus for adaptive circular predictive buffer management
US5519701A (en) 1995-03-29 1996-05-21 International Business Machines Corporation Architecture for high performance management of multiple circular FIFO storage means
US5694125A (en) 1995-08-02 1997-12-02 Advance Hardware Architecture Sliding window with big gap data compression system
US5873089A (en) 1995-09-04 1999-02-16 Hewlett-Packard Company Data handling system with circular queue formed in paged memory
US5699530A (en) 1995-10-03 1997-12-16 Intel Corporation Circular RAM-based first-in/first-out buffer employing interleaved storage locations and cross pointers
US5870627A (en) 1995-12-20 1999-02-09 Cirrus Logic, Inc. System for managing direct memory access transfer in a multi-channel system using circular descriptor queue, descriptor FIFO, and receive status queue
US5832307A (en) 1996-08-19 1998-11-03 Hughes Electronics Corporation Satellite communication system overwriting not validated message stored in circular buffer with new message in accordance with address stored in last valid write address register
US6000001A (en) 1997-09-05 1999-12-07 Micron Electronics, Inc. Multiple priority accelerated graphics port (AGP) request queue
US6044434A (en) 1997-09-24 2000-03-28 Sony Corporation Circular buffer for processing audio samples
US6044419A (en) * 1997-09-30 2000-03-28 Intel Corporation Memory handling system that backfills dual-port buffer from overflow buffer when dual-port buffer is no longer full
US5968107A (en) * 1997-10-31 1999-10-19 Cummins Engine Company, Inc. System and method for engine parameter trending
US6112266A (en) 1998-01-22 2000-08-29 Pc-Tel, Inc. Host signal processing modem using a software circular buffer in system memory and direct transfers of samples to maintain a communication signal
GB2350533A (en) 1999-05-28 2000-11-29 Mitel Corp Avoiding underflow or overflow in a circular buffer

Cited By (44)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423675B2 (en) 1999-05-04 2013-04-16 At&T Intellectual Property I, L.P. Data transfer, synchronising applications, and low latency networks
US8346971B2 (en) 1999-05-04 2013-01-01 At&T Intellectual Property I, Lp Data transfer, synchronising applications, and low latency networks
US9769274B2 (en) 1999-05-04 2017-09-19 At&T Investments Uk Llc Data transfer, synchronising applications, and low latency networks
US8843655B2 (en) 1999-05-04 2014-09-23 At&T Investments Uk Llc Data transfer, synchronising applications, and low latency networks
US8725903B2 (en) 1999-05-04 2014-05-13 At&T Intellectual Property I, L.P. Data transfer, synchronising applications, and low latency networks
US20080228946A1 (en) * 1999-05-04 2008-09-18 At&T Laboratories-Cambridge Ltd. Data transfer, synchronising applications, and low latency networks
US6557053B1 (en) * 2000-01-04 2003-04-29 International Business Machines Corporation Queue manager for a buffer
US8073994B2 (en) * 2000-05-03 2011-12-06 At&T Laboratories Data transfer, synchronising applications, and low latency networks
US20060029053A1 (en) * 2000-05-03 2006-02-09 At&T Laboratories-Cambridge Ltd. Data transfer, synchronising applications, and low latency networks
US20050132374A1 (en) * 2000-05-15 2005-06-16 Sun Microsystems, Inc. Work stealing queues for parallel garbage collection
US7640544B2 (en) 2000-05-15 2009-12-29 Sun Microsystems, Inc. Work stealing queues for parallel garbage collection
US6826583B1 (en) 2000-05-15 2004-11-30 Sun Microsystems, Inc. Local allocation buffers for parallel garbage collection
US6823351B1 (en) * 2000-05-15 2004-11-23 Sun Microsystems, Inc. Work-stealing queues for parallel garbage collection
US6725292B2 (en) * 2001-01-27 2004-04-20 Zarlink Semiconductor Limited Direct memory access controller for circular buffers
US20030007396A1 (en) * 2001-01-27 2003-01-09 Walker Anthony Mark Direct memory access controller for circular buffers
US6961727B2 (en) * 2001-03-15 2005-11-01 International Business Machines Corporation Method of automatically generating and disbanding data mirrors according to workload conditions
US20030005025A1 (en) * 2001-06-27 2003-01-02 Shavit Nir N. Load-balancing queues employing LIFO/FIFO work stealing
US7103887B2 (en) 2001-06-27 2006-09-05 Sun Microsystems, Inc. Load-balancing queues employing LIFO/FIFO work stealing
US7152232B2 (en) * 2001-07-16 2006-12-19 Sun Microsystems, Inc. Hardware message buffer for supporting inter-processor communication
US20030056020A1 (en) * 2001-07-16 2003-03-20 Shailender Chaudhry Hardware message buffer for supporting inter-processor communication
US6873180B2 (en) 2001-08-20 2005-03-29 Micron Technology, Inc. Multi-access FIFO queue
US6538467B2 (en) * 2001-08-20 2003-03-25 Micron Technology, Inc. Multi-access FIFO queue
US20030141897A1 (en) * 2001-08-20 2003-07-31 Micron Technology, Inc. Multi-access FIFO queue
US7310345B2 (en) * 2001-11-01 2007-12-18 International Business Machines Corporation Empty indicators for weighted fair queues
US20030081542A1 (en) * 2001-11-01 2003-05-01 International Business Machines Corporation Empty indicators for weighted fair queues
DE10317904B4 (en) * 2002-04-19 2021-02-04 Denso Corporation Vehicle communication device and communication method for receiving from and transmitting to an external device
US20040267979A1 (en) * 2003-06-30 2004-12-30 Futral William T. Readdressable virtual DMA control and status registers
US20050129046A1 (en) * 2003-12-12 2005-06-16 Alok Kumar Method and system to determine whether a circular queue is empty or full
US7499399B2 (en) * 2003-12-12 2009-03-03 Intel Corporation Method and system to determine whether a circular queue is empty or full
US8218560B2 (en) * 2004-12-02 2012-07-10 Sony Corporation Apparatus and method for demultiplication
US20080013562A1 (en) * 2004-12-02 2008-01-17 Sony Corporation Apparatus And Method For Demultiplication
US8086580B2 (en) 2005-01-11 2011-12-27 International Business Machines Corporation Handling access requests to a page while copying an updated page of data to storage
US20070032930A1 (en) * 2005-08-08 2007-02-08 Calsonic Kansei Corporation Vehicle data recording device
US7558656B2 (en) * 2005-08-08 2009-07-07 Calsonic Kansei Corporation Vehicle data recording device
US20070255888A1 (en) * 2006-04-26 2007-11-01 Quanta Computer Inc. Method and apparatus for managing input data buffer of MP3 decoder
EP1923781A1 (en) * 2006-11-14 2008-05-21 Thomson Holding Germany GmbH & Co. OHG Method and device for sequentially processing a plurality of programs
US20080222370A1 (en) * 2007-03-09 2008-09-11 Texas Instruments Incorporated Method and apparatus for data stream management
US8024632B1 (en) * 2008-01-11 2011-09-20 Victor Konrad Method and mechanism for implementation-independent, on-line, end-to-end detection of faults in self-checking queues in digital hardware systems
US20190332436A1 (en) * 2018-04-26 2019-10-31 SK Hynix Inc. Memory controller and operating method thereof
US10754692B2 (en) * 2018-04-26 2020-08-25 SK Hynix Inc. Memory controller and operating method thereof
EP3567485A1 (en) * 2018-05-09 2019-11-13 Nxp B.V. A writing block for a receiver
CN110471616A (en) * 2018-05-09 2019-11-19 恩智浦有限公司 Block is write for receiver
US11036657B2 (en) 2018-05-09 2021-06-15 Nxp B.V. Writing block for a receiver
CN108733344A (en) * 2018-05-28 2018-11-02 深圳市道通智能航空技术有限公司 Data read-write method, device and circle queue

Similar Documents

Publication Publication Date Title
US6314478B1 (en) System for accessing a space appended to a circular queue after traversing an end of the queue and upon completion copying data back to the queue
US4603380A (en) DASD cache block staging
US4272819A (en) Inter-subsystem direct transfer system
US5574944A (en) System for accessing distributed memory by breaking each accepted access request into series of instructions by using sets of parameters defined as logical channel context
EP0104588B1 (en) Peripheral storage system having multiple data transfer rates
US5237673A (en) Memory management method for coupled memory multiprocessor systems
US5659798A (en) Method and system for initiating and loading DMA controller registers by using user-level programs
US6542919B1 (en) Operating system for use with protection domains in a single address space
US6134619A (en) Method and apparatus for transporting messages between processors in a multiple processor system
US7487305B2 (en) Prioritized bus request scheduling mechanism for processing devices
CA1322058C (en) Multi-processor computer systems having shared memory and private cache memories
US5845331A (en) Memory system including guarded pointers
US4092715A (en) Input-output unit having extended addressing capability
US6282587B1 (en) Method and apparatus for accelerating the rendering of images
CA1189979A (en) Method and apparatus for managing a buffer pool referenced by batch and interactive processes
US4173783A (en) Method of accessing paged memory by an input-output unit
US5418927A (en) I/O cache controller containing a buffer memory partitioned into lines accessible by corresponding I/O devices and a directory to track the lines
US4730249A (en) Method to operate on large segments of data in a virtual memory data processing system
US6601146B2 (en) Technique for efficiently transferring moderate amounts of data across address space boundary
JP4295111B2 (en) Memory management system and memory access security grant method based on linear address
JP4977159B2 (en) Technology for executing atomic compare and swap instructions using a specific processor
US5740406A (en) Method and apparatus for providing fifo buffer input to an input/output device used in a computer system
EP1098250A1 (en) Cache using multiple logical ring units
WO1996035993A2 (en) Method and apparatus for consolidated buffer handling for computer device input/output
US5696990A (en) Method and apparatus for providing improved flow control for input/output operations in a computer system having a FIFO circuit and an overflow storage area

Legal Events

Date Code Title Description
AS Assignment

Owner name: NEC AMERICA, INC., NEW YORK

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:ETECHVERY, WILLIAM R.;REEL/FRAME:009699/0994

Effective date: 19981229

FPAY Fee payment

Year of fee payment: 4

AS Assignment

Owner name: NEC CORPORATION OF AMERICA, CALIFORNIA

Free format text: MERGER;ASSIGNOR:NEC AMERICA, INC.;REEL/FRAME:018239/0350

Effective date: 20060630

AS Assignment

Owner name: NEC CORPORATION OF AMERICA, CALIFORNIA

Free format text: CORRECTIVE ASSIGNMENT TO REMOVE AN ERRORNEOUSLY RECORDED PATENT NUMBER 5878039 FROM A DOCUMENT PREVIOUSLY RECORDED AT REEL 018239 FRAME 0350;ASSIGNOR:NEC AMERICA, INC.;REEL/FRAME:019069/0267

Effective date: 20060630

REMI Maintenance fee reminder mailed
LAPS Lapse for failure to pay maintenance fees
AS Assignment

Owner name: NEC CORPORATION OF AMERICA, TEXAS

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:NEC AMERICA, INC.;REEL/FRAME:023607/0528

Effective date: 20091001

STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

AS Assignment

Owner name: NEC AMERICA, INC., TEXAS

Free format text: CHANGE OF NAME;ASSIGNOR:NEC CORPORATION OF AMERICA;REEL/FRAME:023620/0903

Effective date: 20090923

FP Lapsed due to failure to pay maintenance fee

Effective date: 20091106