Interface is not updating the value

In my base test code i am accessing the top interface and updating the value of vsp variable of the interface but it is only taking limit value not updating the correct limit - (1/6) value as needed.

What can be the issue?

top_vif.vsp =  limit - (1/6);

Thanks.

What are the data types of the variables? Can you give us an example of the values you’re expecting?

Hi dave,

vsp is real variable and limit is int variable.

It’s a truncation issue. Just replace it with

top_vif.vsp =  type(top_vif.vsp)'(limit - (1.0/6.0));

Because limit is an integer you have to cast this to real, like this: