// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed under the Creative Commons Public Domain. // SPDX-FileCopyrightText: 2026 PlanV GmbH // SPDX-License-Identifier: CC0-1.0 // verilog_format: off `define stop $stop `define checkd(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got=%0d exp=%0d\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0); `define check_le(gotv,maxv) do if ((gotv) > (maxv)) begin $write("%%Error: %s:%0d: got=%0d exp<=%0d\n", `__FILE__,`__LINE__, (gotv), (maxv)); `stop; end while(0); // verilog_format: on typedef logic unsigned [63:0] uvm_reg_data_t; class uvm_reg_field; rand uvm_reg_data_t value; int unsigned m_size; int unsigned m_ones[64]; constraint c_field_valid { if (64 > m_size) { value < (64'h1 << m_size); } } function void configure(int unsigned size); value = 0; m_size = size; endfunction function void tally; for (int b = 0; b < 64; b++) if (value[b]) m_ones[b]++; endfunction endclass class regA; rand uvm_reg_field fa1, fa15, fa31, fa32; function new; fa1 = new; fa15 = new; fa31 = new; fa32 = new; fa1.configure(1); fa15.configure(15); fa31.configure(31); fa32.configure(32); endfunction endclass module t; regA r; int unsigned i; // 200 trials over uvm_reg_field-shaped `value < (1<