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
SystemVerilog
  • Home /
  • Forums /
  • SystemVerilog /
  • $psprintf -vs- $sformatf ??

$psprintf -vs- $sformatf ??

SystemVerilog 4879
cliffc
cliffc
Full Access
9 posts
March 20, 2011 at 11:28 pm

Hi, All -

There are many references to $psprintf on this forum and two references in the OVM Reference Guide, even though the SystemVerilog committee rejected the standardization of $psprintf since the language already had $sformatf. A quick search shows that both are used two times each in the reference guide.

Has $psprintf become a defacto standard command in all of the simulators?

Is it treated exactly the same as $sformatf?

Regards - Cliff Cummings
Verilog & SystemVerilog Guru
Sunburst Design

Replies

Log In to Reply
dave_59
dave_59
Forum Moderator
8443 posts
March 21, 2011 at 8:42 am

Cliff,

The reality is that once a simulator vendor implements a feature, it's almost impossible to get them to remove it, regardless of what happens in the IEEE standard committee. The only time I see a feature removed is when you can prove that the existence of a feature causes problems for the user (e.g. conflicts with proper implementation of that feature, like generate). Apparently, having code that is not portable is not a problem for some users.

Dave

— Dave Rich, Verification Architect, Siemens EDA

cliffc
cliffc
Full Access
9 posts
March 31, 2011 at 4:13 pm

'Tis true. Still, it would be nice if the OVM/UVM documentation used just one or the other. Thanks, Dave.

Regards - Cliff

raysalemi
raysalemi
Full Access
16 posts
February 14, 2013 at 2:48 pm

They are identical though, right?

Ray

dave_59
dave_59
Forum Moderator
8443 posts
February 19, 2013 at 8:24 am

In reply to raysalemi:

They are spelled with different sets of letters.

— Dave Rich, Verification Architect, Siemens EDA

NaveenReddy
NaveenReddy
Full Access
14 posts
October 05, 2019 at 10:46 pm

Why is the output different for both of these prints? I could roughly give a guess for what could be happening with the sformatf - (might be printing integer values of the string it generated) it would be better if someone could give a concrete explanation for me.
Also, simulator throws something like below. Am I missing some point for the sformatf ??
Warning-[STASKW_SFRTMATR] More arguments than required
testbench.sv, 12
Number of arguments (9) passed to place in the format string are more than
the number of format specifiers (1).

module tb;
  initial begin
    string sfrmt, psprnt;
    psprnt = $psprintf("%0s\n", "",
                  "row    : %08x\n", 5,
                  "col    : %08x\n", 6,
                  "addr   : %08x\n", 7,
                  "cmd    : %0s\n", "cmd");
    $display(psprnt);
    //output
    //row    : 00000005
    //col    : 00000006
    //addr   : 00000007
    //cmd    : cmd
    sfrmt = $sformatf("%0s\n", "",
                  "row    : %08x\n", 5,
                  "col    : %08x\n", 6,
                  "addr   : %08x\n", 7,
                  "cmd    : %0s\n", "cmd");
    $display(sfrmt);
    //output - random big numbers
    //2321025888408877083000271174924298          52016786340018993991845306433042442          
    //61975347634275872380922925474674698          7 7877442999272995673474881057546 6516068
  end
endmodule
cgales
cgales
Forum Moderator
1547 posts
October 06, 2019 at 5:15 am

In reply to ven@pdx.edu:

As was discussed in the previous replies in this thread, $psprintf is not in the SystemVerilog LRM. Implementation may differ between simulators and it may not even be supported in some simulators.

Per the LRM, $sformat has the following signature:

variable_format_string_output_function ::= $sformatf ( format_string [ , list_of_arguments ] )

Your code doesn't follow this signature

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

Footer Menu

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