Microsoft AGB-00001 Spécifications Page 92

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 144
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 91
How to Manage VHDL Design Hierarchies
6-2 VHDL Reference Manual
Components
VHDL design entities can be referenced from other architectures as
components. VHDL allows you to manage the mapping of design
entities to components with a configuration specification (described in
the next section) that associates particular component instances with a
specified design entity. In most cases, however, you will have only one
design entity for each component instance, and you will simply let the
VHDL synthesizer (or simulator) select the default entity (default
binding) for each component.
The following example contains three entity/architecture pairs: two
lower level entities (add and mult) and a top level entity (addmult)
that includes two component instantiations of the lower-level entities:
-----------------------------
-- lower-level entity: adder
--
entity add is
port(op1,op2: in integer range 0 to 7;
result: out integer range 0 to 63);
end add;
architecture dataflow of add is
begin
result <= op1 + op2; -- add the operands
end dataflow;
----------------------------------
-- lower-level entity: multiplier
--
entity mult is
port(op1,op2: in integer range 0 to 7;
result: out integer range 0 to 63);
end mult;
architecture dataflow of mult is
begin
result <= op1 * op2; -- multiply the operands
end dataflow;
------------------------------------------------------
-- top-level entity: mux of add and multiply results
--
entity addmult is
port(op1,op2: in integer range 0 to 7; sel: in boolean;
result: out integer range 0 to 63);
end addmult;
architecture structure of addmult is
signal s_add, s_mult: integer range 0 to 63;
component add -- component declaration
port(op1,op2: in integer range 0 to 7;
result: out integer range 0 to 63);
end component;
component mult -- component declaration
port(op1,op2: in integer range 0 to 7;
result: out integer range 0 to 63);
end component;
begin
add1: add port map (op1,op2,s_add);
mult1: mult port map (op1,op2,s_mult);
with sel select -- Mux the add and multiply results
result <= s_add when FALSE,
s_mult when TRUE;
end structure;
Vue de la page 91
1 2 ... 87 88 89 90 91 92 93 94 95 96 97 ... 143 144

Commentaires sur ces manuels

Pas de commentaire