[vhdl-200x-ft] Question On Type Genericity

From: <yannick.grugni@philips.com>
Date: Tue Jan 18 2005 - 07:09:42 PST

I am new so I don't know if it's the good place to ask the question.
I have seen that there is a proposal to allow formal types in a generic
interface clause.
Is it only intended to be use for packages and subprograms or can I use it
also for entities?
Can someone tell me if the code below will be accepted?

entity counter is
   generic ( type count_type);
   port ( clk : in bit; data : out count_type );
end entity counter;

architecture behavioral of counter is
begin
   count_behavior : process is
      variable count : count_type := count_type'low;
   begin
      data <= count;
      wait until clk = '1';
      if count = count_type'high then
         count := count_type'succ(count);
      else
         count := count_type'low;
      end if;
   end process count_behavior;
end architecture behavioral;

Kind Regards,
Yannick
 
---------------------------------------------------------------------------------------------------------
Yannick Grugni Design Competence Center
Leuven
VLSI Engineer Interleuvenlaan 74-82
Tel: +(32)16.390.742 3001 Leuven
yannick.grugni@philips.com Belgium
----------------------------------------------------------------------------------------------------------
Received on Tue Jan 18 07:10:52 2005

This archive was generated by hypermail 2.1.8 : Tue Jan 18 2005 - 07:11:16 PST