• 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. Generate an index to an ungeneratable list of struct

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 65
  • Views 14777
  • 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

Generate an index to an ungeneratable list of struct

Yanir
Yanir over 8 years ago

Hi,

How do i generate an index to a list of struct with constraints.

For example i have the following struct and list:

struct se_cte_free_mem_area_s
{
!address_start : u64_t;
!address_end : u64_t;

area_size : u64_t;

...

};

!free_mem_areas : list of se_cte_free_mem_area_s;

and i want to generate on the fly an index to the list with constraint (For example where  address_start <= address_x <= address_end)?

Thanks,

Yanir.

  • Cancel
  • StephenH
    StephenH over 8 years ago
    Do the ranges of start...end overlap or is free_mem_areas[0].address_start always the lowest address and free_mem_areas[free_mem_areas.size()-1].address_end always the highest?

    Note that recent versions of Specman have support for a "set" datatype so you can model your start...end addresses as a list of sets and constrain the index to be within that list. Look at "The set type" in the Specman e user's guide. Here's an example from the docs which illustrates the idea.

    struct s {
    foo() is {
    var s1: set;
    var s2: set = [3..7, 10..13]
    print 5 in s2; // prints TRUE
    print 8 in s2; // prints FALSE
    s1 = s2; // s1 is [3..7, 10..13]
    s2 = [4..5]; // s1 is not changed
    print s1 in s2; // prints FALSE
    print s2 in s2; // prints TRUE
    var x: int;
    gen x keeping {it in value(s2)}; // x may become 4 or 5
    };
    };


    Note also that if you're doing address management, vr_ad has excellent support for allocating memory ranges (programmatically or randomly). If you're interested, PM me your corporate email address and I'll send you a copy of a tutorial that I wrote on the subject.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Yanir
    Yanir over 5 years ago in reply to StephenH

    Hi,
    I would like to receive a tutorial on vr_ad. My corporate email is yanir.davidzada@intel.com

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Efrat
    Efrat over 5 years ago in reply to Yanir

    hi, Yanir.

    sending you the material, to your email

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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