What is the purpose of the access system in VHDL:

  • Thread starter parag_paul@hotmail.com
  • Start date
P

parag_paul@hotmail.com

Guest
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
 
On Sep 21, 7:16 am, "parag_p...@hotmail.com" <parag_p...@hotmail.com>
wrote:
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
 
parag_paul@hotmail.com wrote:

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.

--
Paul Uiterlinden
www.aimvalley.nl
e-mail addres: remove the not.
 

Welcome to EDABoard.com

Sponsor

Back
Top