Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > How to make a Data Object Alias that's reusable

Reply
Thread Tools

How to make a Data Object Alias that's reusable

 
 
Hoo87 Hoo87 is offline
Junior Member
Join Date: Jan 2010
Posts: 1
 
      01-27-2010
I am getting started on a design that will have many 2D arrays (13x32) in which about 50 data fields are packed. The arrays get transferred across 32-bit interfaces and stored to memory as 32-bit values, so it makes good sense to use a 2D array type for the object.

The data within that array is used as the individual fields, so it would be nice to use aliases to do the assignment and manipulation of the fields. However since there are lots (12 or so) of these arrays throughout the design, I'd need to define the 50 aliases in 12 different places, which becomes unwieldy.

My preference would be define a "record alias" in a package which could be applied to any 13x32 array. Then the definition would be in one place (so if it were to change, I'd only need to modify it in one place) and I'd be able to assign it on one line instead of 50.

I'd envision something like:
type SCD_ARRAY is array(12 downto 0) of STD_LOGIC_VECTOR(31 downto 0));
type RECORD_ALIAS_TYP is record
ADDR : STD_LOGIC_VECTOR(7 downto 0);
DATA : STD_LOGIC_VECTOR(7 downto 0);
. . .
end record;

variable IN_SCD_ARRAY : SCD_ARRAY;
variable OUT_SCD_ARRAY : SCD_ARRAY;
alias IN_SCD : RECORD_ALIAS_TYP is IN_SCD_ARRAY;
alias OUT_SCD : RECORD_ALIAS_TYP is OUT_SCD_ARRAY;
. . .
OUT_SCD.ADDR <= IN_SCD.ADDR + 1;

Obviously, "record aliases" don't exist (there would need to be some way to tie the record fields to the actual data object). Can anyone think of a way to do this (perhaps an alias to a pointer or an alias to an alias?).
Thanks,
Steve
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
alias: variable is an object but is not an object valtih1978 VHDL 1 07-17-2012 05:59 AM
reference/alias in perl vs reference/alias in C++ grocery_stocker C++ 9 05-24-2008 04:32 AM
XP X64 Pro, IE7, Delphi 2007, IntraWeb, MS Access, ODBC Alias problem: Insufficient memory for this operation. Alias: SomeDatabase. Skybuck Flying Windows 64bit 13 01-09-2008 07:34 PM
How to get reusable data access classes =?Utf-8?B?QmVybmllIEJlYXR0aWU=?= ASP .Net 0 09-13-2006 09:25 AM



Advertisments