Altera_Forum
Honored Contributor
15 years agoHow to pass physic ports "CLOCK_50" to components
Hi, I'm new on this( my first day), I'm trying to make a simple led counter but when I try to pass the clock to the counter I get the error:
Error (10349): VHDL Association List error at Ledsv2.vhd(48): formal "CLOCK_50" does not exist Some help pleas, I've spend all afternoon looking for solutions. My code is in VHDL and very Simple. I put it down this lines, there are only two files, the core is LEDsv2.vhd and the Counter is Comptador.vhd I have more errors but I hope be able correct them by my self. Thanks taquion file: LEDsv2.vhd: --------------------------------- -- -- Segundo intento Leds -- -- DE2-115 -- --------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; entity Ledsv2 is port( signal LEDR : out std_logic_vector (17 DOWNTO 0); signal CLOCK_50 : in std_logic; signal SW : in std_logic_vector (17 DOWNTO 0); signal KEY : in std_logic_vector (3 DOWNTO 0) ); signal CLK : std_logic; end Ledsv2; architecture behavior of Ledsv2 is component Comptador is port( signal CLK_comp: in std_logic; signal nReset : in std_logic; signal q_out : out std_logic_vector (7 downto 0) ); end component; -- Variables Principales type estados is( S0, S1); signal stat_act,estat_next : estados; signal cuentas : std_logic_vector (7 downto 0); begin Mapeig_Comptador: Comptador port map ( CLOCK_50 => CLK_comp, KEY(0) => nReset, q_out => cuentas -- ms ); -- Programa Llums: process (cuentas,state,KEY(0)) begin if (KEY(0)='0') then nReset <= '0'; LEDR <=(others=> '0'); state <= S0; else case state is when S0 => if (cuentas=250) then state <= S1; nReset <= '0'; end if; when S1 => if(LEDR=262144) then LEDR <= (others => '0'); else LEDR <= LEDR+'1'; end if; state <= S0; when others => null; end case; end if; end process; end behavior; ----------------------------------- file: Comptador.vhd: library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; use IEEE.numeric_std.all; entity Comptador is port( CLK_comp : in std_logic; nReset : in std_logic; q_out : out std_logic_vector (7 downto 0) ); end Comptador; architecture arch_Comptador of Comptador is signal q_aux : std_logic_vector (7 downto 0); signal cuenta: std_logic_vector (15 downto 0); begin process(CLK_comp,nReset) begin if(nReset='0') then q_aux <=(others => '0'); elsif (rising_edge(CLK_comp)) then if(cuenta= 50000) then cuenta <=(others => '0'); q_aux <= q_aux + '1'; else cuenta <= cuenta +'1'; end if; end if; end process; q_out <=q_aux; end arch_Comptador;