Forum Discussion

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

Messages in function during sythesis

I have errors that I want the compiler to check for inside a funciton, but Quartus just seems to jump over them. As an example if I create the following function:

function test_error(test : boolean) return boolean is
begin
    assert false report "Error Message" severity error;
   return not test;
endfunction;

and use the function inside a vhdl file that is sythesized in a Quartus project:


architecture arch of ent is
constant test_bool    : boolean := test_error(false);
being
...

The function works (test_bool is set to true) but no error are reported in Quartus.

Anybody have any suggestions?

3 Replies

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

    try setting the severity level to Failure. Its worked for me in the past when Ive checked generic values for illegal combinations. Ive done it from asserts directly in the architecture (they dont need to be inside a function) and inside function calls.

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

    Thanks for the reply Tricky.

    No luck with setting the severity to Failure. I'm not having any issues with using assert within an architecture, it just seems to be within functions that's not working.

    As a work around I'm thinking I could switch the function to a procedure that also outputs a string and then put an assert statement in the architecture that assert the error if the string is not empty, but I'd prefer to not have to do something like that (seems very hacky).

    I'm using Quartus 10.1, so I'm going to try updating to the latest version and see if it helps any.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    a procedure wont work because it has to be called within a process, and Quartus wont evaluate a process like that.