Thread: $readmemh()
View Single Post
  #12 (permalink)  
Old 06-18-2009, 04:07 PM
gabor
Guest
 
Posts: n/a
Default Re: $readmemh()

On Jun 18, 7:25*am, Kausi <kauser.jo...@gmail.com> wrote:
> On 16 June, 12:26, Andreas Ehliar <ehliar-nos...@isy.liu.se> wrote:
>
>
>
> > On 2009-06-16, gabor <ga...@alacron.com> wrote:

>
> > > XST is a little more restrictive than simulators. *The $readmemh
> > > needs to be in an initial block in the same module where the
> > > memory array is declared. *Other than that, it should match
> > > the simulation for generating initialized memories or ROMs.

>
> > In the past I've had problems when initiating part of a memory with
> > initial statements. For example, the following example didn't work
> > because the entire memory was not initialized:

>
> > reg [7:0] foo[15:0];

>
> > initial begin
> > * * foo[0] = 9;
> > * * foo[1] = 5;
> > end

>
> > In this case XST gave an error in the synthesis log file if I remember
> > correctly. I'm just guessing here, but perhaps the original poster is
> > having the same problems even though you are using $readmemh instead of
> > plain variable assignments to initialize your memory?

>
> > /Andreas

>
> When i try to initialize using $readmemh-> It only returns a warning
> saying that the memory is tied to zero as it was partially
> initialized.
>
> reg * * * * * * *mem *[0:47];
> initial $readmemb("ScDataIn.txt", mem);
>
> The file contains 48 binary numbers.
>
> Am i missing something ?


Depending on the resource used to synthesize this memory,
e.g. distributed RAM or block RAM, the actual memory is
likely to be larger than 48 elements. Although you
initialized all of the memory you declared, the synthesis
tool will warn you about the remainder of memory it
inferred being uninitialized.

regards,
Gabor
Reply With Quote