1. Field of the Invention
This invention relates to data communications and data delivery over communication media, and, more particularly, to host computer based data acquisition systems.
2. Description of the Relevant Art
IEEE 1394 is an international standard, low-cost digital interface that integrates entertainment, communication, and computing electronics into devices such as multimedia devices. Originated by Apple Computer as a desktop LAN and developed by the IEEE 1394 working group, IEEE 1394 is a hardware and software standard for transporting data at 100, 200, 400, or 800 megabits per second (Mbps). Maximum packet sizes are 512, 1024, 2048, and 4096 bytes depending on the transfer speed. 1394 provides 64-bit addressing—The 16 MSb's (most significant bits) are used for determining source/destination bus/node. As used herein, the terms “node” and “device” may be used interchangeably to denote a node on the 1394 bus.
There can be up to 1023 buses each with up to 63 nodes. The 48 LSb's (least significant bits) are used to access locations within a device's addressing space. 1394 provides for Direct Memory Access (DMA). DMA is the most powerful feature of the bus for the data acquisition purposes since it allows a device to transfer data from/into computer memory without microprocessor intervention, thus, making it very similar to the PCI bus.
IEEE 1394 also defines a digital interface—there is no need to convert digital data into analog and tolerate a loss of data integrity. 1394 is easy to use in that there is no need for terminators, device IDs, or elaborate setup. Another benefit of 1394 is that it is “hot pluggable”, meaning users can add or remove 1394 devices with the bus active. IEEE 1394 has a scaleable architecture, allowing users to mix 100, 200, 400, and 800 Mbps devices on a bus. IEEE 1394 also provides a flexible topology in that it supports daisy chaining and branching for true peer-to-peer communication between 1394 devices. In addition to asynchronous data transfer, 1394 provides isochronous data transfer, which guarantees delivery of time critical data, reducing costly buffer requirements.
Serial Bus Management provides overall configuration control of the serial bus in the form of optimizing arbitration timing, guarantee of adequate electrical power for all devices on the bus, assignment of which IEEE 1394 device is the cycle master, assignment of isochronous DMA controller ID, and notification of errors. Bus management is built upon IEEE 1212 standard register architecture. It should be noted that 1394 error notification is limited to general error detection. When an error has occurred, it may not be known when or where the error occurred, and so the delivery status of transmitted data may also be unknown.
There are two types of IEEE 1394 data transfer: asynchronous and isochronous. Asynchronous transport is the traditional computer memory-mapped, load and store interface. Data requests are sent to a specific address and an acknowledgment is returned. In addition to an architecture that scales with silicon technology, IEEE 1394 features a unique isochronous data DMA controller interface. Isochronous data DMA controllers provide guaranteed data transport at a pre-determined rate. This is especially important for time-critical multimedia data where just-in-time delivery eliminates the need for costly buffering.
Much like LANs and WANs, IEEE 1394 is defined by the high level application interfaces that use it, not a single physical implementation. Therefore as new silicon technologies allow high higher speeds, longer distances, and alternate media, IEEE 1394 will scale to enable new applications.
Perhaps most important for use as the digital interface for executer electronics is that IEEE 1394 is a peer-to-peer interface. This allows not only dubbing from one camcorder to another without a computer, but allows multiple computers to share a given camcorder without any special support in the camcorders or computers.
The IEEE 1394 bus was primarily intended for computer multimedia peripherals such as audio and video devices. One potential application for the IEEE 1394 bus is remote data acquisition and test and measurement. For example, the IEEE 1394 bus could be used to connect a remote data acquisition device or measurement device to a host computer. However, improved methods are desired for transferring data from a host computer system to a device, such as over an IEEE 1394 bus.
The present invention comprises various embodiments of a system and method for transferring data over a communications medium using double buffered data transfers. A host computer system may be coupled through a communication medium to a device, such as a data acquisition device or instrument, which may be further coupled to a unit under test (UUT). The device may comprise a first read buffer and a second read buffer for storing output data received from the host computer. The host computer may be operable to provide output data to the device, such as for analog output to the UUT, in a double buffered fashion for improved performance. The device may also use multiple DMA controllers and/or multiple DMA channels and pre-fetch mechanisms for improved performance.
In one embodiment, the method may comprise the device reading first data from the host computer and storing the first data in the first read buffer. The first data may then be transferred out from the first read buffer, e.g., after the data has been stored in the first read buffer. The device may then read second data from the host computer and store the second data in the second read buffer concurrently with the transfer of the first data out from the first read buffer. The second data may then be transferred out from the second read buffer after completion of the transfer of the first data out from the first read buffer. Further, the device may then read third data from the host computer and store the third data in the first read buffer concurrently with the transfer of the second data out from the second read buffer. The above operations may then continue in a double buffered fashion as set out above, wherein the data acquisition device reads data into one of the first read buffer and the second read buffer concurrently with transferring data out from the other one of the second read buffer and the first read buffer, respectively.
In one embodiment, the data acquisition device includes a first direct memory access (DMA) channel and a second DMA channel. In this embodiment, the first DMA channel reads data into one of the first read buffer and the second read buffer concurrently with the second DMA channel transferring data out from the other one of the second read buffer and the first read buffer, respectively. Also, the first DMA channel may be operable to read requested data as well as pre-fetch data to provide for a more continuous and uninterrupted flow of data in the system.
In one embodiment, after the first DMA channel reads data into one of the first read buffer and the second read buffer concurrently with the second DMA channel transferring data out from the other one of the second read buffer and the first read buffer, the method may synchronize the first DMA channel with the second DMA channel. For example, each DMA channel may enter a synchronization point, issue a continue command to the other DMA channel, issue a pause command to itself, then issue another continue command to the other DMA channel. In this manner, both DMA channels may then proceed with the data transfer in a synchronous manner. Other synchronizing approaches using the pause and continue command are also contemplated.
Other advantages and details of the invention will become apparent upon reading the following detailed description and upon reference to the accompanying drawings in which:
While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims.
Incorporation by Reference
U.S. Pat. No. 5,875,313 titled “PCI Bus to IEEE 1394 Bus Translator Employing Write Pipe-Lining and Sequential Write Combining”, whose inventors are Glen O. Sescila III, Brian K. Odom, and Kevin L. Schultz, and which issued on Feb. 23, 1999, is hereby incorporated by reference in its entirety as though fully and completely set forth herein.
U.S. patent application Ser. No. 09/659,914 titled “System and Method for Transferring Data Over A Communication Medium Using Double-Buffered Data Transfer Links”, whose inventors are David W. Madden and Aljosa Vrancic, and which was filed on Sep. 11, 2000, is hereby incorporated by reference in its entirety as though fully and completely set forth herein.
FIG. 1—A Data Acquisition System
As
The sensor 112 may be any type of transducer which is operable to detect environmental conditions and send sensor data to the instrument 110. The sensor 112 may also be operable to receive data from the instrument 110. The instrument 110 may be a data acquisition (DAQ) device, which combined with the sensor 112, may be operable to collect data concerning any of various phenomena, such as pressure, temperature, chemical content, current, resistance, voltage, or any other detectable attribute. The instrument or DAQ device 110 may also include data generation capabilities. The host computer system 108 may be operable to control the instrument 110 by sending requests to read from or write to the instrument's memory registers. The host computer system 108 may be further operable to obtain data from the instrument 110 for storage and analysis on the host computer system 108, either by issuing read requests or by programming the instrument 110 to send data to the memory of the host computer 108. Additionally, the host computer system 108 may be operable to send data, such as waveform data, to the device 110 for various purposes, such as for use in stimulating a unit under test (UUT), either by issuing write requests or by programming the instrument 110 to read data from the memory of the host computer 108. The host computer 108 preferably includes a memory medium which may include a software architecture similar to that shown in FIG. 4.
FIG. 2A: A 1394/PCI Data Acquisition System
In one embodiment, as shown in
FIG. 2B: A 1394/PCI Data Acquisition System
FIG. 3: A 1394 Data Acquisition System
Thus, although in the embodiments described below the system includes a single DMA controller operating two DMA channels, in other embodiments of the invention, there may be multiple DMA controllers, e.g., one DMA controller per DMA channel. In either approach, the techniques described herein are applicable. In other words, in the approaches described herein, the terms “DMA controller” and “DMA channel” may be used interchangeably.
FIG. 4: Software Architecture
FIG. 5: A Double Buffered Data Acquisition System
In one embodiment, host memory 520 may comprise an ordered series of memory blocks 521-530 (whose number and labels are for illustration purposes only). In one embodiment the host memory 520 may comprise a virtual memory buffer in the form of a linked list of nodes describing successive blocks of contiguous physical memory residing on the host computer. During a data output operation to the device 110, e.g., an “analog out” operation, the Translator 204 may be operable to pre-fetch additional data from the successive blocks of host memory 520 in response to data reads requested by DMA channel 1321A, and to store both the requested data and the pre-fetched data in one of the read buffers 322. In one embodiment, the DMA channels 321A and 321B may be operable to perform tasks in parallel. For example, DMA channel 1321A may request a read from host memory 520, which may trigger a pre-fetch of data from the host computer to read buffer 1322A, while DMA channel 2321B consumes previously pre-fetched data from the Translator's read buffer 2322B. In other words, while DMA channel 2321B is consuming the pre-fetched data from the Translator's read buffer 1322A, the Translator may be pre-fetching a next block of data from the host memory 520 and storing the next block of data into the Translator's read buffer 2322B, i.e., transfers data from the read buffer 2322B out to the FIFO 550. In one embodiment, DMA channel 1321A may be operable to program DMA channel 2321B to consume the pre-fetched data from the Translator's read buffer 322, providing transfer information to DMA channel 2321B indicating memory locations from which data is to be read (consumed). In one embodiment, DMA channel 2321B consuming pre-fetched data from the Translator's read buffer 322 comprises DMA channel 2321B making successive data reads from the Translator's read buffer 322 and storing the data in the DAQ hardware's FIFO 550.
In one embodiment data transfer instructions may be provided to the device by the host computer system 108 in the form of a linked-list of transfer nodes which may be transferred to a remote heap on the device in a double buffered manner as described in U.S. patent application Ser. No. 09/659,914 titled “System and Method for Transferring Data Over A Communication Medium Using Double-Buffered Data Transfer Links”, which was incorporated by reference above. Further descriptions of this parallel double buffered data transfer are presented as flow charts in
FIG. 6: Double Buffering
FIG. 7: A Double Buffered Data Transfer Process
As
Then in 708, the second data may be transferred from the second read buffer concurrently with the data acquisition device reading third data from the host computer and storing the third data in the first read buffer, as indicated in 710. It should be noted that the transfer of the second data out from the second read buffer preferably occurs after completion of the transfer of the first data out from the first read buffer. In other words, the process may only maintain one output stream of data to the FIFO 550, and so data may be read only from one read buffer at a time.
Thus, as long as there are data to be read from the host computer system, the process may read to and write from the two read buffers in a concurrent manner to effect a double buffered data transfer scheme. Such a scheme may as much as double the performance of the system.
FIG. 8: A Double Buffered Data Transfer Process
In one embodiment, after the Translator 204 pre-fetches the data, the two DMA channels 321A and 321B may synchronize before proceeding with the data transfer process. This event in the process is referred to as a sync point. In one embodiment, the DMA channel synchronization may operate according to the following rules: DMA channel 1321A may not initiate the next read/pre-fetch into read buffer 1322A (or 2321) until DMA channel 2321B has finished consuming the pre-fetched data from read buffer 1322A (or 2322B); and DMA channel 2321B may not begin consuming the pre-fetched data from read buffer 1322A (or 2322B) until the DMA channel 1321A initiated transfer of data into read buffer 1322A (or 2322B) has been completed. In this way, conflicts between data transfer operations on a particular read buffer may be avoided. The synchronization process is described in more detail below with reference to
After the Translator 204 pre-fetches the data, DMA channel 2321B may begin consuming the data in read buffer 1322A, as indicated by 811. In the embodiment described above in which the requested read data is stored in the temporary memory location Temp A 340, the DMA channel 2321B may read (consume) the requested read data from Temp A 340 before reading (consuming) the data in read buffer 1322A. Meanwhile, DMA channel 1321A may request another read for 4 (or 2 or 1) bytes of data from the host memory 520, as shown in 810. As described above, the read requested by DMA channel 1321A may trigger the translator to pre-fetch 2K of data from the host memory 520 to read buffer 2322B, as indicated by 812 (and transfer the requested read data to Temp B 322B, in one embodiment). Thus, new data may be pre-fetched into read buffer 2322B while previously fetched data is consumed (read) from read buffer 1322A.
In one embodiment, after 811 and 812, the two DMA channels 321A and 321B may synchronize again, as described above, and as described in detail below with reference to
In one embodiment, after 815 and 816, the two DMA channels 321A and 321B may synchronize again, as described above. Then in 818 a determination may be made whether there are more data to be transferred in the I/O operation. If no more data are to be transferred, the process may end. Otherwise, as
FIGS. 9A-9E—DMA Channel Synchronization
For example, in an embodiment in which a guarantee can be made that DMA channel 1320 will always reach the synchronization point before DMA channel 2321, the synchronization of the two DMA channels may be achieved by decomposing the synchronization point 813, as shown in FIG. 9A. As
If no guarantees can be made which of the DMA channels will reach synchronization point 813 first, a more complex algorithm may be required, such as that shown in FIG. 9C. When any of the DMA channels enters the synchronization point, it may issue continue command 911 or 912 on the other channel, and then pause itself, e.g., by pause command 913 or 914. Once a DMA channel is awakened, it may re-issue the continue command 915 or 916 to the other DMA channel. For example, in the case that DMA channel 1320 reaches the synchronization point first, it may first issue continue command 911 and then pause itself 913. Since DMA channel 2 is running, the continue command 911 will have no effect. Once DMA channel 2 reaches the synchronization point it may issue continue command 912 and then pause itself 914. The continue command 912 may awaken DMA channel 1, which in turn may execute continue command 915 and proceed to run. The continue command 915 may awaken the DMA channel 1, which may then proceed to run. The final result is that both DMA channels may continue running after they rendezvous at the synchronization point. Again, the entire process has been achieved by only using continue and pause commands.
In one particular embodiment, the execution may proceed as follows: DMA channel 1 may reach the continue command 911 first. Since DMA channel 2 is running, the command will have no effect. Next, DMA channel 2 may execute the continue command 912. Since DMA channel 1 is running the command again will have no effect. DMA channel 2 may then pause itself by executing 914. Finally, DMA channel 1 may pause itself by executing 913. Since both DMA channels are paused, a deadlock state is reached. To prevent deadlocks, an algorithm such as that shown in
Another solution may be to combine commands 911 and 913, and 912 and 914 into single atomic execution commands 930 and 931, as shown in
It is noted that the examples presented above can easily be extended to other synchronization points of
While the present invention has been described with reference to particular embodiments, it will be understood that the embodiments are illustrative and that the invention scope is not so limited. Any variations, modifications, additions, and improvements to the embodiments described are possible. These variations, modifications, additions, and improvements may fall within the scope of the inventions as detailed within the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4908748 | Pathak et al. | Mar 1990 | A |
5150456 | Wu et al. | Sep 1992 | A |
5659749 | Mitchell et al. | Aug 1997 | A |
5664092 | Waites | Sep 1997 | A |
5678063 | Odom et al. | Oct 1997 | A |
5686917 | Odom et al. | Nov 1997 | A |
5748916 | Conway et al. | May 1998 | A |
5842006 | Harvey et al. | Nov 1998 | A |
5889480 | Kim | Mar 1999 | A |
6009363 | Beckert et al. | Dec 1999 | A |
6145045 | Falik et al. | Nov 2000 | A |
6640312 | Thomson et al. | Oct 2003 | B1 |
6711647 | Holehan | Mar 2004 | B1 |
20030236938 | Bennett | Dec 2003 | A1 |
Number | Date | Country | |
---|---|---|---|
20040044811 A1 | Mar 2004 | US |