Hi,
I am trying to constraint a dynamic array - this stores the different opcodes used for processing the input.
When all the *_min and *_max values are non-zero, the constraint solver is extremely slow.
Any suggestions on improving this constraint?
opcode_t tmp_act_cmd_mem_opcode_grp[];
int instr_cnt = ($urandom_range(8,256); // user can provide through $value$plusargs too
void'(std::randomize(tmp_act_cmd_mem_opcode_grp) with {
tmp_act_cmd_mem_opcode_grp.size() == instr_cnt;
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == NOP))) inside {[0:255]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == MOVD))) inside {[act_movd_cnt_min:act_movd_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == MOVI))) inside {[act_movi_cnt_min:act_movi_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == UPD_HBOA))) inside {[act_upd_hboa_cnt_min:act_upd_hboa_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == ADDI))) inside {[act_addi_cnt_min:act_addi_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == ADDL))) inside {[act_addl_cnt_min:act_addl_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == UPD_CSUM))) inside {[act_upd_csum_cnt_min:act_upd_csum_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == LD_HDRLEN))) inside {[act_ld_hdrlen_cnt_min:act_ld_hdrlen_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == MOVDM))) inside {[act_movdm_cnt_min:act_movdm_cnt_max]};
(tmp_act_cmd_mem_opcode_grp.sum() with (int'(item == CPY_HBOA))) inside {[act_cpy_hboa_cnt_min:act_cpy_hboa_cnt_max]};
foreach(tmp_act_cmd_mem_opcode_grp[j]) {
tmp_act_cmd_mem_opcode_grp[j] inside {[NOP:CPY_HBOA]};
if(j>=32) {
tmp_act_cmd_mem_opcode_grp[j] != LD_HDRLEN; // LD_HDRLEN should be within first 32 instructions
}
}
});
Thanks