What is the purpose of the access system in VHDL:

P

parag_paul

Will allocating some memory for a varibale or a record type be any
different than dirtectly doing a declaration
like
a : array_word_record;

Why will I like to allocate something, Finally it is a variable I am
working on right
-Parag
 
K

KJ

Will allocating some memory for a varibale or a record type be any
different than dirtectly doing a declaration
like
a : array_word_record;
- Allocating memory is not synthesizable (that may not be a concern
depending on just why you're asking this)
- You'll be responsible for de-allocating memory.
Why will I like to allocate something,
One thing is that passing a large array or record or whatever will use
up much more stack space if you have to pass this thing to a function
or procedure whereas passing a pointer will only pass the pointer on
the stack.

In short, whether you choose to allocate memory and work with pointers
or directly declare an object boils down to the same tradeoffs that
you have in any language where a design decsion needs to be made about
passing things by value or by reference.
Finally it is a variable I am
working on right
-Parag
Yes

Kevin Jennings
 
P

Paul Uiterlinden

Will allocating some memory for a varibale or a record type be any
different than dirtectly doing a declaration
like
a : array_word_record;

Why will I like to allocate something, Finally it is a variable I am
working on right

Except the amount of data is fixed at elaboration time.

If you do not know in advance how much data is needed, you can either declar
an array that is "big enough", wasting memory in most of the cases and
causing an error if more data is needed.

Or you can dynamically (at run time) allocate data, growing and shrinking as
needed.

All this of course is not synthesisable. It is frequently used in
verification code.

One example that comes to mind is a model of a RAM (say 2 GByte). Memory is
allocated only for those cells (or rows or columns) that are written. If
this was not done, the model probably would consume all workstation (or PC)
memory and your simulator would die.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top