10-26-2013 01:30 AM
are you trying to select a memory instantiation based on the address?
10-26-2013 06:48 AM - edited 10-26-2013 08:58 AM
The mem64.vhd contains a generate statements. A generate statement must have a static (fixed) condition. You are using an input "addre" in the IF condition which is not static. Change this to a constant (static) to overcome the error.
Use the attached file and check if that helps.
10-27-2013 10:06 PM
address cannot be taken as a constant in this logic coz it the input based on which the 16x4 memory instantiation is selected
Then you can't use generate in this context. You have to implement actual hardware if you need run time control. For generate all control must be resolved by elaboration time.
10-27-2013 10:16 PM
Just to add one more point we usually will have a memory with fixed address lines in hardwre and your entity address range is also fixed, when you want to change it you will eventually rerun the implementation.
So you may use local declaration i= address range(64) and run the generate statement.
Change it when ever your address lines width changes.
Hope this helps.
10-27-2013 11:00 PM
I used generic and it worked fine. In such a case you can send its value from top level instatiation. Check if that meets your need.