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

      • 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_RAL: Why Predictor calling bus2reg function(Adapter) 2 times automatically??

UVM_RAL: Why Predictor calling bus2reg function(Adapter) 2 times automatically??

UVM 5528
Mirrored values and... 4 RAL 52
raja.kuraku
raja.kuraku
Full Access
16 posts
April 21, 2016 at 2:59 am

Hi,

I am writing and reading from the register by using (write and read) methods in UVM Reg Model.
Write and read is happening perfectly. And I am printing the values in Adapter.
But when I am reading the register bus2reg is called twice and my read data is getting override by 0 second time.
So when I am comparing with the Mirrored Value getting Comparison Fail.

Please give your Suggestions.

Thanks,
Raja Sekhar.

Replies

Log In to Reply
chr_sue
chr_sue
Full Access
3224 posts
April 21, 2016 at 3:19 am

In reply to raja.kuraku:

Could you please provide some code regarding our environment, the test and the sequence you are starting for your test.

raja.kuraku
raja.kuraku
Full Access
16 posts
April 21, 2016 at 3:37 am

In reply to chr_sue:

Please find the attached Snippets

ENV Class:
 
Declaration : 	uvm_reg_predictor #(apb_seq_item) nvme_reg_predictor; 
 
   if (m_env_cfg.m_apb_agent_cfg.active == UVM_ACTIVE) begin
       reg2apb = apb_reg_adapter::type_id::create ("reg2apb");
	if (m_env_cfg.m_apb_rm.get_parent() == null) begin
	   m_env_cfg.m_apb_rm.apb_reg_top_block_map.set_sequencer (m_apb_agent.m_sequencer, reg2apb);
	end
		my_reg_predictor.map     = m_env_cfg.m_apb_rm.apb_reg_top_block_map;
		my_reg_predictor.adapter = reg2apb;
		m_env_cfg.m_apb_rm.apb_reg_top_block_map.set_auto_predict(0);
		m_apb_agent.m_monitor.apb_ap.connect(my_reg_predictor.bus_in);
   end

TEST Class:

	phase.raise_objection (this, "REG_Test started");
	  begin
		apb_reg_wr_rd_seq_h = apb_reg_wr_rd_seq::type_id::create("apb_reg_wr_rd_seq_h");
		apb_reg_wr_rd_seq_h.start (null);
		#100ns;
	  end 
	phase.drop_objection (this, "REG_Test finished"); 

Sequence Class:

   Declaration :
	apb_reg_top_block  model; 
	nvme_env_config    m_env_cfg; 
 
	uvm_reg_data_t     read_data;  
	uvm_reg_data_t     rd_data;
 
   [u]Task Body:[/u]
	write_reg(model.CAP_LOW,status,32'hFFFF_FFFF);
	read_reg(model.CAP_LOW,status,read_data);
	if(status == UVM_NOT_OK)
	  `uvm_error("REG_SEQUENCE","Status Is NOT OK During Read Operation")
	rd_data = model.CAP_LOW.get_mirrored_value();
 
	if(rd_data != read_data) begin
	  `uvm_error("APB_REG_SEQUENCE","^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
	  `uvm_error("APB_REG_SEQUENCE","^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
	  `uvm_error("APB_REG_SEQUENCE"," The Compared Value of Mirrored and Register Read is Wrong ")
	  `uvm_error("APB_REG_SEQUENCE","^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
	  `uvm_error("APB_REG_SEQUENCE","^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
	end
chr_sue
chr_sue
Full Access
3224 posts
April 21, 2016 at 5:45 am

In reply to raja.kuraku:

What is the access policy of that register? If it is WO reading back is OK.
If status is not OK, you are reading twice. See the code below:

read_reg(model.CAP_LOW,status,read_data);
if(status == UVM_NOT_OK)
`uvm_error("REG_SEQUENCE","Status Is NOT OK During Read Operation")
rd_data = model.CAP_LOW.get_mirrored_value();

raja.kuraku
raja.kuraku
Full Access
16 posts
April 21, 2016 at 6:45 am

In reply to chr_sue:

Thanks chr_sue for your response

Yes Its "RW" register.
And both the times the status is UVM_IS_OK.
There is no UVM_ERROR in my simulation.

chr_sue
chr_sue
Full Access
3224 posts
April 21, 2016 at 7:10 am

In reply to raja.kuraku:
I was just reading again your first entry. What does it mean read and write works perfectly.
bus2reg is not a register. It is a method. Maybe you have to look here for some more details.

Vinay Jain
Vinay Jain
Full Access
83 posts
April 21, 2016 at 1:43 pm

As per above code you have connected monitor to predictor,

possible call for bus2reg
1. wait for end event from req or if provide response is 1 then wait for driven to put response.

      bus_req.end_event.wait_on();
 
      if (adapter.provides_responses) begin
        uvm_sequence_item bus_rsp;
        uvm_access_e op;
        // TODO: need to test for right trans type, if not put back in q
        rw.parent.get_base_response(bus_rsp);
        adapter.bus2reg(bus_rsp,rw_access);
      end
      else begin
        adapter.bus2reg(bus_req,rw_access);
      end

2. When monitor see that register read, it also call bus2reg,

so you will see bus2reg get called twice if you have monitor connected to predictor.as you are using same adapter.

I suspect your read response transaction from monitor is not correct as you mentioned it is getting overriden by 0 2nd time.

Image from ClueLogic Post will give you clear picture :

chr_sue
chr_sue
Full Access
3224 posts
April 21, 2016 at 11:27 pm

In reply to Vinay Jain:

I'm not sure if this clarifies the problem raka has, because I'm nor sure if raka deals with responses. To state one thing: you do not need the call get_response. A read gives back the value by calling bus2reg, and a write calls reg2bus.
raka our adapter code would be of interest.

raja.kuraku
raja.kuraku
Full Access
16 posts
April 22, 2016 at 12:37 am

In reply to chr_sue:

My first entry "Reads works Perfectly" mean to say that.

Quote:
I am doing a register read operation and capturing the read_xtn in Monitor and writing to analysis port using write method. So whenever Monitor writes in to Analysis port bus2reg function will be called. In my condition bus2reg function is called by twice(Printing in Adapter). During first call read_data printing the read value and the second time printing '0'(Both times status is "UVM_IS_OK").

I tried to control using one variable setting in monitor and checking in adapter bus2reg function, Still during read the read data {.value(read_data)} is getting override.

SAI BOOTHKURI
SAI BOOTHKURI
Full Access
8 posts
October 14, 2017 at 3:36 am

In reply to raja.kuraku:

Hai i am also facing same issue u got any soulution for this.if u got expalin plz.

Bach Mai
Bach Mai
Forum Access
1 post
February 18, 2020 at 6:45 pm

Hi,

I think the bus2reg function is called twice because there are 2 components which call it: adapter and predictor. The second call doesn't 'override' the value, just because the predictor (monitor of agent) some how can't get the data. Could you check the connection between the predictor and the analysis port of monitor?

Regards,
Bach

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

Footer Menu

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