![]() |
|
|
|
#1 |
|
If you have two packages being used in a top-level design, can you
have the same constants/dataTypes be defined in each of the packages ? Sandeep |
|
|
|
|
#2 |
|
Posts: n/a
|
"Sandeep" <> wrote in message
news: om... > If you have two packages being used in a top-level design, can you > have the same constants/dataTypes be defined in each of the packages ? Yes (but in practice No) PACKAGE x IS CONSTANT c : integer := 5; END x; PACKAGE y IS CONSTANT c : integer := 10; END y; USE work.x.all; USE work.y.all; ENTITY use_package IS PORT (r : in integer := c ); END use_package; In the example above the constant c is declared in both package. Which c is to be used in the port declaration for signal r? Your tool will probably complain; there are two c's possible. Solutions: - use only ONE package (remove a USE clause), or - make explicit which constant c is to be use, i.e. ENTITY use_package IS PORT (r : in integer := work.x.c ); assumed is that the package is compiled in library work, and you want the constant c from package x. Egbert Molenkamp Egbert Molenkamp |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to execute an external software from VHDL? And how to interface VHDL with JAVA? | becool_nikks | Software | 0 | 03-06-2009 07:08 PM |
| Help on auto conversion from Matlab to vhdl on filter design | hardheart | Hardware | 0 | 12-07-2007 09:19 AM |
| VHDL RAM help!:) | lastval | Hardware | 0 | 11-09-2007 01:40 PM |
| ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL | freitass | Hardware | 0 | 11-01-2007 03:44 PM |
| vhdl code | amirster | Hardware | 0 | 05-10-2007 07:28 AM |