generic

B

Brian

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
 
A

Andy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top