From 3cae8ddd9c9254a5f04b95771cce46e19e5bb280 Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Fri, 8 Nov 2024 14:03:01 +0100 Subject: [PATCH] Size method in if expression inside randomize...with (wrong warning) Warning message does not contain an expression that causes the problem: %Warning-CONSTRAINTIGN: /path/riscv-dv/src/riscv_instr_stream.sv:286:51: Unsupported: randomizing this expression, treating as state /path/riscv-dv/src/riscv_instr_pkg.sv:1589:1: ... note: In file included from 'riscv_instr_pkg.sv' ... For warning description see https://verilator.org/warn/CONSTRAINTIGN?v=5.031 ... Use "/* verilator lint_off CONSTRAINTIGN */" and lint_on around source to disable this message. Signed-off-by: Ryszard Rozak --- src/riscv_instr_stream.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riscv_instr_stream.sv b/src/riscv_instr_stream.sv index 9e980da8..5bbfed14 100644 --- a/src/riscv_instr_stream.sv +++ b/src/riscv_instr_stream.sv @@ -255,7 +255,7 @@ class riscv_rand_instr_stream extends riscv_instr_stream; function void randomize_gpr(riscv_instr instr); `DV_CHECK_RANDOMIZE_WITH_FATAL(instr, - if (avail_regs.size() > 0) { + if (1 > 0) { if (has_rs1) { rs1 inside {avail_regs}; }