This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Design Recipes for FPGAs Using Verilog and VHDL > A VHDL Primer: The Essentials > Entity: Model Interface

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Entity: Model Interface

FONT SIZE : AAA

The Entity Definition

The VHDL entity defines how a design element described in VHDL connects to other VHDL models and also defines the name of the model. The entity also allows the definition of any parameters that are to be passed into the model using hierarchy. The basic template for an entity is as follows: 

1 entity <name> is

2 .

3 end entity <name>;

If the entity has the name test then the entity template could be either:

1 entity test is

2 end entity test;

or:

1 entity test is

2 end test;

Ports

The method of connecting entities together is using ports. These are defined in the entity using the following method:

1 port (

2 −− list of port declarations

3 );

The port declaration defines the type of connection and direction where appropriate. For example, the port declaration for an input bit called in1 would be:

1 in1 : in bit;

And if the model had two inputs (in1 and in2) of type bit and a single output (out1) of type bit then the declaration of the ports would be defined as follows:

1 port (

2 in1, in2 : in bit;

3 out1 : out bit

4 );

As the connection points between entities are effectively the same as those inter-process connections,they are effectively signals andc a

Generics

If the model has a parameter, then this is defined using generics. The general declaration of generics is shown below:

1 generic (

2 −− list of generic declarations

3 );

In the case of generics, the declaration is similar to that of a constant with the form as shown below:

1 param1 : integer := 4;

Taking an example of a model that had two generics, gain (integer) and time_delay (time), they could be defined in the entity as follows:

1 generic (

2 gain : integer := 4;

3 time_delay : time = 10 ns;

4 );

Constants

It is also possible to include model specific constants in the entity using the standard declaration of constants method previously described; for example:

1 constant : rpullup : real := 1000.0;

Entity Examples

To illustrate a complete entity, we can bring together the ports and generics examples previously shown and construct the complete entity for this example:

1 entity test is

2 port (

3 in1, in2 : in bit;

4 out1 : out bit;

5 );

6 generic (

7 gain : integer := 4;

8 time_delay : time := 10 ns;

9 );

10 constant : rpullup : real := 1000.0;

11 end entity test;


  • XC2S30-6CSG144C

    Manufacturer:Xilinx

  • FPGA Spartan-II Family 30K Gates 972 Cells 263MHz 0.18um Technology 2.5V 144-Pin CSBGA
  • Product Categories: FPGAs

    Lifecycle:Active Active

    RoHS:

  • XC4VLX60-11FF668I

    Manufacturer:Xilinx

  • FPGA Virtex-4 LX Family 59904 Cells 90nm Technology 1.2V 668-Pin FCBGA
  • Product Categories: Disjoncteur

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC4VLX60-12FF1148C

    Manufacturer:Xilinx

  • FPGA Virtex-4 LX Family 59904 Cells 90nm Technology 1.2V 1148-Pin FCBGA
  • Product Categories: FPGAs

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC40150XV-08BG560C

    Manufacturer:Xilinx

  • FPGA XC4000XV Family 150K Gates 12312 Cells 0.25um Technology 2.5V 560-Pin Metal BGA
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC18V04PC44C-RI

    Manufacturer:Xilinx

  • Xilinx PLCC
  • Product Categories:

    Lifecycle:Active Active

    RoHS: -

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.