• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. how to force the variables inside a class? i'm facing this...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 65
  • Views 3872
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to force the variables inside a class? i'm facing this error "FOAUTO"

chetan somana
chetan somana over 1 year ago

My intention is to force variables inside a class of type uvm_component. But as I cannot show that confidential code, i'm trying to replicate a similar code.

Here i'm able to force the variable j inside the module main but unable to do a force on the variable num which is inside class example.

i tried to change the scope, but the simulator always throws "*E,FOAUTO: Invalid way of setting automatic variable:"

what is a valid way to force the variables inside the class. I've read the document on the force, but it mentions about verilog/vhdl objects. 

  • Cancel
Parents
  • tpylant
    tpylant over 1 year ago

    Can you show how you're trying to force obj.num and monitoring the value of obj.num?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chetan somana
    chetan somana over 1 year ago in reply to tpylant

    I have shown how im forcing the module variable and class variable. Not sure if I had answered the later question.

    My original test has many nested blocked inside a case and endcase block; My intention is to save time by forcing desired value of the case so I can just resimulate using reset instead of complile and simulate. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tpylant
    tpylant over 1 year ago in reply to chetan somana

    I had to make num a static variable to be able to force it.

    class example;
      static rand int num;
    endclass

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • StephenH
    StephenH over 1 year ago in reply to tpylant
    xcelium> force ci.b = 1

    xmsim: *E,FOAUTO: Invalid way of setting automatic variable: m.ci.b.

    Extended help:

    % xmhelp xmsim FOAUTO

    xmhelp: 24.01-a071: (c) Copyright 1995-2024 Cadence Design Systems, Inc.

    xmsim/FOAUTO =

    A force, release or delayed deposit command cannot be used on

    an automatic variable.  Automatic variables are Verilog variables

    declared in a class, automatic task or function.

    (Default severity: 'E')
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • chetan somana
    chetan somana over 1 year ago in reply to tpylant

    Now I can force on the static variables used in the verification environment. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • chetan somana
    chetan somana over 1 year ago in reply to tpylant

    Now I can force on the static variables used in the verification environment. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information