SYSTEM AND METHOD FOR CONNECTING A LOGIC CIRCUIT SIMULATION TO A NETWORK
A system and method for connecting a running logic circuit simulation to a network running at a higher speed that includes a computer for receiving data packets from the network and storing the received data packets in a first buffer. The computer next transmits the received data packets to an electronic circuit in the logic circuit simulation at a slower speed. The computer also receives data packets from the electronic device under simulation, and stores the data packets received from the electronic device under simulation in a second buffer. The computer then transmits the data packets received from the electronic device under simulation to the network at a higher speed.
The present application is a continuation-in-part application of copending U.S. patent application, entitled “METHOD FOR CONNECTING A HARDWARE EMULATOR TO A NETWORK,” Ser. No. 09/751,573, filed on Dec. 28, 2000.
BACKGROUND OF THE INVENTIONPrior to reducing an integrated circuit design to a form suitable for fabrication, the integrated circuit design is often simulated in software on a computer, and emulated in hardware to allow the design to be optimized and debugged. Typically, using a hardware description language (e.g., VHDL), the circuit designer prepares a hardware description of the integrated circuit, which is then compiled into a software model to be simulated on a computer (e.g., an engineering workstation). Often, the hardware description can also be compiled into a hardware model that can be emulated in a hardware emulator. A hardware emulator suitable for such use typically includes field programmable gate arrays (FPGAs) that serve as a breadboard for implementing the integrated circuit design. Both the simulation and the emulator typically run at a slower speed than a computer network (e.g., an Ethernet network).
When an integrated circuit that has a computer network interface is simulated or emulated, network activities are usually simulated or emulated at the speed of the circuit emulator or the circuit simulation. When using a circuit emulator, a conventional network-emulation device is typically connected to a port of the circuit emulator. The circuit emulator receives data packets from the network-emulation device, re-packages the data and transmits the re-packaged data back at the speed of the circuit emulator. The re-packaged data is then received by the network-emulation device, which inspects the re-packaged data to determine if the integrated circuit under emulation in the circuit emulator correctly sends and receives data packets. However, on balance, such a conventional network-emulation device does not emulate network behavior accurately and correctly.
Alternatively, another conventional technique for connecting a circuit emulator to the network requires slowing down the network, receiving signals from the slowed network and translating the signals into suitable electrical signals in the form that the circuit emulator can accept. The circuit emulator, which typically operates at a slower speed than the network, can also send packets to the slowed network. However, because the network is designed to operate at a different speed, timing issues may arise in such a slowed network. These timing issues may require further modification to the network to resolve. Such modifications are undesirable because the modified network may not adequately represent network characteristics. Because not all network devices can be slowed to the circuit emulator speed, the circuit emulator is typically also limited to communication with a small subset of devices on the network.
Shortcomings of an emulation are typically also present in a logic circuit simulation.
SUMMARY OF THE INVENTIONThe present invention allows a logic circuit simulator (“circuit simulation”) running on a host processor to connect to a computer network at full network speed. The present invention provides a method and an apparatus for transferring data packets between a circuit simulation and the network. In one embodiment, an interface software program also installed on a host computer (e.g., a personal computer) is provided to handle communication between the network and the circuit simulator. The network can be, for example, an Ethernet network.
According to the present invention, data packets addressed to a device under simulation, or alternatively, addressed to a workstation connected to the network through the circuit simulation, is received and stored in buffers of the host computer. (In one example, a workstation is connected to a network through a simulated network interface.) The interface software in the host computer repackages the data packet into a second format for transmission to the simulated device at the speed of the circuit simulation. Under this arrangement, the interface software in the host computer need not send to the circuit simulation, for example, the preamble required to synchronize the clocks of the network and the circuit simulation, because the circuit simulation is usually not capable of providing an analog interface required to respond to the preamble. Similarly, the interface software in the host computer repackages the data packets received from the circuit simulation into proper format for transmission to the network at full network speed. Under this arrangement, the existing memory in the host computer is used to buffer data packets communicated between the circuit simulation and the network, so that data packets received from the network at network speed are transmitted to the circuit simulation at a slower speed, and data packets received from the circuit simulation at the slower speed is provided to the network at full network speed.
In one embodiment, the present invention allows the interface software of a host computer to individually examine a data packet of a conventional off-the-shelf interface card to identify the beginning and the end of the packet. When the beginning and the end of a data packet can be identified, the interface software of the host computer ignores data packets not addressed to the simulated circuit. Consequently, compared to the prior art, a much smaller amount of buffer memory is required. This arrangement loses data packets only in the occasional event of a buffer overflow, thus effectively preventing network connection loss.
In one embodiment, the interface software of the host computer is implemented as a multithreaded program having, in one instance, two executing threads. One thread is a task that receives data packets from the network interface card, stores the received data packets in a buffer, retrieves the stored data for repackaging, and sends the repackaged data over a simulation interface to the circuit simulation. Another thread is a task that receives packets from the simulation interface, repackages the data into a network data packet and sends the network data packet over the network interface card to the network.
In another embodiment, the interface software of the host computer is implemented as a multithread program including four executing threads. One thread is a task that receives data packets from the network, and stores the received data packets in a buffer. A second thread is a task that polls the buffer for the received data packets. This second thread repackages the data packets and sends the repackaged packets over the simulation interface to the circuit simulation. A third thread is a task that receives data packets from the circuit simulation over the simulation interface and stores the received packets in a second buffer. A fourth thread is a task that polls the second buffer for the data packets received from the circuit simulation. This fourth thread repackages these data packets and sends the repackaged packets over the network interface to the network.
In yet another embodiment, the interface software of the host computer is also implemented as a multithread program, as in the previous embodiment, except that the second buffer is eliminated and the third and fourth tasks are combined into a single task executing as a single thread. In this embodiment, the single task receives data packets from the simulation interface from the circuit simulation, repackages the data packets received and sends the repackaged packets over the network interface to the network. This approach is possible because a circuit simulation runs at a much slower speed than the network, such that a data packet received from the circuit simulation can be repackaged and sent to the network before the next data packet's arrival from the circuit simulation.
Further features and advantages of various embodiments of the invention are described in the detailed description below, which is given by way of example only.
BRIEF DESCRIPTION OF THE DRAWINGS
In the following detailed description, to simplify the description, like elements are provided like reference numerals.
DETAILED DESCRIPTION The present invention is illustrated in the following using first, as an example, an emulation of a network interface device. At a latter part of this description, the present invention is illustrated, by way of another example, a simulation of a network interface device.
Alternatively, the network interface card can also be simulated in a circuit simulation running on host computer 30. Host computer 30 also runs a version of the interface program “Molasses” (e.g., Molasses program 750 or 850) which is discussed in further detail below in conjunction with
Referring back to
Mainscreen 80 calls “W32N_MolassesStop” routine 94 to terminate execution of both threads 54 and 56.
Because circuit emulator 12 typically runs at a speed much slower than devices on network 24, an alternative embodiment combines threads 124 and 126 and eliminates shared buffer 130, taking advantage that W32N_PacketSend routine 76 can complete repackaging and sending out a data packet to network 24 before arrival of the next data packet from circuit emulator 12 over parallel port 72.
Mainscreen 80 calls “W32N_MolassesStop” routine 94 to terminate execution of both threads 120, 122, 124 and 126.
The size of each of buffers 60, 62, 68 and 70, 128 and 130 can be changed dynamically. Even then, a buffer overflow condition can occasionally occur, resulting in data packets being discarded. Typically, discarding an incomplete packet risks losing a network connection. However, there is no risk of losing a network connection under the present invention, because only whole packets are discarded.
As mentioned above, the present invention is also applicable to a circuit simulation of the network interface device.
Once the parameters of Mainscreen 80 are set, Mainscreen 80 calls “W32N_MolassesStart” routine 752. Routine 752 creates simultaneous threads running “W32N_MolassesBuffer” routine 754 and “SIM_MolassesBuffer” routine 756, respectively. As in W32N_MolassesBuffer routine 54 discussed above, W32N_MolassesBuffer routine 754 receives packets from the Ethernet NIC 74 (via the same W32N_PacketRead routine 58 discussed above), stores the received packets into receive buffer 60 in host computer 930's main memory. Subsequently, the received packets in buffer 60 are transferred to transmit buffer 62, from which they are then transmitted to simulation PLI 772 via “SIM_PacketSend” routine 764. SIM_MolassesBuffer routine 756 receives packets from simulation PLI 772 (via “SIM_PacketRead” routine 766), stores the packets into receive buffer 68. Subsequently, routine 56 then transfers the data packets in buffer 68 to a transmit buffer 70, which are then transmitted to the Ethernet NIC 74 via “W32N_PacketSend” routine 76. As in Molasses program 50 above, Molasses program 750 converts data packet formats, when necessary. For example, the preamble that is used in a packet for synchronizing the clock signals of the network and the emulated device is removed before being forwarded to the circuit simulation over simulation PLI 772. Mainscreen 80 calls “W32N_MolassesStop” routine 794 to terminate execution of both threads 754 and 756.
As in circuit emulator 12, because a circuit simulation typically runs at a speed much slower than devices on network 24, an alternative embodiment combines threads 824 and 826 and eliminates shared buffer 130, taking advantage that W32N_PacketSend routine 76 can complete repackaging and sending out a data packet to network 24 before arrival of the next data packet from the circuit simulation emulator 12 over simulation PLI 772.
Mainscreen 80 calls “W32N_MolassesStop” routine 894 to terminate execution of threads 820, 822, 824 and 826.
Molasses programs 50, 40, 750 and 840 each include a test program for self-test.
A user interface is provided by the test program to self-test Molasses program 50. The user interface displays an appropriate amount of information, based on a user's selection of silent mode or verbose mode. Through this user interface, a user can vary a packet throughput rate, effectuate an overflow condition in any of buffers 60, 62, 68, 70, 128 and 130, or test for timing and throughput problems. A status line is provided in the user interface to continuously update information about packets processed by Molasses program 50, such as the number of packets sent and received, the current value of the timer, an error count, and other status information desired. In addition, a log file can be specified to record the value of each byte of each packet, errors that occurred, and comments that the user may wish to add using a comment line in the user interface. The recorded information may be used for future reference and debugging.
The test program also provides a test for accessing circuit emulator 12 through a bidirectional interface (e.g., a parallel port). In one embodiment, an industry standard parallel port conforming to the enhanced parallel port (EPP) standard is provided. The test program allows a user to read and write 8-bit addresses and 8-bit data patterns via the parallel port to circuit emulator 12. In one test, data is continuously written to and read back from circuit emulator 12 and compared. Any mismatch between the written data and the read back data is reported as an error.
Various modifications and adaptations of the operations described here would be apparent to those skilled in the art based on the above disclosure. Many variations and modifications within the scope of the present invention are therefore possible. The present invention is set forth by the following claims.
Claims
1-24. (canceled)
25. A method for simulating an electronic device that interacts with a network, the simulation being carried out by a program executing in a host computer, the simulation includes simulating the electronic device's interaction with the network, the method comprising executing instructions on the host computer for:
- (a) receiving data packets designating the electronic device as recipient from the network through a network interface; and
- (b) transmitting the data packets to the simulation through a software interface to provide data packets for simulating the electronic device's interaction with the network.
26. The method of claim 25, the instructions further comprising instructions for storing the data packets received from the network in a buffer allocated in the memory of the host computer.
27. The method of claim 26, the instructions further comprising instructions for changing the size of the buffer at run time.
28. The method of claim 26, the instructions further comprising instructions to cause to be discarded packets of data when the buffer is full.
29. The method of claim 26, the instructions further comprising instructions for keeping a record of the data packets received from the network.
30. The method of claim 29, the instructions further comprising instructions for displaying the record.
31. The method of claim 29, the instructions further comprising instructions for storing the record in a file.
32. The method of claim 25, the instructions further comprising instructions for recording the throughput of the data packets.
33. The method of claim 25, the instructions further comprising instructions for modifying the packets to make the packets suitable for receipt by the simulation.
34. The method of claim 33, wherein modifying includes removing a preamble from a data packet.
35. The method of claim 25, wherein the instructions for receiving data packets from the network, and the instructions for transmitting the data packets to the simulation are executed in a single thread.
36. The method of claim 25, wherein the instructions for receiving data packets from the network is executed in a first thread, and the instructions for transmitting the data packets to the simulation is executed in a second thread.
37. A method for simulating an electronic device that interacts with a network, the simulation of the electronic device being carried out by a program executing in a host computer, the simulation including simulating the electronic device's interaction with the network, the method comprising executing on the host computer instructions for:
- (a) receiving data packets designating the electronic device as a source through a software interface from the simulation of the electronic device's interaction with the network; and
- (b) transmitting the data packets to the network through a network interface.
38. The method of claim 37, the instructions further comprising instructions for storing the data packets received from the simulation in a buffer allocated in the memory of the host computer.
39. The method of claim 38, the instructions further comprising instructions for changing the size of the buffer at run time.
40. The method of claim 38, the instructions further comprising instructions to cause to be discarded packets of data when the buffer is full.
41. The method of claim 37, the instructions further comprising instruction for keeping a record of the data packets received from the simulation.
42. The method of claim 41, the instructions further comprising instructions for displaying the record.
43. The method of claim 41, the instructions further comprising instructions for storing the record in a file.
44. The method of claim 37, the instructions further comprising instructions for recording the throughput of the data packets.
45. The method of claim 37, the instructions further comprising instructions for modifying the data packets to make the packets suitable for receipt by the network.
46. The method of claim 45, wherein modifying includes inserting a preamble in a data packet.
47. The method of claim 37, wherein the instructions for receiving data packets from the simulation and the instructions for transmitting the data packets received from the simulation to the network are executed in a single thread.
48. The method of claim 37, wherein the receiving data packets from the simulation is executed in a first thread and the transmitting the data packets to the network is executed in a second thread.
49. A computer-readable medium for use in a simulation of an electronic device, wherein the simulation is to be carried out by a program executing in a host computer, and wherein the simulation of the electronic device includes simulating the electronic device's interaction with the network; the computer-readable medium comprising computer-executable instructions to be executed on the host computer for:
- (a) receiving data packets designating the electronic device as a recipient from the network through a network interface; and
- (b) transmitting the data packets to the simulation through a software interface to provide data packets for simulating the electronic device's interaction with the network.
50. The computer-readable medium of claim 49, further comprising computer instructions for storing the data packets received from the network in a buffer allocated in the memory of the host computer.
51. The computer-readable medium of claim 50, further comprising computer-executable instructions for changing the size of the buffer at run time.
52. The computer-readable of medium claim 50, further comprising computer-executable instructions for discarding packets of data when the buffer is full.
53. The computer-readable medium of claim 49, further comprising computer instructions for keeping a record of the data packets.
54. The computer-readable medium of claim 53, further comprising computer-executable instructions for displaying the record.
55. The computer-readable medium of claim 53, further comprising computer-executable instructions for storing the record in the storage medium.
56. The computer-readable medium of claim 49, further comprising computer-executable instructions for recording the throughput of the data packets.
57. The computer-readable medium of claim 49, further comprising computer-executable instructions for modifying the data packets for receipt by the simulation.
58. The computer-readable medium of claim 57, wherein the computer-executable instructions for modifying includes computer-executable instructions for removing a preamble from a data packet.
59. A computer-readable medium for use in a simulation of an electronic device, wherein the simulation is to be carried out by a program executing in a host computer, and wherein the simulation of the electronic device includes simulating the electronic device's interaction with the network; the computer-readable medium comprising computer-executable instructions to be executed on the host computer for:
- (a) receiving data packets designating the electronic device as a source through a software interface from the simulation of the electronic device's interaction with the network; and
- (b) transmitting the data packets received from the simulation to the network through a network interface.
60. The computer-readable medium of claim 59, further comprising computer-executable instructions for storing the data packets received from the simulation in a buffer allocated in the memory of the host computer.
61. The computer-readable medium of claim 60, further comprising computer-executable instructions for changing the size of the buffer at run time.
62. The computer-readable medium of claim 60, further comprising computer-executable instructions for discarding packets of data when the buffer is full.
63. The computer-readable medium of claim 59, further comprising computer-executable instructions for keeping a record of the data packets.
64. The computer-readable medium of claim 63, further comprising computer-executable instructions for displaying the record.
65. The computer-readable medium of claim 63, further comprising computer-executable instructions for storing the record in the storage medium.
66. The computer-readable medium of claim 59, further comprising computer-executable instructions for recording the throughput of the data packets.
67. The computer-readable medium of claim 59, further comprising computer-executable instructions for modifying the data packets to make the packets suitable for receipt by the network.
68. The computer-readable medium of claim 67, wherein computer-executable instructions for modifying includes computer-executable instructions for inserting a preamble in a data packet.
Type: Application
Filed: Nov 6, 2006
Publication Date: Mar 22, 2007
Inventor: Robert Ziedman (Cupertino, CA)
Application Number: 11/557,053
International Classification: H04L 12/56 (20060101);