the problem is the constraint solver would timeout in this form (I set the timer as 180 sec);
but if I combine these three queues in INSTRUCTION_RANGE_4 as
With a few more lines of code, you could provide a complete example which demonstrates your issues.
The below code works fine on all 4 simulators on EDA Playground, with no performance issues. Perhaps there is something else in your code which is causing your problem.
typedef enum {PMULLD, PMULDQ, PABSB, PABSW, PABSD, PALIGNR} operation_e;
class instruction;
rand operation_e operation;
function new();
endfunction
endclass
module testbench;
operation_e INSTRUCTION_RANGE_1[$] = {PMULLD, PMULDQ};
operation_e INSTRUCTION_RANGE_2[$] = {PABSB, PABSW, PABSD};
operation_e INSTRUCTION_RANGE_3[$] = {PALIGNR};
operation_e INSTRUCTION_RANGE_4[$] = {PMULLD, PMULDQ, PABSB, PABSW, PABSD, PALIGNR};
instruction req;
initial begin
req = new();
repeat (50) begin
if (!req.randomize() with {
operation inside {INSTRUCTION_RANGE_1, INSTRUCTION_RANGE_2, INSTRUCTION_RANGE_3};
}) $display("Error randomizing req");
else $display("req.operation is %s", req.operation.name());
end
end
endmodule
Thanks for your reply, the whole code is confidential and is stored locally, and the constraint block do have a bunch of other randomizations, I’ll try to figure this out in some other way.