Jump to content


How to initialize a Block RAM


  • You cannot reply to this topic
1 reply to this topic

#1 Diego

    Member

  • Members
  • PipPip
  • 11 posts

Posted 08 February 2010 - 06:28 AM

Hi,

I have the following code to initialize an array to zero:
CODE

float my_array[MAX];

for (i = 0; i < MAX; i++){
my_array[i] = 0;
}


The vhdl inferred performs the loop as coded. However, I'd like to reset the array instantly, with a reset signal. Is there any way to do this?

Thanks in advance,

Kind Regards,
Diego.



#2 etrexel

    Advanced Member

  • Impulse Staff
  • PipPipPip
  • 260 posts

Posted 15 February 2010 - 01:56 PM

[posting for Rob until he gets access to the forums again]
Hi Diego,

No reset mechanism is available for arrays, variables, and so on, other than initialization at the time when the bitstream is loaded. This is done by providing initialization in the C code when the array or variable is defined. If no initialization is provided, arrays and variables may be set to all 0s, dependent on the particular platform and implementation.

Thanks,

-Robert

Ed Trexel
Impulse Accelerated Technologies, Inc.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users