Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

assigning values to generics

Status
Not open for further replies.

shredzone

Programmer
Jan 30, 2007
4
0
0
CA
I am new to VHDL. When instantiating a component I need
to assign a value to the generic which depends on another
generic parameter declared in the entity.
Is some form of conditional assignment possible for generics?

I hope the above makes sense.
 
shredzone,

Interesting question. I've never done something like this before, that is that I can remember at this time.

However I think it is possible to pass a generic value to a lower hierarchy component by making an expression based on other generics.
I guess the only limitation is that you should limit the operators to those that or supported by the generic type (e.g. natural, integer, std_logic, ...).
Also you should make sure you have the required packages (ieee libs) included.

I guess this should work, but the only way to do this is to try it.

Something I do know is that simulators, like modelsim tend to have problems when you use expressions in the port or generic map, so if you want to simulate the code you will need to take a detour via a extra generic or signal.
But this is an issue of the simulator and not of the language.

regards,

jeandelfrigo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top