Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Generic entities in package

Reply
Thread Tools

Generic entities in package

 
 
Olaf Petzold
Guest
Posts: n/a
 
      04-06-2007
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;
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      04-06-2007
Olaf Petzold wrote:

> is it possible to use generic entities inside packages?


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

-- Mike Treseler
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
not just generic type programming,but also parallism generic syntaxprogramming?? minlearn C++ 2 03-13-2009 05:17 PM
generic interfaces with generic methods Murat Tasan Java 1 02-03-2009 12:17 PM
Generic class in a non generic class nramnath@gmail.com Java 2 07-04-2006 07:24 AM
Re: generic pipelined comparator and package MB VHDL 1 11-20-2005 04:14 AM
HTML::Entities::encode() returning wrong(?) entities Jim Higson Perl Misc 3 07-25-2004 09:13 PM



Advertisments