ENTITY aoi IS PORT (a1, a2, a3, b1, b2 : IN bit; y: OUT bit);
END aoi;
------------------------------------------------------------------
ARCHITECTURE structural_4 OF aoi IS
SIGNAL a_out, b_out : bit ; -- interne Signale
BEGIN
and_stage : BLOCK
COMPONENT and2 PORT (a,b : IN bit; y : OUT bit) ; END COMPONENT ;
COMPONENT and3 PORT (a,b,c : IN bit; y : OUT bit) ; END COMPONENT ; BEGIN
and_a : and3 PORT MAP (a1,a2,a3,a_out) ; and_b : and2 PORT MAP (b1,b2,b_out) ;
END BLOCK and_stage;
-----------------------
nor_stage : BLOCK
PORT (aa,bb : IN bit; yy : OUT bit) ; PORT MAP (aa=>a_out, bb=>b_out, yy=>y) ;
SIGNAL cc : bit; -- block-internes Signal
COMPONENT or2 -- nicht invertierernd ! PORT (a,b : IN bit; y : OUT bit) ; END COMPONENT ;
BEGIN
or_c : or2 PORT MAP (a=>aa,b=>bb,y=>cc) ;
yy <= NOT cc; -- Invertierung END BLOCK nor_stage ;
END structural_4 ;
|
Die BLOCK-Anweisung dient zur Gliederung eines Modells, ohne eine Modellhierarchie mit instantiierten Submodellen einführen zu müssen. Das nebenstehende Beispiel eines AOI-Komplexgatters wird durch zwei BLOCK-Anweisungen in zwei Stufen partitioniert. Der erste Block 'and_stage' beinhaltet zwei AND-Gatter, ein Zweifach- und ein Dreifachgatter. Die Ausgangssignale dieser Gatter 'a_out' und 'b_out' dienen dem zweiten Block 'nor_stage' als Eingangssignale, der eigene Ports mit einer entsprechenden Port-Map besitzt. |