Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - multiD-vhdl: Multi Dimensional Arrays (allowing generics on each dimension) for VHDL (including ports)

 
Thread Tools Search this Thread
Old 03-20-2006, 11:36 PM   #1
Default multiD-vhdl: Multi Dimensional Arrays (allowing generics on each dimension) for VHDL (including ports)


-- multiD-vhdl: Multidimensional Array (allowing generics) for VHDL
-- ================================================== ==============
-- Version 1.0 (20 March 2006)



-- *** Package Purpose:
-- Multidimensional Arrays with complete control of every dimension;
-- allowing every dimension to be specified with generics
-- (especially useful for multi-dimensional parametizable ports)

-- *** How is it implemented?
-- As a 1-dimensional array, that is treated as a multi-dimensional
-- array


-- *** Why?
-- VHDL (VHSIC Hardware Description Language) lacks the possiblity
-- to define multidimensional arrays for ports,
-- ###where each dimension can be kept generic###.

-- It was not possible (with normal VHDL) to have multiple instances of
-- an entity,
-- ###where each instance can have different generics for each
-- dimension###.

-- This can be solved with this VHDL package (with functions), that
-- allows a 1D array to be treated as a multidimensional array.


-- *** Is it synthesizable?
-- Yes: has been tested on Synplify 8.5 (tested entity: generic MUX)




Get it here:
http://stud4.tuwien.ac.at/~e0425408/...ultiD-vhdl.zip

License:
LGPL


Comments, Suggestions welcome




=============================================
Albert Neumüller
21 March 2006
=============================================








-------------------------------------------------------------------------------
-- QUICK Usage Examples:
-- Requires fixed-width font (courier, etc.)
--
-- 1. Initializtion
--
-- Example: 3D - array
-- --we want: %%% (0 to 6, 4 downto 2, 1 to %%% -------->
--
-- constant dim_info : DD_dimensions := (0, 6, 4, 2, 1, ;
-- -- |--| |--| |--|
-- -- dim0 dim1 dim2
--
-- signal arr3D : std_logic_vector(DD_zero to
DD_calc_size(dim_info)-1);
--
--
-- 2. Accessing sub-parts of the multiD (multi-dimensional) array:
--
-- Example:
-- signal result : std_logic_vector(1 to ;
--
-- --we want: %%% result <= arr3D(3 to 3, 2 to 2, 1 to %%%
-------->
--
-- result <= DD_slice(dim_info, (3, 3, 2, 2, 1, , arr3D);
-- -- |--| |--| |--|
-- -- dim0 dim1 dim2
--
--
-- 2. Accessing sub-parts of the multiD array:
--
-- Example:
-- variable assign_v : std_logic_vector(7 downto 0);
--
-- --we want: %%% arr3D(3 to 3, 2 to 2, 1 to <= assign_v;
--
-- DD_assign2slice(dim_info, (3, 3, 2, 2, 1, , arr3D, assign_v);
-- -- |--| |--| |--|
-- -- dim0 dim1 dim2



albert.neu@gmail.com
  Reply With Quote
Old 03-20-2006, 11:40 PM   #2
albert.neu@gmail.com
 
Posts: n/a
Default Re: multiD-vhdl: Multi Dimensional Arrays (allowing generics on each dimension) for VHDL (including ports)
-- *** Why?
-- VHDL (VHSIC Hardware Description Language) lacks the possiblity
-- to define multidimensional arrays for ports,
-- ###where each dimension can be kept generic### & where it is
synthesizable.

-- It was not possible (with normal VHDL) to have multiple instances of
-- an entity,
-- ###where each instance can have different generics for each
-- dimension### & syntheziable.


=============================================
Albert Neumüller
21 March 2006
=============================================



albert.neu@gmail.com
  Reply With Quote
Old 03-21-2006, 04:05 PM   #3
Jim Lewis
 
Posts: n/a
Default Re: multiD-vhdl: Multi Dimensional Arrays - see VHDL-2006
Albert,
Fortunately arrays of unconstrained arrays will
be a supported feature of the Accellera VHDL-2006 revision.
Make sure your vendors know that you want it supported.

Cheers,
Jim

> -- multiD-vhdl: Multidimensional Array (allowing generics) for VHDL
> -- ================================================== ==============
> -- Version 1.0 (20 March 2006)
>
>
>
> -- *** Package Purpose:
> -- Multidimensional Arrays with complete control of every dimension;
> -- allowing every dimension to be specified with generics
> -- (especially useful for multi-dimensional parametizable ports)
>
> -- *** How is it implemented?
> -- As a 1-dimensional array, that is treated as a multi-dimensional
> -- array
>
>
> -- *** Why?
> -- VHDL (VHSIC Hardware Description Language) lacks the possiblity
> -- to define multidimensional arrays for ports,
> -- ###where each dimension can be kept generic###.
>
> -- It was not possible (with normal VHDL) to have multiple instances of
> -- an entity,
> -- ###where each instance can have different generics for each
> -- dimension###.
>
> -- This can be solved with this VHDL package (with functions), that
> -- allows a 1D array to be treated as a multidimensional array.
>
>
> -- *** Is it synthesizable?
> -- Yes: has been tested on Synplify 8.5 (tested entity: generic MUX)
>
>
>
>
> Get it here:
> http://stud4.tuwien.ac.at/~e0425408/...ultiD-vhdl.zip
>
> License:
> LGPL
>
>
> Comments, Suggestions welcome
>
>
>
>
> =============================================
> Albert Neumüller
> 21 March 2006
> =============================================
>
>
>
>
>
>
>
>
> -------------------------------------------------------------------------------
> -- QUICK Usage Examples:
> -- Requires fixed-width font (courier, etc.)
> --
> -- 1. Initializtion
> --
> -- Example: 3D - array
> -- --we want: %%% (0 to 6, 4 downto 2, 1 to %%% -------->
> --
> -- constant dim_info : DD_dimensions := (0, 6, 4, 2, 1, ;
> -- -- |--| |--| |--|
> -- -- dim0 dim1 dim2
> --
> -- signal arr3D : std_logic_vector(DD_zero to
> DD_calc_size(dim_info)-1);
> --
> --
> -- 2. Accessing sub-parts of the multiD (multi-dimensional) array:
> --
> -- Example:
> -- signal result : std_logic_vector(1 to ;
> --
> -- --we want: %%% result <= arr3D(3 to 3, 2 to 2, 1 to %%%
> -------->
> --
> -- result <= DD_slice(dim_info, (3, 3, 2, 2, 1, , arr3D);
> -- -- |--| |--| |--|
> -- -- dim0 dim1 dim2
> --
> --
> -- 2. Accessing sub-parts of the multiD array:
> --
> -- Example:
> -- variable assign_v : std_logic_vector(7 downto 0);
> --
> -- --we want: %%% arr3D(3 to 3, 2 to 2, 1 to <= assign_v;
> --
> -- DD_assign2slice(dim_info, (3, 3, 2, 2, 1, , arr3D, assign_v);
> -- -- |--| |--| |--|
> -- -- dim0 dim1 dim2
>



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training private.php?do=newpm&u=
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~


Jim Lewis
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uses of The 4th Dimension (New Discovery by The Human Race!) use4d@mail.com DVD Video 0 02-08-2006 12:45 PM
Uses of The 4th Dimension (New Discovery by The Human Race!) use4dnow@yahoo.com DVD Video 22 02-07-2006 01:41 PM
Uses of The 4th Dimension (New Discovery by The Human Race!) use4d@mail.com DVD Video 0 02-07-2006 01:07 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46