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 IQ
      • Verification IP
      • Static-Based Techniques
      • Simulation-Based Techniques
      • Planning, Measurement, and Analysis
      • Formal-Based Techniques
      • Debug
      • 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)

      • Introduction to UVM
      • UVM Basics
      • Advanced 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.
    • Featured & On-Demand

      • Exploring Formal Coverage
      • Processor Customization
      • Interconnect Formal
      • Formal and the Next Normal
      • Formal Verification Made Easy
      • Data Independence and Non-Determinism
      • Exhaustive Scoreboarding
      • Visualizer Debug Environment
      • Webinar Calendar
    • On-Demand Library

      • SystemVerilog Assertions
      • Practical Flows for Continuous Integration
      • Continuous Integration
      • Questa Verification IQ
      • Avery & Siemens VIP
      • Protocol and Memory Interface Verification
      • HPC Protocols & Memories
      • Preparing for PCIe 6.0: Parts I & II
      • High Defect Coverage
      • SoC Design & Functional Safety Flow
      • Complex Safety Architectures
      • All On-Demand Recordings
    • Recording Archive

      • Lint vs Formal AutoCheck
      • FPGA Design Challenges
      • Design Solutions as a Sleep Aid
      • Fix FPGA Failures Faster
      • CDC and RDC Assist
      • The Dog ate my RTL
      • Questa Lint & CDC
      • Hierarchical CDC+RDC
      • Improving Initial RTL Quality
      • CDC Philosophy
      • Hardware Emulation Productivity
      • The Three Pillars of Intent-Focused Insight
      • All Webinar Topics
    • Conferences & WRG

      • 2022 Functional Verification Study
      • Improving Your SystemVerilog & UVM Skills
      • Automotive Functional Safety Forum
      • Aerospace & Defense Tech Day
      • Siemens EDA Functional Verification
      • Industry Data & Surveys
      • DVCon 2023
      • DVCon 2022
      • DVCon 2021
      • Osmosis 2022
      • All Conferences
    • Siemens EDA Learning Center

      • EDA Xcelerator Academy(Learning Services) Verification Training, Badging and Certification
      • View all Xcelerator Academy classes
  • 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 IQ
      • Verification Horizons Blog
      • Technical Resources
    • Verification Horizons Publication

      • Verification Horizons - July 2023
      • Verification Horizons - March 2023
      • Verification Horizons - December 2022
      • Issue Archive
    • About Us

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

      • Learning @OneGlance (PDF)
      • SystemVerilog & UVM Classes
      • Siemens EDA Classes
Ask a Question
SystemVerilog
  • Home
  • Forums
  • SystemVerilog
  • Next Cycle Implication operator does not work

Next Cycle Implication operator does not work

SystemVerilog 6740
#assertion 48 next_cycle_implication... 1
UVM_LOVE
UVM_LOVE
Full Access
292 posts
June 09, 2023 at 1:45 am

Regarding of the next cycle implication operator, it defined as if expr1 is true then expr2 must be true at the next evaluation point.
expr1 |=> expr2;

I'm trying to use next cycle implication operator in my example assertion.

property ncio_p
@(posedge clk)
  ~a |=> a;
endproperty
 
check01 : assert property (ncio_p);

But I got the error

this is my testbench for test of assertion.

timescale 1ns/1ps
 
module ex3;
reg clk;
reg reset;
reg  a; 
reg  b;      
 
initial begin
reset = 1;   
 
#11;    
 
reset = 0;   
 
 
 
end          
 
 
 
initial begin                                                       
clk = 0;                                                            
a= 0;                                                               
 
#13 a = 0;                                                          
#0  a = 1;                                                          
#2  a = 0;                                                          
#2  a = 1;                                                          
#2  a = 0;                                                          
#2  a = 1;                                                          
#2  a = 0;                                                          
#2  a = 1;                                                          
#2  a = 0;                                                          
end          
 
initial begin
b = '0;      
#13 b = 0;   
#2  b = 0;   
#1  b =1;    
#3  b =1;    
#1  b =1;    
#1  b =1;    
#1  b =1;    
#1   b = 0;  
 
end
 
always #1 clk = ~clk;
 
property cycle_delay_repetition_range;
@(posedge clk) disable iff (reset)
  ~a |=> a;
endproperty
 
check08 : assert property (cycle_delay_repetition_range);

But I got assert fail. Could you let me know what am I supposed to do to resolve this fail?

Replies

Log In to Reply

Solution

Solution

OE93
OE93
Full Access
10 posts
June 09, 2023 at 6:59 am

In reply to UVM_LOVE:

Quote:

#1 a = 0;
#1 a = 0;

you assert that every time a=0 it will be '1 in the next posedge, but you provide sequence that caused a to be '0 the next posedge.

BTW, do you have initial block for clk? does clk toggle at all?

best of luck

ben@SystemVerilog.us
ben@SystemVerilog.us
Full Access
2880 posts
June 09, 2023 at 10:41 am

