Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > hierarchical design with structural VHDL question

Reply
Thread Tools

hierarchical design with structural VHDL question

 
 
Neil Zanella
Guest
Posts: n/a
 
      10-20-2003

Hello,

I have several files, each file containing an entity and an
architecture. Some entities have components comprised of entities
which are defined together with their architectures in their
own separate files. I would like to place collections of
functionally related entities and architectures into the
same file like I would in C. When I do this in VHDL, the
sources no longer compile and I get completely incorrect
warnings from the compiler (such as std_ulogic_vector
being undefined despite the fact that I am including
the appropriate ieee library and using ieee.std_logic_1164.all.

Hence, may I ask, is it illegal to put more than one entity
and architecture in the same file in VHDL, or is there something
else that I am doing wrong?

Thanks,

Neil

 
Reply With Quote
 
 
 
 
Neil Zanella
Guest
Posts: n/a
 
      10-21-2003

Hello,

The answer in this case is perhaps fairly straightforward. In VHDL, unlike
in C, when you use the library and using statements they only apply to the
entity and architecture which directly follows it. Hence such statements
do not have file scope and must be included prior to the definition of
every entity that makes use of them. Perhaps someone else will
state this VHDL subtlety more formally / precisely.

Thanks,

Neil

On Mon, 20 Oct 2003, Neil Zanella wrote:

>
> Hello,
>
> I have several files, each file containing an entity and an
> architecture. Some entities have components comprised of entities
> which are defined together with their architectures in their
> own separate files. I would like to place collections of
> functionally related entities and architectures into the
> same file like I would in C. When I do this in VHDL, the
> sources no longer compile and I get completely incorrect
> warnings from the compiler (such as std_ulogic_vector
> being undefined despite the fact that I am including
> the appropriate ieee library and using ieee.std_logic_1164.all.
>
> Hence, may I ask, is it illegal to put more than one entity
> and architecture in the same file in VHDL, or is there something
> else that I am doing wrong?
>
> Thanks,
>
> Neil


 
Reply With Quote
 
 
 
 
Jonathan Bromley
Guest
Posts: n/a
 
      10-22-2003
"Neil Zanella" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...

> I have several files, each file containing an entity and an
> architecture. Some entities have components comprised of entities
> which are defined together with their architectures in their
> own separate files. I would like to place collections of
> functionally related entities and architectures into the
> same file like I would in C. When I do this in VHDL, the
> sources no longer compile and I get completely incorrect
> warnings from the compiler (such as std_ulogic_vector
> being undefined despite the fact that I am including
> the appropriate ieee library and using ieee.std_logic_1164.all.
>
> Hence, may I ask, is it illegal to put more than one entity
> and architecture in the same file in VHDL, or is there something
> else that I am doing wrong?


No,it's entirely legal (although it is *not* legal to
split any design unit across more than one file, BTW).
Whether it's a good idea, I'm less sure.

Your problem is almost certainly that you have not
repeated the library and use clauses before each new entity
declaration. If you're used to C, you probably think of
"header files" that are textually included in the compile
an therefore apply throughout compilation of the whole
source file. By contrast, in VHDL, library and use
clauses apply only to the immediately following design
unit. They don't represent textual inclusion; their
only effect is to make a collection of name definitions
visible while the next design unit is compiled.

Slightly surprisingy, it's *not* necessary to repeat
the library and use clauses before an architecture.
Architectures are "secondary design units" and they
inherit all name visibility from their "primary design
unit", i.e. their entity. Similarly, a package body
inherits name visibility from its package.

~~~~~~~~~~~~~~~~~~~~~~~~

Would it be churlish to point out that, amongst your
considerable flurry of sometimes quite combative posts
recently, we have seen hardly a word of thanks for the
many helpful responses you've elicited?
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: http://www.velocityreviews.com/forums/(E-Mail Removed)
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL Behavioral and Structural Mixed Models aris VHDL 9 07-16-2010 10:29 PM
pure structural design Francisco VHDL 8 12-30-2004 12:34 AM
Structural VHDL - Accesing signals of instances Valentin Tihomirov VHDL 2 11-02-2003 12:08 PM
Importing Structural VHDL into Cadence 4.4.6 Marcus Schaemann VHDL 1 09-17-2003 10:00 AM
XML for VHDL documention and structural description of Hardware SoC Amontec Team VHDL 0 07-11-2003 02:29 PM



Advertisments