Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > very simple question vhd files

Reply
Thread Tools

very simple question vhd files

 
 
Xin Xiao
Guest
Posts: n/a
 
      12-06-2007
Hi , perhaps this is a very simple question...

is it a good practice to include several entities-architectures in the same
vhd file or should I separate them in different vhd files?

 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      12-07-2007
Xin Xiao wrote:

> is it a good practice to include several entities-architectures in the
> same vhd file or should I separate them in different vhd files?


I use the same file.
I often put a package in front of the entity, like this:
http://home.comcast.net/~mike_treseler/stack.vhd

-- Mike Treseler
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      12-07-2007
Mike Treseler wrote:
> Xin Xiao wrote:
>
>> is it a good practice to include several entities-architectures in the
>> same vhd file


Sorry, make that one file per entities-architecture pair.
To many dependencies otherwise.

or should I separate them in different vhd files?

Yes. I read the question too quickly.
Some separate the entity and architecture
as well, but I find no advantage to that.

-- Mike Treseler
 
Reply With Quote
 
ghelbig@lycos.com
Guest
Posts: n/a
 
      12-07-2007
On Dec 6, 3:20 pm, "Xin Xiao" <(E-Mail Removed)> wrote:
> Hi , perhaps this is a very simple question...
>
> is it a good practice to include several entities-architectures in the same
> vhd file or should I separate them in different vhd files?


In addition to separate files for each entity, the name of the file
should match the name of the entity.

Just like Mike did it: stack.vhd has one entity: stack.

G.
 
Reply With Quote
 
Paul Uiterlinden
Guest
Posts: n/a
 
      12-07-2007
Mike Treseler wrote:

> Mike Treseler wrote:
>> Xin Xiao wrote:
>>
>>> is it a good practice to include several entities-architectures in the
>>> same vhd file

>
> Sorry, make that one file per entities-architecture pair.
> To many dependencies otherwise.
>
> or should I separate them in different vhd files?
>
> Yes. I read the question too quickly.
> Some separate the entity and architecture
> as well, but I find no advantage to that.


Dependencies.

Putting one design unit (entity, architecture, package, package body,
configuration) in a file reduces the number of dependencies.

Changing for example a package body does not cause a need for recompilation
of any other design unit. If it was put in one file together with the
package, every design unit using the package would need to be recompiled.

Especially when maintaining a set of compiled libraries used by many people,
having only one design unit per file is a real advantage.

--
Paul Uiterlinden
www.aimvalley.nl
e-mail addres: remove the not.
 
Reply With Quote
 
KJ
Guest
Posts: n/a
 
      12-07-2007
On Dec 6, 6:20 pm, "Xin Xiao" <(E-Mail Removed)> wrote:
> Hi , perhaps this is a very simple question...
>
> is it a good practice to include several entities-architectures in the same
> vhd file or should I separate them in different vhd files?


It can depend on your specific work habits, file naming conventions,
etc. but generally I find it best to put one entity/architecture in a
single file named with the entity name to make it easy to find.

If an entity requires use of record definitions, conversion functions,
etc. in order for the typical user of the entity to work with it (and
more times than not, it will), I put the package and package body that
contains all of that stuff in the same file prior to the entity/
architecture (so that the e/a can use it as well). This is the same
method that Mike uses in his posting with his link to an example.

Paul has a good point about separating the package from the entity in
order to minimize the number of dependent files that need
recompiling. Many times though I don't run across the situation where
only the package body needs to change, usually the package itself
needs to change as well so separating the package into a separate file
just means I have one more file to manage and nothing to gain from the
extra management which is why I combine them....it also makes it easy
to update at least some of the dependent changes since they are
generally in the entity/architecture which are in the same file.

What is 'best practice' probably may come down to how many different
groups/people not counting yourself are the users of your code and how
onerous it is (or isn't) to recompile some extra supposedly dependent
files where the dependency is defined by 'make' which works at the
file level.

Kevin Jennings
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      12-07-2007
On Dec 7, 6:43 am, KJ <(E-Mail Removed)> wrote:
> On Dec 6, 6:20 pm, "Xin Xiao" <(E-Mail Removed)> wrote:
>
> > Hi , perhaps this is a very simple question...

>
> > is it a good practice to include several entities-architectures in the same
> > vhd file or should I separate them in different vhd files?

>
> It can depend on your specific work habits, file naming conventions,
> etc. but generally I find it best to put one entity/architecture in a
> single file named with the entity name to make it easy to find.
>
> If an entity requires use of record definitions, conversion functions,
> etc. in order for the typical user of the entity to work with it (and
> more times than not, it will), I put the package and package body that
> contains all of that stuff in the same file prior to the entity/
> architecture (so that the e/a can use it as well). This is the same
> method that Mike uses in his posting with his link to an example.
>
> Paul has a good point about separating the package from the entity in
> order to minimize the number of dependent files that need
> recompiling. Many times though I don't run across the situation where
> only the package body needs to change, usually the package itself
> needs to change as well so separating the package into a separate file
> just means I have one more file to manage and nothing to gain from the
> extra management which is why I combine them....it also makes it easy
> to update at least some of the dependent changes since they are
> generally in the entity/architecture which are in the same file.
>
> What is 'best practice' probably may come down to how many different
> groups/people not counting yourself are the users of your code and how
> onerous it is (or isn't) to recompile some extra supposedly dependent
> files where the dependency is defined by 'make' which works at the
> file level.
>
> Kevin Jennings


Like Kevin, I now prefer to keep logical things together, and let
smarter tools figure it out. Some simulators have a mode where if
recompilation of a file did not change the library unit, then it does
not update that unit in the library, and avoids the downstream
recompilation of other units dependent upon that unit. Some also have
options to only compile certain types of units found in the file(s).
So, if your entity and package did not change, you could tell it to
compile only bodies and architectures in the file.

I use a lot of entity(architecture) instantiation, so compile
dependencies are something I'm willing to live with to keep the files
manageable anyway.

Compile dependencies were a big deal when compilers (and the computers
they ran on) were agonizingly slow, but I find them fast enough today
to handle a little extra work so I don't have to.

Andy
 
Reply With Quote
 
Thomas Stanka
Guest
Posts: n/a
 
      12-09-2007
On 7 Dez., 00:20, "Xin Xiao" <(E-Mail Removed)> wrote:
> Hi , perhaps this is a very simple question...
>
> is it a good practice to include several entities-architectures in the same
> vhd file or should I separate them in different vhd files?


Having you design in one file simplifies the toolchain on first glance
but avoids nearly every code reuse.

I prefer having entity, architecture and configurations in seperate
files. This eases the work with different architectures (e.g. for
different technologies) for one entity.
A good naming convention is necessary to handle the different files.

bye Thomas
 
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
Can't save files to mounted vhd's. Skybuck Flying Windows 64bit 4 06-02-2011 10:41 PM
Help running a very very very simple code olivier.melcher Java 8 05-12-2008 07:51 PM
Very very very basic question Peter C Programming 14 02-14-2005 09:46 AM
very Very VERY dumb Question About The new Set( ) 's Raymond Arthur St. Marie II of III Python 4 07-27-2003 12:09 AM
how to compile .vhd files one by one using makefile MACEI'S VHDL 0 07-10-2003 05:18 PM



Advertisments