A co-simulation design system for testing by simulation an electronic system on a host computer system, the electronic system including target digital circuitry, a target processor, and an accompanying user program to be executed on the target processor, the target digital circuitry including one or more devices coupled to the target processor, each device having a target address, the design system comprising:
- a processor simulator using software executing on the host computer system for simulating execution of the user program on the target processor, the software including an analyzed version of the user program;
- a hardware simulator to simulate the target digital circuitry using software executing on the host computer system;
- and
- an interface mechanism that couples the hardware simulator with the processor simulator including controlling communication between the processor simulator and the hardware simulator,
- wherein the processor simulator includes
- a communication mechanism to communicate with the hardware simulator using the interface mechanism when an event requires interaction of the user program with the target digital circuitry, and
- wherein determining the analyzed version of the user program includes:
- decomposing the user program into linear blocks and calculating the time delay that would be incurred by executing each linear block on the target processor, the time calculating incorporating target processor instruction timing, and
- identifying those parts of the user program that include one or more references that might require a read or write to a device;
- such that executing the analyzed version of the user program
- (i) causes the processor simulator to communicate with the hardware simulator via the communication mechanism to cause the device to be written to or read from for any reference that is a device reference requiring a read or write to a device, and
- (ii) produces accurate timing information incorporating target processor instruction timing.