Forum Discussion

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

another question - Error message that is wrong?

I have another error message I am getting:

"Error: Text Design File syntax error: Text Design File contains "end of file" where "END" was expected"

Except that when I double click the message, it takes me to the last line, which says "END;"

Seems like the programs says what it should but it just keeps giving me that error message? If I take off the semicolon it gives me the same error except it says "where ; was expected"

???

I'm very confused because I've NEVER written "end of file" in here... how do I fix this error, when what it says to expect, is what I have?

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I have another error message I am getting:

    "Error: Text Design File syntax error: Text Design File contains "end of file" where "END" was expected"

    Except that when I double click the message, it takes me to the last line, which says "END;"

    Seems like the programs says what it should but it just keeps giving me that error message? If I take off the semicolon it gives me the same error except it says "where ; was expected"

    ???

    I'm very confused because I've NEVER written "end of file" in here... how do I fix this error, when what it says to expect, is what I have?

    --- Quote End ---

    Hi,

    without the file I can only guess. Maybe you have a space, tab or an empty line at the end of your TDF.

    Kind regards

    GPK
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    So I can't upload the actual tdf file but this is what it looks like:

    VARIABLE

    status[4..0] :NODE; --holds output state

    BEGIN

    IF en == 1 THEN

    IF num[] >= 4 THEN

    IF num[] <= 13 THEN status[] = b"10000";

    ELSEIF num[] >= 15 THEN

    IF num[] <= 20 THEN status[] = b"01000";

    ELSEIF num[] >= 18 THEN

    IF num[] <= 24 THEN status[] = b"00100";

    ELSEIF num[] >= 26 THEN

    IF num[] <= 30 then status[] = b"00010";

    ELSE status[] = b"00001";

    END IF;

    ELSE status[] = b"00001";

    END IF;

    ELSE status[] = b"00001";

    END IF;

    (range1, range2, range3, range4, error) = status[]; --update output

    END;

    (each "if" statement tab indented from the line above though, didn't copy/paste well).

    No extra space, etc at the end of the last line, no extra line at the end. Thanks for that suggestion though. I did delete and rewrite the line (as well as the whole thing) because I thought the same maybe.

    -And no idea if the code above is valid or not - I wrote it 3 different ways (if/then, nested if, and case). And got the same error about the end statement every time, which just makes me more confused.:confused:

    Code is supposed to be a range detector - detect a range of input when "EN" input is high - ranges given do overlap & have gaps (ie-numbers above are correct). Has to use boolean expressions and >= and <= statements.

    Thanks again.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks. That should have been obvious huh? :rolleyes: Sometimes I just get burned out too though (like I'd said that was the 3rd try at writing this program, so...). Ok, well I'm headed to work now but I'll try it tonight and let you know if it works.

    And thanks for the tips for posting code. I had tried to edit it and put spaces in but it just deleted them when I posted.