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

Reply

VHDL - Generic entities in package

 
Thread Tools Search this Thread
Old 04-06-2007, 08:20 PM   #1
Default Generic entities in package


Hi,

is it possible to use generic entities inside packages? The following
code will not pass modelsim. The error is:

# ** Error: ../source/vhdl/tb_pkg.vhd(67): near "architecture":
expecting: END

What is wrong?

Thanks
Olaf

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;


package tb_pkg is

component clock_source is
generic (
PERIOD : time := 10 ns;
RESET_TIME : time := 50 ns;
RESET_ACTIVE : std_logic := '1');
port (
clk : out std_logic;
reset : out std_logic;
stop : in std_logic);
end component;

end package;


package body tb_pkg is

-- entity clock_source is
-- generic (
-- PERIOD : time := 10 ns;
-- RESET_TIME : time := 30 ns;
-- RESET_ACTIVE : std_logic := '1');
-- port (
-- clk : out std_logic;
-- reset : out std_logic;
-- stop : in std_logic);
-- end entity;

architecture behavioral of clock_source is -- line 67
begin
process (clk, reset, stop) is
begin
clk <= '0';

if (now < RESET_TIME) then
reset <= RESET_ACTIVE;
else
reset <= not RESET_ACTIVE;
end if;

if stop then wait; end if;

wait for PERIOD/2;
clk <= '1';
wait for PERIOD/2;

end process;
end architecture;

end package;


Olaf Petzold
  Reply With Quote
Old 04-06-2007, 08:33 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: Generic entities in package
Olaf Petzold wrote:

> is it possible to use generic entities inside packages?


I can *instance* entities
but I can only package declarations.

-- Mike Treseler


Mike Treseler
  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
enterprisedb package execution kanchuparthi.rams Software 0 05-22-2008 01:59 PM
Complete package of DVD solutions mikeriv Software 0 03-28-2007 02:33 PM
The Practice Test Package Development: A New Service on the Certification Market David Johnson A+ Certification 0 01-19-2005 10:52 AM
Netflix Moving to Generic Discs. One-Shot Scot DVD Video 28 11-23-2004 11:14 PM
PC Package deals? jkl A+ Certification 0 10-28-2004 05:12 PM




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