Here is an example of what I'm doing. Ultimately, the special_function module should be place in a separate file.
Code:`include "constants.vams"
`include "disciplines.vams"
module special_functions();
analog function real maxValue;
input n1,n2 ;
real n1,n2 ;
begin
maxValue = (n1 > n2) ? n1 : n2 ;
end
endfunction
endmodule
module blackbox(in1,in2,out);
inout in1,in2,out;
electrical in1,in2,out;
special_functions sp_func();
real val1,val2;
analog begin
val1 = V(in1);
val2 = V(in2);
//V(out) <+ special_functions.maxValue(val1,val2);
V(out) <+ sp_func.maxValue(val1,val2);
end
endmodule
In the attached file, you'll find the compilation error.
Thank you for your help,
Thomas.