In reply to UVM_LOVE:
Your testbench approach needs strong reconsiderations.
I suggest that you read my reply to this question:
Got this question:
Q: I need your advice in getting started with verification with systemverilog. I 've built various projects using Verilog and they was FPGA and ASIC synthesizable. what I need now is a road map that get me started with verification for example SVA , UVM and SV testbenches

A: To better respond to this question I am attaching a file that addresses the build of a verification plan, quick-and dirty partition testing, a reference to my co-author Srinivasan Venkataramanan on UVM, SVA and learning SVA.
I welcome comments from this community.
FIle also at https://lnkd.in/gUVNrWa6
That link is a pdf file.

Ben Cohen

Link to the list of papers and books that I wrote, many are now donated.
http://systemverilog.us/vf/Cohen_Links_to_papers_books.pdf
or https://rb.gy/ibks5p

Getting started with verification with SystemVerilog
https://rb.gy/f3zhh

UVM_LOVE
UVM_LOVE
Full Access
292 posts
June 09, 2023 at 4:16 pm

In reply to OE93:

thanks I update some test initial sequence about 'a'.
as you see, 'a' has to change as '1' after disable period.
then the assertion is working I though. but problem is that assertion check in disable period.
so the assertion fail has propagated to non disable period.

I though that SVA does not sample in the disable period. but I SVA sampled the signal even in the disable period.

would you please let me know more detail about why time 13NS assertion has failed?
What am I supposed to do?

UVM_LOVE
UVM_LOVE
Full Access
292 posts
June 09, 2023 at 6:17 pm

In reply to ben@SystemVerilog.us:

Hi Ben,
Now I'm reading your attached documents, So I think your are trying to tell me about SVA testbench must be conducted on non-blocking domain. so my blocking test sequence in initial statement is wrong.

Please correct me if I wrong.

ben@SystemVerilog.us
ben@SystemVerilog.us
Full Access
2880 posts
June 09, 2023 at 8:04 pm

In reply to UVM_LOVE:
.."SVA testbench must be conducted on non-blocking domain. "
[Ben] Not quite. However, typically, signals are assigned nonblocking and occur in the NBA region. Doing a #10 a=1; with posedge(clk) changing at t is same time when "a" changes can be problematic. It is also not stylist, though it should work; this is because within a time step signals used in an assertin are sampled in the Preponed region with the value just before the time step. What would be better is to do something like
@(posedge clk) a=1; // or a <=1;
Assertion sample signals in the Preponed region
See my paper 3) Understanding Assertion Processing Within a Time Step (Horizons Feb 27, 2023 issue)
https://systemverilog.us/vf/Understanding_assertion_processing.pdf
This paper goes into detail about how evaluation regions should be handled by a simulator as described in the SystemVerilog LRM; this should give you a better understanding of how assertions work.

// I do the following: 
initial begin
    $dumpfile("dump.vcd"); $dumpvars;
    bit v_a, v_b, v_err;
    repeat (200) begin
      @(posedge clk);
      if (!randomize(v_a, v_b, v_err) with {
        a  dist {1'b1 := 1, 1'b0 := 1}; // *****CAN USE signal a 
        // a changes in the Active region ************ OK 
        v_b   dist {1'b1 := 1, 1'b0 := 2};
        v_err dist {1'b1 := 1, 1'b0 := 15};
      }) `uvm_error("MYERR", "This is a randomize error");
 
      if(v_err==0) b<=v_b; else b<=!v_b; 
       // b changes in the NBA region  ****************
    end
    $finish;
  end
OE93
OE93
Full Access
10 posts
June 10, 2023 at 3:45 pm

In reply to UVM_LOVE:
Look, I'm not a SVA expert at all, and it's so embarrassing to even open my mouth when Ben is also responding to you...
But in general I have two basic recommendations:
1) Add prints that describe the situation when the assert fails:
asset () else $error("expect that a = ... but a = %b, b = %b, time = %t", a,b,$time);
2) Write a property with arguments, and send arguments when you assert:
property check(clk,a)
....
endproperty

assert property (c,x) else $error(..);
here c = clk and x = a.

ben@SystemVerilog.us
ben@SystemVerilog.us
Full Access
2880 posts
June 10, 2023 at 4:06 pm

In reply to OE93:

Quote:
In reply to UVM_LOVE:
Look, I'm not a SVA expert at all, and it's so embarrassing to even open my mouth when Ben is also responding to you...
But in general I have two basic recommendations:
1) Add prints that describe the situation when the assert fails:
asset () else $error("expect that a = ... but a = %b, b = %b, time = %t", a,b,$time);

[Ben] You need the $sampled
asset property () else 
$error("expect that a = ... but a = %b, b = %b, time = %t", 
         $sampled(a),$sampled(b),$realtime);


Quote:
2) Write a property with arguments, and send arguments when you assert:
property check(clk,a)....endproperty
assert property (c,x) else $error(..);
here c = clk and x = a.

Unless you see the need for reuse, which is usually rare, I do not use arguments because they make the assertion hard to read. For me, I have to mentally convert the formal arguments to the actual arguments while I am composing or reading an assertion.
Sorry, it gives me mental "fatigue!"
:)
Ben
UVM_LOVE
UVM_LOVE
Full Access
292 posts
June 11, 2023 at 12:26 am

In reply to ben@SystemVerilog.us:

Hi ben,

I'm trying to understand the behavior of disable iff. so I make one another example.

`timescale 1 ns / 1 ns
 
