• 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 enumerate the fields of all the registers in vr_...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 66
  • Views 14920
  • 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 enumerate the fields of all the registers in vr_ad_reg_file

FlyingHeart
FlyingHeart over 11 years ago

I need to do a full read/write/softreset test on register module and need to enumerate the fields of all the registers, but I checked the help documents and didn't find the solution. Could anyone tell me how to enumerate that?

  • Cancel
Parents
  • StephenH
    StephenH over 11 years ago

    You need first to declare all your registers using the reg_def macro. Have a look at the examples under `sn_which.sh vr_ad`/examples/ directory. The file vr_ad_reg_def_example.e would be a good starting point.

    You will see a number of lines like this:

    reg_def  VR_AD_TX_MODE  XCORE  8'h01 {
       reg_fld resv       : uint(bits:4) : RW : 0;                    // bits[7:4]
       reg_fld frame_kind : vr_ad_tx_mode_frame_kind : RW : A : cov;  // bits[3:2]
       reg_fld dest       : uint(bits:2) : RW : 0;                    // bits[1:0]
    };

     
    reg_def declares the register itself, and reg_fld enumerates the fields of the register from MSB down to LSB, as per the comments. You can use any numeric type to declare the fields, including enumerated types.

    As for the read/write/reset tests, vr_ad supplies a number of sequences that do this, either on a whole reg file or a user-defined subset. Take a look at vr_ad_reg_sequence_lib.e to see how the sequences are defined and how to use them. You can copy these and edit them if they don't do exactly what you want.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • StephenH
    StephenH over 11 years ago

    You need first to declare all your registers using the reg_def macro. Have a look at the examples under `sn_which.sh vr_ad`/examples/ directory. The file vr_ad_reg_def_example.e would be a good starting point.

    You will see a number of lines like this:

    reg_def  VR_AD_TX_MODE  XCORE  8'h01 {
       reg_fld resv       : uint(bits:4) : RW : 0;                    // bits[7:4]
       reg_fld frame_kind : vr_ad_tx_mode_frame_kind : RW : A : cov;  // bits[3:2]
       reg_fld dest       : uint(bits:2) : RW : 0;                    // bits[1:0]
    };

     
    reg_def declares the register itself, and reg_fld enumerates the fields of the register from MSB down to LSB, as per the comments. You can use any numeric type to declare the fields, including enumerated types.

    As for the read/write/reset tests, vr_ad supplies a number of sequences that do this, either on a whole reg file or a user-defined subset. Take a look at vr_ad_reg_sequence_lib.e to see how the sequences are defined and how to use them. You can copy these and edit them if they don't do exactly what you want.

     

    • 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