Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > generic

Reply
Thread Tools

generic

 
 
Brian
Guest
Posts: n/a
 
      11-06-2009
I am tying to create a module with a generic, but something is not
correct. Please help. How do I do this correctly?

entity downsample_by_two is
generic (
wordlength : integer := 14;
ce_clk48_polarity : std_logic := '1' -- 1: hi, 0: lo
);
port(
-- INPUT PORTS --
x : in std_logic_vector(wordlength-1 downto 0);
ce_clk48 : in std_logic;
-- OUTPUT PORTS --
7 : out std_logic_vector(wordlength-1 downto 0)
);
end entity;


then on down in the code I want to use


if ce_clk48 = ce_clk48_polarity then
 
Reply With Quote
 
 
 
 
Andy
Guest
Posts: n/a
 
      11-06-2009
On Nov 6, 6:58*am, Brian <(E-Mail Removed)> wrote:
> I am tying to create a module with a generic, but something is not
> correct. Please help. How do I do this correctly?
>
> entity downsample_by_two is
> * * * * generic (
> * * * * * * * * wordlength * * * * * * *: integer * * * := 14;
> * * * * * * * * ce_clk48_polarity * * * : std_logic := '1' -- 1: hi, 0: lo
> * * * * * * * * );
> * * * * port(
> * * * * * * * * -- INPUT PORTS --
> * * * * * * * * x * * * * * * * : in std_logic_vector(wordlength-1 downto 0);
> * * * * * * * * ce_clk48 * * * *: in std_logic;
> * * * * * * * * -- OUTPUT PORTS --
> * * * * * * * * 7 * * * * * * * : out std_logic_vector(wordlength-1 downto 0)
> * * * * * * * * );
> end entity;
>
> then on down in the code I want to use
>
> if ce_clk48 = ce_clk48_polarity then


Your output port name is not a legal identifier in VHDL.

Andy
 
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
can you change the generic MS icon that is assigned to Firefox? Verizon User Firefox 2 03-30-2005 08:08 AM
FC II & Generic Marek Ponca VHDL 1 11-22-2003 05:03 AM



Advertisments