Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Syntax Error

can anyone tell me whats wrong with this code? :confused:

My device is

Family : Cyclone

Package : FBGA

Pin Out : 256

Speed Grade : 6

Name : EP1C12F256C6

My code:

-----------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity allT is
	port(g, y, r : buffer std_logic(1 to 4);
	     clk     : in std_logic);
end allT;
architecture behav of allT is
	
	signal d, q : std_logic;
	signal gL   : std_logic_vector(1 to 16);
	signal yL   : std_logic_vector(1 to 4);
	
	component delay
		port(D, clk : in std_logic;
			 Q      : out std_logic);
	end component;
	
begin
	process(r, clk, x)
		begin
		if (clk'event AND clk = '1') then
		d <= '1';
		
		case r is 
			when "0111" =>
				g <= "0001";
			when others =>
				null;
		end case;
		
		for gL in 1 to 15 loop
			greenL : delay port map (d, clk, q);
			gL <= gL + 1;	
		end loop;
		
		case r is 
			when "0111" =>
				g <= "0000";
			when others =>
				null;
		end case;
					
		case r is 
			when "0111" =>
				y <= "1000";
			when others =>
				null;
		end case;
	
		for yL in 1 to 3 loop
			yellowL : delay port map (d, clk, q);
			yL <= yL + 1;
		end loop;
		
		case r is		
			when "0111" =>
				y <= "0000";
			when others =>
				null;
		end case;
		
		case r is
			when "0111" =>
				r <= "1011";
			when others =>
				null;
		end case;
		
		end if;
	end process;
end behav;

-------------------------------------------------------

When i compile this code, i get 4 errors.

Error (10500): VHDL syntax error at allT.vhd(35) near text "port"; expecting "(", or "'", or "."

Error (10500): VHDL syntax error at allT.vhd(35) near text ";"; expecting ":=", or "<="

Error (10500): VHDL syntax error at allT.vhd(54) near text "port"; expecting "(", or "'", or "."

Error (10500): VHDL syntax error at allT.vhd(54) near text ";"; expecting ":=", or "<="

--------------------------------------------------------

i'm new member here, please tell me if i make an illegal act or something wrong in this forum..thanks..:D

15 Replies