Component Base Logic Simulation (Full Report)

Jack Peng and Zhengyu Zhang

1.0 Abstract

1.1 Objective

The objective of this project is to prototype a component-based behavior simulation system using Java programming language. As the fundamental element of such a simulation system, a component is formed by the encapsulation of the behavior along with the structural description of a functional block within a digital system. The complete simulation process can be characterized as the activities of many different components with every individual self-describing the behavior subject to external input and initial condition and interchanging input and output with each other. We believe this type of simulation system is a more adaptive, more scalable, and more efficient way of performing behavior simulation for digital systems with various complexities at all abstraction levels.

In this project we implemented a still primitive scheme of doing component base simulation. In this scheme one can dne not only base level components but also higher level components by wrapping base level components and/or other high level components tougher, with a scheduler to coordinate their operations and move data among them. Simulation is done with a user defined thread that interacts with the highest level component.

2.0 Description

2.1 Structure and Behavior of the Components

All components have an input buffer, an output buffer, an input flag and an output flag. All are subclasses of the BaseComponent class (a subclass of Thread), which has all of the data fields and flags just mentioned and a Simulate() and an empty function() method. If a component is a base level component, i.e., it doesn't have any other components in it, all it has to do is to define the function() method. Such a component would function in the following way. It would wait for the input flag to signal that new input has arrived. Once that happens, it would perform whatever function defined in its function class, place the results in a temporary buffer. It would then wait for the output flag to signal that the output has been taken, then place the result in the output buffer. Afterwards it would go back to where it started and wait for new input to appear.

A higher level component is a little different. It needs to override the Simulate() method. It has a scheduler to move data from its input buffer to the first component, from the first component's output buffer to a buffer between the first component and the second component, from that buffer to the second component, ......, and from the output buffer of the last component to its own output buffer, in the mean while updating the input and output flags to let the components inside know that their output buffers have been read and input buffers have been used and let the outside environment know if new input can be put in and new output is available to be read out. Every design is a component that is made up of lower level component. In the Simulate() method of a design, the components are place one after another into a data structure, which is passed to the scheduler of that component. When the scheduler is started, the component starts running. The scalability of this scheme comes from the fact that the scheduler takes care of the input and output of the components and the components just process the new input data when it arrives without having to worry about what is around it.

2.2 How to simulate a design

In the main() method of every new design (the highest level component at that point), one need to instantiate an instance of the new design and let it run. One also needs to create another thread to interact with this component. This method is responsible for monitoring the input and output flag of the component and supply the input and clear the output in any way the user desires.

3.0 Results

We wrapped several shifters together and created a high level component called Four_Shift1 and fed it randomly generated data that are blocks of 4 integer arrays of size 4. By observing the data being written into the buffers we can see the numbers shifting. To check whether we can build components from other high level components, we put 2 Four_Shift1's in a component call Top and it also works. (To obtain a working demo, go to zhengyu/Jack/project.pipline/TwoLevel/ really_two_level.class Four_Shift1.class is made up of base level components and Top has two Four_Shift1's in it.)

4.0 Conclusions-Future Work

A small scale component based simulation system is now up and running with the assumption that all the component will stay on one machine.

Future plans include making the tool scalable across different machines, better interface and performance evaluation.



This FrameMaker Document was converted to HTML by maker2html v1.1a.
(This file was created: Tue Dec 10 21:53:26 PST 1996 )