[source]

Class uvm_pkg::uvm_vreg_field

Copyright 2004-2009 Synopsys, Inc. Copyright 2010 Mentor Graphics Corporation All Rights Reserved Worldwide

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Class

uvm_vreg_field

Virtual field abstraction class

A virtual field represents a set of adjacent bits that are logically implemented in consecutive memory locations.

Constructors

new(string name = "uvm_vreg_field")

Function

new

Create a new virtual field instance

This method should not be used directly. The uvm_vreg_field::type_id::create() method should be used instead.

Parameters:

name (string)

Functions

configure(uvm_vreg parent, int unsigned size, int unsigned lsb_pos)

Function

configure

Instance-specific configuration

Specify the parent virtual register of this virtual field, its size in bits, and the position of its least-significant bit within the virtual register relative to the least-significant bit of the virtual register.

Parameters:
  • parent (uvm_vreg)

  • size (int unsigned)

  • lsb_pos (int unsigned)

get_full_name()

Function

get_full_name

Get the hierarchical name

Return the hierarchal name of this virtual field The base of the hierarchical name is the root block.

get_parent()

FUNCTION

get_parent

Get the parent virtual register

Return type:

uvm_vreg

get_register()
Return type:

uvm_vreg

get_lsb_pos_in_register()

FUNCTION

get_lsb_pos_in_register

Return the position of the virtual field / Returns the index of the least significant bit of the virtual field in the virtual register that instantiates it. An offset of 0 indicates a field that is aligned with the least-significant bit of the register.

get_n_bits()

FUNCTION

get_n_bits

Returns the width, in bits, of the virtual field.

get_access(uvm_reg_map map = null)

FUNCTION

get_access

Returns the access policy of the virtual field register when written and read via an address map.

If the memory implementing the virtual field is mapped in more than one address map, an address map must be specified. If access restrictions are present when accessing a memory through the specified address map, the access mode returned takes the access restrictions into account. For example, a read-write memory accessed through an address map with read-only restrictions would return "RO".

Parameters:

map (uvm_reg_map)

do_print(uvm_printer printer)
Parameters:

printer (uvm_printer)

convert2string()
clone()

TODO - add fatal messages

Return type:

uvm_object

do_copy(uvm_object rhs)
Parameters:

rhs (uvm_object)

do_compare(uvm_object rhs, uvm_comparer comparer)
Parameters:
do_pack(uvm_packer packer)
Parameters:

packer (uvm_packer)

do_unpack(uvm_packer packer)
Parameters:

packer (uvm_packer)

Tasks

write(longint unsigned idx, uvm_status_e status, uvm_reg_data_t value, uvm_path_e path = UVM_DEFAULT_PATH, uvm_reg_map map = null, uvm_sequence_base parent = null, uvm_object extension = null, string fname = "", int lineno = 0)

TASK

write

Write the specified value in a virtual field

Write value in the DUT memory location(s) that implements the virtual field that corresponds to this abstraction class instance using the specified access path .

If the memory implementing the virtual register array containing this virtual field is mapped in more than one address map, an address map must be specified if a physical access is used (front-door access).

The operation is eventually mapped into memory read-modify-write operations at the location where the virtual register specified by idx in the virtual register array is implemented. If a backdoor is available for the memory implementing the virtual field, it will be used for the memory-read operation.

Parameters:
read(longint unsigned idx, uvm_status_e status, uvm_reg_data_t value, uvm_path_e path = UVM_DEFAULT_PATH, uvm_reg_map map = null, uvm_sequence_base parent = null, uvm_object extension = null, string fname = "", int lineno = 0)

TASK

read

Read the current value from a virtual field

Read from the DUT memory location(s) that implements the virtual field that corresponds to this abstraction class instance using the specified access path , and return the readback value .

If the memory implementing the virtual register array containing this virtual field is mapped in more than one address map, an address map must be specified if a physical access is used (front-door access).

The operation is eventually mapped into memory read operations at the location(s) where the virtual register specified by idx in the virtual register array is implemented.

Parameters:
poke(longint unsigned idx, uvm_status_e status, uvm_reg_data_t value, uvm_sequence_base parent = null, uvm_object extension = null, string fname = "", int lineno = 0)

TASK

poke

Deposit the specified value in a virtual field

Deposit value in the DUT memory location(s) that implements the virtual field that corresponds to this abstraction class instance using the specified access path .

The operation is eventually mapped into memory peek-modify-poke operations at the location where the virtual register specified by idx in the virtual register array is implemented.

Parameters:
peek(longint unsigned idx, uvm_status_e status, uvm_reg_data_t value, uvm_sequence_base parent = null, uvm_object extension = null, string fname = "", int lineno = 0)

TASK

peek

Sample the current value from a virtual field

Sample from the DUT memory location(s) that implements the virtual field that corresponds to this abstraction class instance using the specified access path , and return the readback value .

If the memory implementing the virtual register array containing this virtual field is mapped in more than one address map, an address map must be specified if a physical access is used (front-door access).

The operation is eventually mapped into memory peek operations at the location(s) where the virtual register specified by idx in the virtual register array is implemented.

Parameters:
pre_write(longint unsigned idx, uvm_reg_data_t wdat, uvm_path_e path, uvm_reg_map map)

TASK

pre_write

Called before virtual field write.

If the specified data value, access path or address map are modified, the updated data value, access path or address map will be used to perform the virtual register operation.

The virtual field callback methods are invoked before the callback methods on the containing virtual register. The registered callback methods are invoked after the invocation of this method. The pre-write virtual register and field callbacks are executed before the corresponding pre-write memory callbacks

Parameters:
post_write(longint unsigned idx, uvm_reg_data_t wdat, uvm_path_e path, uvm_reg_map map, uvm_status_e status)

TASK

post_write

Called after virtual field write

If the specified status is modified, the updated status will be returned by the virtual register operation.

The virtual field callback methods are invoked after the callback methods on the containing virtual register. The registered callback methods are invoked before the invocation of this method. The post-write virtual register and field callbacks are executed after the corresponding post-write memory callbacks

Parameters:
pre_read(longint unsigned idx, uvm_path_e path, uvm_reg_map map)

TASK

pre_read

Called before virtual field read.

If the specified access path or address map are modified, the updated access path or address map will be used to perform the virtual register operation.

The virtual field callback methods are invoked after the callback methods on the containing virtual register. The registered callback methods are invoked after the invocation of this method. The pre-read virtual register and field callbacks are executed before the corresponding pre-read memory callbacks

Parameters:
post_read(longint unsigned idx, uvm_reg_data_t rdat, uvm_path_e path, uvm_reg_map map, uvm_status_e status)

TASK

post_read

Called after virtual field read.

If the specified readback data rdat or status is modified, the updated readback data or status will be returned by the virtual register operation.

The virtual field callback methods are invoked after the callback methods on the containing virtual register. The registered callback methods are invoked before the invocation of this method. The post-read virtual register and field callbacks are executed after the corresponding post-read memory callbacks

Parameters: