I am trying to exercise the below code but it throws the below error.
function disable_assert(int clk_out, int logic_gen);
$assertoff(0,hdl_top.i_clock_gen.gen_clock_out**[clk_out].clock_mux_u.logic_gen[logic_gen]**.i_sync_en.check_level_high_duration);
endfunction
Error found while trying to resolve cross-module reference. token ‘clk_out’ ‘logic_gen’. Originating interface ‘clock_gen_intf’, first module hit ‘hdl_top’.
The same code if I use like below it works.
$assertoff(0,hdl_top.i_clock_gen.gen_clock_out**[0].clock_mux_u.logic_gen[0].i_sync_en.check_level_high_duration); $assertoff(0,hdl_top.i_clock_gen.gen_clock_out[0].clock_mux_u.logic_gen[1]**.i_sync_en.check_level_high_duration); $assertoff(0,hdl_top.i_clock_gen.gen_clock_out[0].clock_mux_u.logic_gen[2].i_sync_en.check_level_high_duration);
$assertoff(0,hdl_top.i_clock_gen.gen_clock_out[1].clock_mux_u.logic_gen[0].i_sync_en.check_level_high_duration); $assertoff(0,hdl_top.i_clock_gen.gen_clock_out[1].clock_mux_u.logic_gen[1].i_sync_en.check_level_high_duration); $assertoff(0,hdl_top.i_clock_gen.gen_clock_out[1].clock_mux_u.logic_gen[2].i_sync_en.check_level_high_duration);
Can someone tell me where it is going wrong.