Raises a custom compile-time error.
void __error(string format, ...);
The __error() function called from a process or a function that is being executed during compile-time or converted to VHDL will stop the compilation and produce a user-defined error. You can use .Net composite format strings to make your error messages more specific.
template <int _Size> entity Inner
{
port in logic clk;
process dummy ()
{
if (pow2(log2(_Size)) != _Size)
__error("_Size = {1} is not a multiple of 2", _Size);
}
}
entity Test
{
Inner<3> uut(
clk = auto
);
}
The compilation will fail with an error message:
_Size = 3 is not a multiple of 2