Configuration Specification:
|
This example shows how to use the configuration statement to bind an entity to a component.
First, entity JKFF is declared in the Work library. JKFF has five input ports and two output ports.
The package Global_signals declares signals that are available to all processes and components in the architecture.
The entity config_test is declared without input or output ports and can be thought of as the top level testbench in this example.
The architecture is declared with local signals S1, S2, S3, and S4 and the component FF. The component FF has 2 inputs and 2 outputs. This component will be adapted to fit the JKFF component in a configuration specification.
The configuration specification first identifies the effected component. In this case, U0, the component instantiation of type FF is to be configured. The entity to be used is then stated (JKFF in the Work library). Since the interfaces do not match, a PORT MAP is necessary. The clk, preset, and clear signals of the entity are mapped to the signals declared in Global_signals with the same names. The J, K, Q, and Q_bar signals are mapped to the local signals.
Finally, the component instantiation statement maps the components to the same signals, completing the configuration.