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

Reply

VHDL - Array rotate : "Range bound must be a constant" in synthesis

 
Thread Tools Search this Thread
Old 10-29-2006, 11:19 AM   #1
Default Array rotate : "Range bound must be a constant" in synthesis


Hello

I have one error message "Range bound must be a constant" duriung
synthesis.

I intend to rotate a variable sized integer array.
Array looks like {size, element,..,element }.
Number of elements = size.
I wish to get new array, rotated by "pos" value.

For example,
old array = { 4, 2, 3, 1, 4} and pos = 2
new array = { 4, 3, 1, 4, 2}.

Another example,
old array = { 5, 4, 2, 1, 3, 5 } and pos = 3
new array = { 5, 1, 3, 5, 4, 2 }

In order to implement that, I used "function", as shown in the
following.

1. I considered record type "parameters"

---- parameter to pass
type para is array (0 to size) of integer range 0 to size;
type parameters is record
old : para; -- old array
pos : integer range 0 to size; -- pos
end record;

2. I wrote a function below.

The code is not synthesizable.
Does anyone have idea how to make this synthesizable?
Thankyou.


-- generate new array from old array
function NEW_ARRAY( Temp: parameters ) return para is
variable array_out : para; -- new array
variable CTRL : integer range 0 to size; -- pos
variable IDX : integer range 0 to size; -- size
begin

CTRL := Temp.pos ;
IDX := Temp.old(0);

array_out(0) := Temp.old(0);

if ( IDX = 0 or CTRL = 0 ) then array_out := (others => 0 );
else

for I in CTRL to IDX loop
array_out(I - CTRL + 1) := Temp.old(I); ---- problematic
end loop;

for I in 1 to CTRL-1 loop
array_out(I + IDX - CTRL + 1) := Temp.old(I); ---- problematic
end loop;

end if;
return array_out;
end NEW_ARRAY;



Pasacco
  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
synthesis error sekhar_kollati Hardware 0 11-13-2007 04:48 AM




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