Structural Architecture in VHDL: Definition and Example
structural architecture describes a design by connecting components or modules together, like building blocks. It shows how smaller parts combine to form a complete circuit by instantiating and wiring components explicitly.How It Works
Structural architecture in VHDL works like assembling a model from smaller pieces. Imagine building a toy car by snapping together wheels, a body, and an engine. Each piece is a component, and the structural architecture shows how these pieces connect.
Instead of describing behavior or logic with code lines, structural architecture focuses on the physical connections between components. You declare components, create instances of them, and connect their inputs and outputs using signals. This approach helps organize complex designs by breaking them into manageable parts.
Example
This example shows a simple structural architecture where two AND gates are connected to form a 3-input AND function by wiring their inputs and outputs.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ThreeInputAnd is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
Y : out STD_LOGIC);
end ThreeInputAnd;
architecture Structural of ThreeInputAnd is
component AndGate
Port ( X : in STD_LOGIC;
W : in STD_LOGIC;
Z : out STD_LOGIC);
end component;
signal temp : STD_LOGIC;
begin
U1: AndGate port map (X => A, W => B, Z => temp);
U2: AndGate port map (X => temp, W => C, Z => Y);
end Structural;
architecture Behavioral of AndGate is
Port ( X : in STD_LOGIC;
W : in STD_LOGIC;
Z : out STD_LOGIC);
begin
Z <= X and W;
end Behavioral;When to Use
Use structural architecture when you want to build complex circuits by combining smaller, reusable components. It is helpful for large designs where breaking the system into parts makes it easier to understand and maintain.
For example, in designing a processor, you can create components for the ALU, registers, and control unit separately, then connect them structurally. It also helps when you want to reuse tested components in different projects.
Key Points
- Structural architecture connects components explicitly using signals.
- It models the design as a network of smaller building blocks.
- Helps organize and reuse parts in complex designs.
- Different from behavioral architecture, which describes logic with code.