• 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. referring to an enumerated type value from another e pa...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 65
  • Views 12965
  • 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

referring to an enumerated type value from another e package

avidane
avidane over 15 years ago

Hi,

If a type t1 is defined in a single package I can do something like this:

type t1 : [A, B];

extend sys {

   l[2] : list of bit;

   run() is also {

     l[t1'A.as_a(uint)] = 1;

     l[t1'B.as_a(uint)] = 0;

  }

};

But what happens if t1 is defined in more then one package, and I have to qualify the type name with a pacakge name?

The following doesn't compile...

------------

package p1;

type t1 : [A, B];

------------

package p2;

type t1 : [C, D];

 -----------

package p3;

extend sys {

   l[2] : list of bit;

   run() is also {

     l[p1::t1'A.as_a(uint)] = 1;

     l[p1::t1'B.as_a(uint)] = 0;

  };

};

 

Thanks,

Avidan Efody

 

 

     

 

 

 

  • Cancel
  • StephenH
    StephenH over 15 years ago

    Hi Avidan.

    I've not come across this requirement before! It looks like perhaps the parser is treating the package qualifier "pkg1::" as less tightly bound than the enum tag 'A.

    I guess a quick and dirty workaround is to use an intermediate variable of the right type:

    <'
    package p3;
    import pkg1.e;
    import pkg2.e;


    extend sys {

    l[2] : list of bit;

    run() is also {
    var i : p1::t1;
    i = A;
    l[i.as_a(uint)] = 1;
    i = B;
    l[i.as_a(uint)] = 0;
    };

    };
    '>

     

    • 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