JP LM Posted September 30, 2014 Report Share Posted September 30, 2014 Hello everyone, I want to select package depending of parameter. I have the same parameters which different value in this two packages : pkg_std, pkg_a. And I would like to select the good one depending of the mode A I don't know if it's possible. Modelsim get an error on this : Parameter A = 0; if(!A)begin import pkg_std::*;endelsebegin import pkg_a::*;end It s seems a conflict between the two packages, because all parameters declared into the package are "undefined variable". I'm curious if you have already to attempt this? Let me know, please. Thanks a lot. Bye, JP LM Quote Link to comment Share on other sites More sharing options...
dave_59 Posted September 30, 2014 Report Share Posted September 30, 2014 The import statement only makes symbols visible inside the scope of the import. Your import statement is inside a generate block and does not make symbols visible after the generate. If you need to select this package globally, it might be better to have two different versions of the same package compiled into separate libraries. Then just select the library you want at compilation time. If the package only contains parameter values, then you might consider using a structure or class type as a container for your parameters instead of a package. karandeep963, ksiddav and aditya1vlsi 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.