Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21611 Discussions

Messages in function during sythesis

Altera_Forum
Honored Contributor II
1,190 Views

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?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
509 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
509 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
509 Views

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

0 Kudos
Reply