| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| // base register class which will be used to generate the reg |
| class dv_base_reg extends uvm_reg; |
| function new(string name = "", |
| super.new(name, n_bits, has_coverage); |
| // get_n_bits will return number of all the bits in the csr |
| // while this function will return actual number of bits used in reg field |
| function uint get_n_used_bits(); |
| foreach (fields[i]) get_n_used_bits += fields[i].get_n_bits(); |