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