What is the purpose of the access system in VHDL:

Discussion in 'VHDL' started by parag_paul@hotmail.com, Sep 21, 2007.

  1. 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
     
    , Sep 21, 2007
    #1
    1. Advertising

  2. KJ Guest

    On Sep 21, 7:16 am, "" <>
    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
     
    KJ, Sep 21, 2007
    #2
    1. Advertising

  3. 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.
     
    Paul Uiterlinden, Sep 21, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ali
    Replies:
    1
    Views:
    360
    Egbert Nierop \(MVP for IIS\)
    Jan 29, 2004
  2. ik
    Replies:
    6
    Views:
    492
    Shawn B.
    Jul 16, 2004
  3. ik
    Replies:
    8
    Views:
    440
    Mikhail Arkhipov (Microsoft)
    Jul 9, 2004
  4. afd
    Replies:
    1
    Views:
    8,555
    Colin Paul Gloster
    Mar 23, 2007
  5. chanson
    Replies:
    2
    Views:
    724
    chanson
    Sep 30, 2009
Loading...

Share This Page