a problem about VHDL programming puzzles me

H

hezhang

My implementation needs N block RAMs, where N is not a constant, but
rather a variable.
That is, if N=5, then only 5 block RAMs are needed; but if N=20, then
20 block RAMs needed.
I want to manage these block RAMs and the signals connected with them
dynamically. That means, every time I changed N, no change is needed to
change the VHDL source code. Like C/C++, we can allocate mem[N][K],
then we can access to mem[j] flexibly. How can I do in VHDL?
Is anyone who can help me?
Thank you
 
M

Mike Treseler

hezhang said:
I want to manage these block RAMs and the signals connected with them
dynamically. That means, every time I changed N, no change is needed to
change the VHDL source code. Like C/C++, we can allocate mem[N][K],
then we can access to mem[j] flexibly. How can I do in VHDL?


Do one design for the worst case.

If that doesn't fit, you can
save multiple designs in flash
and then have the cpu download
the one that the user needs to the FPGA.


-- Mike Treseler
 
A

Allan Herriman

hezhang said:
I want to manage these block RAMs and the signals connected with them
dynamically. That means, every time I changed N, no change is needed to
change the VHDL source code. Like C/C++, we can allocate mem[N][K],
then we can access to mem[j] flexibly. How can I do in VHDL?


Do one design for the worst case.

If that doesn't fit, you can
save multiple designs in flash
and then have the cpu download
the one that the user needs to the FPGA.


I thought by "dynamically," he meant "at compile time" or perhaps "at
elaboration time." This is known as "locally static" or "globally
static" in VHDL parlance.

The result should be easy to achieve using generics.

Regards,
Allan
 
H

hezhang

Thank you for all the above reply!
Yes, I found "generate" solved the problem. I don't need to allocate
the max number of block RAMs for the worst case at the begging, but can
allocate variable number of block RAMs during each synthesis time
(scalable structure). That is what I want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top