2
votes

Can anyone see what is wrong with my code?

I get a error on the comment line. Saying syntax error near text. I tried to change from both binary to hex numbers, but keep getting the same error. Were the errors are is comment selected.

This are the errors:

Error (10500): VHDL syntax error at MAL.vhd(26) near text
Error (10500): VHDL syntax error at MAL.vhd(26) near text ""; expecting "then"
Error (10500): VHDL syntax error at MAL.vhd(26) near text ­ Error (10500): VHDL syntax error at MAL.vhd(26) near text ¬
Error (10500): VHDL syntax error at MAL.vhd(29) near text "else"; expecting "end", or "(", or an identifier ("else" is a reserved keyword), or a sequential statement
Error (10500): VHDL syntax error at MAL.vhd(31) near text "if"; expecting "process"

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_unsigned.ALL;

ENTITY MAL IS
    PORT (
        clk_50 : IN std_logic;
        pulse_out : OUT std_logic
    );
END MAL;

ARCHITECTURE behave OF MAL IS
    SIGNAL pulse : std_logic;
    SIGNAL counter : std_logic_vector(15 DOWNTO 0);
BEGIN
    PROCESS (clk_50) IS
    BEGIN
        pulse <= '0';
        -- if counter = ‭x"‭C34F‬"‬ then
        -- counter <= (others => '0');
        pulse <= '1';
        -- else
        counter <= counter + 1;
        END IF;
    END PROCESS;

    --output
    pulse_out <= pulse;

END ARCHITECTURE behave;
1
Please include the error message, and update the source code to include line number in a comment, like -- Line 27 since the 27 if is definitely a syntax error :-) - Morten Zilmer
Thank you for your comment. Its is now changed. I could not find were to include the line number in Quartus. Do you know where? - remivass
This code is not what generated those errors. You commented out "else", and it is still in the error messages. - Philippe

1 Answers

3
votes

You have some illegal character in there. Remove line 27 and re-write it and you should be ok.