next up previous contents
Next: Protected Members Up: The Component Class Previous: The Component Class

Public Members

tex2html_wrap_inline7610 List<Port *> I_List, O_List: These two members maintain linked lists of input and output ports respectively as required by the component. Each element of the linked list is a pointer to a Port object, which is described in detail in a subsequent section. These linked list of ports are used extensively during the simulation in order to coordinate the processing of inputs and outputs and to access lower levels of the component hierarchy built during the construction of the circuit. Because a component communicates with the external world via its ports, the port lists are made part of the public interface of the Component class. Note that this is one of the few instances in the implementation where public access is granted to the data members of a class.

tex2html_wrap_inline7610 void process(ckt_time time): This is a virtual method which implements the functional behaviour of the component. For high level components, (that is, components which are composed of subcomponents) this function scans over all the port pointers in the aforementioned input port list and activates all the subcomponents which are connected to these input ports. Components at the lowest level of the hardware hierarchy, however, must override this virtual function to provide the specific functionality of the component. For example, a 2-input NAND gate would examine its two inputs signals at the specified time and produce a low output only if both inputs are high.

tex2html_wrap_inline7610 void simulate(): This function is employed by all classes derived from the Component class, regardless of the hierarchical level of the component. This method first determines if all the inputs for the component are ready at the local time of the component. If so, then this method will increment the local time and invoke the process() member function to trigger the component to consume its inputs and produce appropriate outputs. The simulate() method is called recursively as control travels down the three dimensional component object tree.

tex2html_wrap_inline7610 void show_outputs(): In order to determine the results of the simulation, this function must be called. This method simply traverses the ports in the output port list of the component and displays all the signal values and times that are stored in the output wires connected to each of the ports.


next up previous contents
Next: Protected Members Up: The Component Class Previous: The Component Class

Donald Craig
Mon Jul 8 12:05:35 NDT 1996