Verification Academy

Search form

My Account Menu

  • Register
  • Log In
  • Topics
  • Courses
  • Forums
  • Patterns Library
  • Cookbooks
  • Events
  • More
  • All Topics
    The Verification Academy offers users multiple entry points to find the information they need. One of these entry points is through Topic collections. These topics are industry standards that all design and verification engineers should recognize. While we continue to add new topics, users are encourage to further refine collection information to meet their specific interests.
    • Languages & Standards

      • Portable Test and Stimulus
      • Functional Safety
      • Design & Verification Languages
    • Methodologies

      • UVM - Universal Verification Methodology
      • UVM Framework
      • UVM Connect
      • FPGA Verification
      • Coverage
    • Techniques & Tools

      • Verification IP
      • Simulation-Based Techniques
      • Planning, Measurement, and Analysis
      • Formal-Based Techniques
      • Debug
      • Clock-Domain Crossing
      • Acceleration
  • All Courses
    The Verification Academy is organized into a collection of free online courses, focusing on various key aspects of advanced functional verification. Each course consists of multiple sessions—allowing the participant to pick and choose specific topics of interest, as well as revisit any specific topics for future reference. After completing a specific course, the participant should be armed with enough knowledge to then understand the necessary steps required for maturing their own organization’s skills and infrastructure on the specific topic of interest. The Verification Academy will provide you with a unique opportunity to develop an understanding of how to mature your organization’s processes so that you can then reap the benefits that advanced functional verification offers.
    • Universal Verification Methodology (UVM)

      • Advanced UVM
      • Basic UVM
      • Introduction to UVM
      • UVM Connect
      • UVM Debug
      • UVMF - One Bite at a Time
    • Featured Courses

      • Introduction to ISO 26262
      • Introduction to DO-254
      • Clock-Domain Crossing Verification
      • Portable Stimulus Basics
      • Power Aware CDC Verification
      • Power Aware Verification
      • SystemVerilog OOP for UVM Verification
    • Additional Courses

      • Assertion-Based Verification
      • An Introduction to Unit Testing with SVUnit
      • Evolving FPGA Verification Capabilities
      • Metrics in SoC Verification
      • SystemVerilog Testbench Acceleration
      • Testbench Co-Emulation: SystemC & TLM-2.0
      • Verification Planning and Management
      • VHDL-2008 Why It Matters
    • Formal-Based Techniques

      • Formal Assertion-Based Verification
      • Formal-Based Technology: Automatic Formal Solutions
      • Formal Coverage
      • Getting Started with Formal-Based Technology
      • Handling Inconclusive Assertions in Formal Verification
      • Sequential Logic Equivalence Checking
    • Analog/Mixed Signal

      • AMS Design Configuration Schemes
      • Improve AMS Verification Performance
      • Improve AMS Verification Quality
  • All Forum Topics
    The Verification Community is eager to answer your UVM, SystemVerilog and Coverage related questions. We encourage you to take an active role in the Forums by answering and commenting to any questions that you are able to.
    • UVM Forum

      • Active Questions
      • Solutions
      • Replies
      • No Replies
      • Search
      • UVM Forum
    • SystemVerilog Forum

      • Active Questions
      • Solutions
      • Replies
      • No Replies
      • Search
      • SystemVerilog Forum
    • Coverage Forum

      • Active Questions
      • Solutions
      • Replies
      • No Replies
      • Search
      • Coverage Forum
    • Additional Forums

      • Announcements
      • Downloads
      • OVM Forum
  • Patterns Library
    The Verification Academy Patterns Library contains a collection of solutions to many of today's verification problems. The patterns contained in the library span across the entire domain of verification (i.e., from specification to methodology to implementation—and across multiple verification engines such as formal, simulation, and emulation).
    • Implementation Patterns

      • Environment Patterns
      • Stimulus Patterns
      • Analysis Patterns
      • All Implementation Patterns
    • Specification Patterns

      • Occurrence Property Patterns
      • Order Property Patterns
      • All Specification Patterns
    • Pattern Resources

      • Start Here - Patterns Library Overview
      • Whitepaper - Taking Reuse to the Next Level
      • Verification Horizons - The Verification Academy Patterns Library
      • Contribute a Pattern to the Library
  • All Cookbooks
    Find all the methodology you need in this comprehensive and vast collection. The UVM and Coverage Cookbooks contain dozens of informative, executable articles covering all aspects of UVM and Coverage.
    • UVM Cookbook

      • UVM Basics
      • Testbench Architecture
      • DUT-Testbench Connections
      • Configuring a Test Environment
      • Analysis Components & Techniques
      • End Of Test Mechanisms
      • Sequences
      • The UVM Messaging System
      • Other Stimulus Techniques
      • Register Abstraction Layer
      • Testbench Acceleration through Co-Emulation
      • Debug of SV and UVM
      • UVM Connect - SV-SystemC interoperability
      • UVM Versions and Compatibility
      • UVM Cookbook
    • Coding Guidelines & Deployment

      • Code Examples
      • UVM Verification Component
      • Package/Organization
      • Questa/Compiling UVM
      • SystemVerilog Guidelines
      • SystemVerilog Performance Guidelines
      • UVM Guidelines
      • UVM Performance Guidelines
    • Coverage Cookbook

      • Introduction
      • What is Coverage?
      • Kinds of Coverage
      • Specification to Testplan
      • Testplan to Functional Coverage
      • Bus Protocol Coverage
      • Block Level Coverage
      • Datapath Coverage
      • SoC Coverage Example
      • Requirements Writing Guidelines
      • Coverage Cookbook
  • All Events
    No one argues that the challenges of verification are growing exponentially. What is needed to meet these challenges are tools, methodologies and processes that can help you transform your verification environment. These recorded seminars from Verification Academy trainers and users provide examples for adoption of new technologies and how to evolve your verification process.
    • Upcoming & Featured Events

      • U2U MARLUG - January 26th
      • Creating an Optimal Safety Architecture  - February 9th
      • The ABC of Formal Verification - February 11th
      • Events Calendar
    • On Demand Seminars

      • I'm Excited About Formal...
      • Visualizer Coverage
      • Formal-based ‘X’ Verification
      • 2020 Functional Verification Study
      • All On-Demand Seminars
    • Recording Archive

      • Improving Your SystemVerilog & UVM Skills
      • Should I Kill My Formal Run?
      • Visualizer Debug Environment
      • All Recordings
    • Mentor Training Center

      • SystemVerilog for Verification
      • SystemVerilog UVM
      • UVM Framework
      • Instructor-led Training
    • Mentor Learning Center

      • SystemVerilog Fundamentals
      • SystemVerilog UVM
      • Questa Simulation Coverage Acceleration Apps with inFact
      • View all Learning Paths
  • About Verification Academy
    The Verification Academy will provide you with a unique opportunity to develop an understanding of how to mature your organization's processes so that you can then reap the benefits that advanced functional verification offers.
    • Blog & News

      • Verification Horizons Blog
      • Academy News
      • Academy Newsletter
      • Technical Resources
    • Verification Horizons Publication

      • Verification Horizons - November 2020
      • Verification Horizons - July 2020
      • Verification Horizons - March 2020
      • Issue Archive
    • About Us

      • Verification Academy Overview
      • Subject Matter Experts
      • Contact Us
    • Training

      • Questa® & ModelSim®
      • Questa® inFact
      • Functional Verification Library
