In news: oups.com
timestamped Thu, 26 Jul 2007 05:44:21 -0700,
posted:
|------------------------------------------------------------------------------|
|"On Jul 26, 5:31 pm, mk.supr...@gmail.com wrote: |
|> hello, |
|> i am having a small problem with this pc of code, can anyone help me |
|> with it. |
|> during simulation i get an error - Index 8 out of bound 0 to 7 on line |
|> 4 |
|> |
|> for count in 0 to 2 loop |
|> for row in 0 to 7 loop |
|> tempc := 0; |
|> for col in 0 to (temp - 1) loop |
|> mat2(row)(col) <= (mat1(row)(tempc) + mat1(row)(tempc + 1)) / 2; |
|> mat2(row)(col + temp) <= (mat1(row)(tempc) - mat1(row)(tempc + 1)) /|
|> 2; |
|> tempc := tempc + 2; |
|> end loop; |
|> end loop; |
|> mat1 <= mat2; |
|> temp := temp/2; |
|> end loop; |
| |
|here temp = 4. |
|now it is simulating, earlier i had given only temp, when i changed to |
|temp - 1 in the for loop it works," |
|------------------------------------------------------------------------------|
Hello,
You have confused me. The code you had showed earlier had temp - 1 so
can you simulated the code I have quoted above?
|------------------------------------------------------------------------------|
|" but now, even though i had |
|initialized mat1 to contain 255, it does not show on the simulator, |
|and at the end of the simulation both mat1 and mat2 contain only zeroes" |
|------------------------------------------------------------------------------|
This surprises me for a simulation (which simulator are you using?),
but as synthesis tools will ignore an initialization (by which an
assignment at the declaration is meant, I am unsure whether your
unshown code really does that) it is a good idea to not rely on
initializations anyway.
Regards,
Colin Paul Gloster