Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - very simple question vhd files

 
Thread Tools Search this Thread
Old 12-06-2007, 11:20 PM   #1
Default very simple question vhd files


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?



Xin Xiao
  Reply With Quote
Old 12-07-2007, 12:00 AM   #2
Mike Treseler
 
Posts: n/a
Default Re: very simple question vhd files
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


Mike Treseler
  Reply With Quote
Old 12-07-2007, 01:32 AM   #3
Mike Treseler
 
Posts: n/a
Default Re: very simple question vhd files
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


Mike Treseler
  Reply With Quote
Old 12-07-2007, 01:48 AM   #4
ghelbig@lycos.com
 
Posts: n/a
Default Re: very simple question vhd files
On Dec 6, 3:20 pm, "Xin Xiao" <x...@x.com> 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.


ghelbig@lycos.com
  Reply With Quote
Old 12-07-2007, 11:25 AM   #5
Paul Uiterlinden
 
Posts: n/a
Default Re: very simple question vhd files
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.


Paul Uiterlinden
  Reply With Quote
Old 12-07-2007, 12:43 PM   #6
KJ
 
Posts: n/a
Default Re: very simple question vhd files
On Dec 6, 6:20 pm, "Xin Xiao" <x...@x.com> 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


KJ
  Reply With Quote
Old 12-07-2007, 01:59 PM   #7
Andy
 
Posts: n/a
Default Re: very simple question vhd files
On Dec 7, 6:43 am, KJ <Kevin.Jenni...@unisys.com> wrote:
> On Dec 6, 6:20 pm, "Xin Xiao" <x...@x.com> 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


Andy
  Reply With Quote
Old 12-09-2007, 08:15 AM   #8
Thomas Stanka
 
Posts: n/a
Default Re: very simple question vhd files
On 7 Dez., 00:20, "Xin Xiao" <x...@x.com> 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


Thomas Stanka
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Video files to PSP ivan DVD Video 4 06-17-2008 11:16 AM
Convert Video files to MP4 for iPod ivan DVD Video 0 04-26-2006 08:38 AM
Very slow recognising DVD disc Terry Pinnell DVD Video 1 03-28-2006 06:53 PM
Now I introduce some popular software of multimedia eightsome@gmail.com DVD Video 0 03-28-2006 02:29 PM
Simple question, join and divide Dr Zero DVD Video 0 12-29-2003 09:52 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46