Ask a Question
UVM
  • Home /
  • Forums /
  • UVM /
  • UVM Register layer writing/reading X values

UVM Register layer writing/reading X values

UVM 5511
UVM 141 RAL 52 register layer 4 x value 1
SilentB
SilentB
Full Access
3 posts
June 19, 2018 at 2:02 am

Hi everyone,

I have and UVM Register layer implemented in my UVM environment for BACKDOOR access to my logic signals and memories in RTL.
But I have a problem with writing and reading X values. When I try to do those operations, the value '0 is written/read instead. Is there some way how to achieve this? I have already tried to use uvm_reg_data_logic_t and logic vector for data, but without any change.

Replies

Log In to Reply
chr_sue
chr_sue
Full Access
3208 posts
June 19, 2018 at 3:53 am

In reply to SilentB:
It looks like this is a type problem and you have in between a 2-satet variable.
But without seeing the code it is only guessing.

SilentB
SilentB
Full Access
3 posts
June 19, 2018 at 4:11 am

Thank you for response. Here is snippet of my code for memory model and example of write task.

Creating of memory_model:

// Default memory model.
class memory_model extends uvm_mem;
 
  `uvm_object_utils(memory_model)
 
  function new(string name = "memory_model");
    super.new(name,             // Name of the memory model
              ROW_NUM,          // The address range
              WORD_WIDTH,       // The width of the memory in bits
              "RW",             // Access - RW or RO
              UVM_NO_COVERAGE); // Functional coverage
  endfunction
 
endclass: memory_model

After that in my uvm_block class (extend uvm_reg_block) a have:

rand memory_model m_mem;
..
  virtual function void build;
 
    // First part of HDL path
    add_hdl_path("top.dut.HDL");
 
    // Memories
    m_mem = memory_model::type_id::create("m_mem");
    m_mem.configure(this, "");
    m_mem.add_hdl_path_slice(.name("my_mem"), .offset(0), .size(WORD_WIDTH));

And for use in sequence I am using for example this task for write word to memory:

  task automatic write_word_to_memory(
    input logic [WADD_W-1:0] wadd,  // Word address in memory
    input logic [DIN_W-1:0] data,   // Data that will be written
    input memory_model object_id    // ID of object
    );
    uvm_status_e status;
    uvm_reg_data_logic_t outgoing = data;
 
    object_id.write(status, wadd, outgoing, UVM_BACKDOOR);
    assert( status == UVM_IS_OK ) begin
      `uvm_info("write_word_to_memory", $sformatf("Write to %s address %0d | data %8h", object_id.get_name(), wadd, data), UVM_MEDIUM);
    end else begin
      `uvm_error("write_word_to_memory", "Status of UVM_BACKDOOR approach is not OK!")
    end
  endtask: write_word_to_memory

Call in sequence:

    mem_backdoor.write_word_to_memory(
      read_address,           // Word address in memory
      'X,                     // Data that will be written
      mem_backdoor.m_mem  // ID of object
      );
SilentB
SilentB
Full Access
3 posts
June 19, 2018 at 4:42 am

After more searching I think, that problem is not in my code, but it is the definition of task write and read in uvm_mem file in UVM package.

https://www.vmmcentral.org/uvm_vmm_ik/files3/reg/uvm_mem-svh.html#uvm_mem.write

As you can see, there is uvm_reg_data_t used for value, which is 2-state. And I would need there uvm_reg_data_logic_t type, which is 4-state.

virtual task write(output uvm_status_e status,	  	
	input 	uvm_reg_addr_t 	offset,
	input 	uvm_reg_data_t 	value,	  	
	input 	uvm_path_e path	 = UVM_DEFAULT_PATH,
	input 	uvm_reg_map map = null,
	input 	uvm_sequence_base parent = null,
	input 	int prior = -1,
	input 	uvm_object extension = null,
	input 	string fname = "",
	input 	int lineno = 0

Is there some easy way how to change this without recreating my own tasks for write and read, please?

warnerrs
warnerrs
Full Access
120 posts
June 19, 2018 at 4:57 am

In reply to SilentB:

    object_id.write(status, wadd, outgoing, UVM_BACKDOOR);

Unfortunately, the register layer uses 2-state datatypes all over the place. In this case, the built-in uvm_mem::write task is defined as:

virtual task write(
   	output 	uvm_status_e 	status,	  	
   	input 	uvm_reg_addr_t 	offset,	  	
   	input 	uvm_reg_data_t 	value,	  	
   	input 	uvm_path_e 	path	 = 	UVM_DEFAULT_PATH,
   	input 	uvm_reg_map 	map	 = 	null,
   	input 	uvm_sequence_base 	parent	 = 	null,
   	input 	int 	prior	 = 	-1,
   	input 	uvm_object 	extension	 = 	null,
   	input 	string 	fname	 = 	"",
   	input 	int 	lineno	 = 	0
)

Where uvm_reg_data_t is 2-state, so you can't pass an X or Z through this API. I guess the thinking goes that X's or Z's are protocol specific, and so should be abstracted. Not sure I agree with that.

Since it appears you are trying to leverage the string based hdl_paths stored in your model here for your backdoor, you might consider directly using get_full_hdl_path() and uvm_hdl_deposit() instead. Those are the methods used internally to implement the backdoor. See uvm_mem::backdoor_write() for the details.

chr_sue
chr_sue
Full Access
3208 posts
June 19, 2018 at 5:08 am

In reply to warnerrs:

As I said, it seems to be an issue with the data types.
What you could try is to overwrite the write task.

© Mentor, a Siemens Business, All rights reserved www.mentor.com

Footer Menu

  • Sitemap
  • Terms & Conditions
  • Verification Horizons Blog
  • LinkedIn Group
SiteLock