module MUX       
(                
  input wire       CLOCK  ,
  input wire [3:0] IP1    ,
  input wire [3:0] IP2    ,
  input wire [3:0] IP3    ,
  input wire       SEL1   ,
  input wire       SEL2   ,
  input wire       SEL3   ,
  output reg [3:0] MUX_OP  
) ;              
 
always @(posedge CLOCK)
  if (SEL1 == 1) 
    MUX_OP <= IP1 ;   
  else if (SEL2 == 1) 
    MUX_OP <= IP2 ;   
  else if (SEL3 == 1) 
    MUX_OP <= IP3 ;   
 
property mux_p1;             
@(posedge CLOCK)             
  $rose(SEL1) |=> ( IP1==MUX_OP);
endproperty                  
 
property mux_p2;             
@(posedge CLOCK)             
  if (!$isunknown(SEL1))
    $rose(SEL1) |-> (IP1== MUX_OP);
 
endproperty     
 
check00 : assert property (mux_p1);
check01 : assert property (mux_p2);
 
 
endmodule
 
`timescale 1 ns / 1 ns                                                            
 
module T_MUX ;                                                                    
 
  parameter PERIOD = 10 ;                                                         
 
  reg        CLOCK  ;                                                             
  reg [3:0]  IP1    ;                                                             
  reg [3:0]  IP2    ;                                                             
  reg [3:0]  IP3    ;                                                             
  reg [2:0]  SEL    ;                                                             
  wire [3:0] MUX_OP ;                                                             
 
 
  MUX MUX1                                                                        
  (                                                                               
    .CLOCK  ( CLOCK  ),                                                           
    .IP1    ( IP1    ),                                                           
    .IP2    ( IP2    ),                                                           
    .IP3    ( IP3    ),                                                           
    .SEL1   ( SEL[0] ),                                                           
    .SEL2   ( SEL[1] ),                                                           
    .SEL3   ( SEL[2] ),                                                           
    .MUX_OP ( MUX_OP )                                                            
  ) ;                                                                             
 
  always                                                                          
    begin                                                                         
      CLOCK <= 0 ;                                                                
      #(PERIOD/2) ;                                                               
      CLOCK <= 1 ;                                                                
      #(PERIOD/2) ;                                                               
    end                                                                           
 
  initial                                                                         
    begin : TEST                                                                  
      integer i ;                                                                 
      @(posedge CLOCK);                                                           
      #(PERIOD/4); // Keep changes away from clock edges                          
      IP1 <= 4'b0001 ;                                                            
      IP2 <= 4'b0010 ;                                                            
      IP3 <= 4'b0100 ;                                                            
 
      $display ("Starting 1st set of test vectors.");                             
 
      for (i=0; i<=2; i=i+1)                                                      
        begin                                                                     
          SEL <= 1<<i ;                                                           
          #(PERIOD) ;                                                             
        end                                                                       
 
      for (i=0; i<=7; i=i+1)           
        begin                          
          SEL <= i ;                   
          #(PERIOD) ;                  
        end                            
 
      $display ("Finished 2nd set of test vectors.");
 
      $finish ;                        
    end                                
 
endmodule

I want to check MUX_OP has the same value of IP1 after unknown period.
So I generate 2 property.

property mux_p1;
@(posedge CLOCK)
$rose(SEL1) |=> ( IP1==MUX_OP);
endproperty

mux_p1 is pass but mux_p2 does not.

property mux_p2;
@(posedge CLOCK)
if (!$isunknown(SEL1))
$rose(SEL1) |-> (IP1== MUX_OP);

endproperty

this Assertion has failed at time 15NS, How do I approach "disable iff" correctly?

Siemens Digital Industries Software

Siemens Digital Industries Software

#TodayMeetsTomorrow

Portfolio

  • Cloud
  • Mendix
  • Electronic Design Automation
  • MindSphere
  • Design, Manufacturing and PLM Software
  • View all Portfolio

Explore

  • Community
  • Blog
  • Online Store

Siemens

  • About Us
  • Careers
  • Events
  • News and Press
  • Customer Stories
  • Partners
  • Trust Center

Contact

  • VA - Contact Us
  • PLM - Contact Us
  • EDA - Contact Us
  • Worldwide Offices
  • Support Center
  • Give us Feedback
© Siemens 2023
Terms of Use Privacy Statement Cookie Statement DMCA