next up previous
Next: 2.1 Interface Consistency Up: Interface Consistency Previous: 1 Background

2 Position

 The interface of a component is the externally visible behavior such as the syntax and semantic interpretation of its communication with the environment. Components can be either software modules, physical hardware devices or a combination of the two. Components can be newly created for a specific purpose, but often they are general purpose off-the-shelf components. In both cases it is important that the interface to the module is simple and well documented. Insisting that all components have exactly the same view would be too restrictive. It is important to allow them to have different views as long as these are not in conflict. To illustrate this, consider a packet in a communication protocol. One component may treat this as an uninterpreted collection of bits to be transmitted whereas another component may impose a structure on the packet with different fields indicating addresses, control, and checksum.

The following is a simple example of an interface.

Consider a device that can be reserved by manipulating two signals (could be bits in a register, lines on a bus, variables, or wires): request and grant. Use of the device follows a simple four-phase protocol where a request is followed by a grant, after which the device can be used. When the use has finished, the request is removed and this is followed by the device removing the grant. The interface consists of the two signals plus the four-phase protocol. In Java the interface could be described as follows:
  class device{
    private boolean request;
    private boolean grant;
  }
In addition to the syntactical information specifying the number, names, and types of the signals, the interface defines a protocol requiring the pair (request, grant) to change as follows:
 (false, false) -> (true, false) -> (true, true) 
 -> (false, true) -> (false, false) -> ...
The device is only assumed to work properly if all use of it follows this protocol. It is therefore an integral part of the interface that should be part of the written documentation.
In a systems design components from very different technologies are put together, and the interface description should be able to bridge the gaps between a range of technologies such as software (for a general purpose computer), software (for a specialized controller), various programmable hardware technologies such as FPGA, special purpose dedicated processors, synthesizable circuitry and hand-crafted ASICS.



 
next up previous
Next: 2.1 Interface Consistency Up: Interface Consistency Previous: 1 Background

Jorgen Staunstrup
Sept. 2, 1997