A
alb
Guest
Hi there,
I'm pretty new to verilog, even though I've been writing C since some time and
the language is pretty easy to pick up. I have an issue though with the
'include' directive and the way to organize the included dirs.
We are using Cadence at work and it looks like the -incdir is the way to include
directories to look for files which are included in other files.
Assuming the following dir structure:
../sandbox/project/components/
âââ module1
â  âââ include
â  âââ src
âââ module2
âââ include
âââ src
Now if in my module1 I want to include something, I can directly specify an
incdir that points to module1/include and then in the src files I can simply
write:
`include "file_to_be_included.vh"
The same can be done with module2 but if for some reason the file_to_be_included
have a file with the same name I cannot do it anymore since the tool wouldn't
know which one to pick. Therefore my name space is too broad.
OTOH if I pick an upper level directory to be included (e.x. components) then I
would need to write:
`include "module1/include/file_to_be_included.vh"
This has the benefit to allow modules to have same filenames but I have to know
the incdir directive in order to fully know where is my file and this breaks
portability as well as encapsulation (the module needs an external directive
that is project related instead of module related).
On top of that I find superconfusing that the relative path is relative to the
incdir instead of the source file location. It makes understanding and
navigating the code quite awful.
I said to myself that there must be a better way to organize files in the
project in order to handle this.
Any ideas/suggestion/comment is greatly appreciated.
Al
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
I'm pretty new to verilog, even though I've been writing C since some time and
the language is pretty easy to pick up. I have an issue though with the
'include' directive and the way to organize the included dirs.
We are using Cadence at work and it looks like the -incdir is the way to include
directories to look for files which are included in other files.
Assuming the following dir structure:
../sandbox/project/components/
âââ module1
â  âââ include
â  âââ src
âââ module2
âââ include
âââ src
Now if in my module1 I want to include something, I can directly specify an
incdir that points to module1/include and then in the src files I can simply
write:
`include "file_to_be_included.vh"
The same can be done with module2 but if for some reason the file_to_be_included
have a file with the same name I cannot do it anymore since the tool wouldn't
know which one to pick. Therefore my name space is too broad.
OTOH if I pick an upper level directory to be included (e.x. components) then I
would need to write:
`include "module1/include/file_to_be_included.vh"
This has the benefit to allow modules to have same filenames but I have to know
the incdir directive in order to fully know where is my file and this breaks
portability as well as encapsulation (the module needs an external directive
that is project related instead of module related).
On top of that I find superconfusing that the relative path is relative to the
incdir instead of the source file location. It makes understanding and
navigating the code quite awful.
I said to myself that there must be a better way to organize files in the
project in order to handle this.
Any ideas/suggestion/comment is greatly appreciated.
Al
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?