Hello I am having trouble with the following test bench code, it uses parameters in packages.
The case statement in the function seems to want to always hit the "default" case (resulting in selecting value 88), although clearly it should be hitting the "A" case, yeilding value 8. I have been able to verify that "A" is in both parameters tb_program_name and local_tb_program_name, by using examine command in questa GUI. Is there some issue with multiple packages here, or passing strings around for use in case statement? Note if I comment out the "default" case, the function then returns "0" instead of "88".
package program_name_pkg;
parameter string tb_program_name = "A";
endpackage : program_name_pkg
package p2_midsj_parameters_pkg;
import uvmf_base_pkg_hdl::*;
import program_name_pkg::*;
parameter string local_tb_program_name = tb_program_name;
function int set_gemac_rx_out_data_width (input string my_program_name);
case(my_program_name)
"A": return 8;
"": return 11;
null : return 9;
default: return 88;
endcase // case (program_name)
endfunction : set_gemac_rx_out_data_width
parameter int gemac_rx_out_data_width = set_gemac_rx_out_data_width(local_tb_program_name);
endpackage