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

Reply

VHDL - VHDL Packages

 
Thread Tools Search this Thread
Old 08-13-2003, 11:08 PM   #1
Default VHDL Packages


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
  Reply With Quote
Old 08-14-2003, 09:00 AM   #2
Egbert Molenkamp
 
Posts: n/a
Default Re: VHDL Packages
"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
  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
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




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