Help for IsTriggered function in HDL simulations

Hi all!
I am somehow confused about the IsTriggered function available in the okHostCalls.v file.
The function (just cut and paste from the above mentioned file) is

function IsTriggered (
input [7:0] ep,
input [15:0] mask
);
begin
if ((Triggered[ep - 8’h60] & mask) >= 0) begin
if ((Triggered[ep - 8’h60] & mask) == 0) begin
IsTriggered = 0;
end else begin
IsTriggered = 1;
end
end else begin
$display("***FRONTPANEL ERROR: IsTriggered mask 0x%04h covers unused Triggers", mask);
IsTriggered = 0;
end
end
endfunction

I noticed that the $display statement is always executed. This looks strange to me.
In the testbench I used the calling:

k = IsTriggered(8’h60, 16’h0002);

in order to check bit [1] of the endpoint.
Where is my mistake?

Thanks for the help

Francesco

Francesco - can you create a very basic test case for this that reproduces the problem? If so, please send the HDL and test bench to support @ opalkelly . com

Hi,
unfortunately in the simple test I prepared I am not able to replicate the reported behavior :confused: and I cannot spend too much time on it now.
I will go on investigating my main code and in case I will send some example by email.
Thank you anyway for the attention.

Francesco