UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,077 Views
Registered: ‎07-29-2009

readmemh gives weird warning

I get this warning when trying to load a text file:

 

WARNING: Data truncated while reading Datafile: dds3memcosine.data, while loading at index: ....

 

with a command like:

    $readmemh("dds3memcosine.data",cosine,0,RASTER_HALF_LENGTH-1);

 

The cosine reg is defined like this:

    reg  signed [12:0]        cosine [0:RASTER_HALF_LENGTH-1];

 

dds3memcosine.data has data like:

00000fff

....

 

 

How could I either suppress or avoid this warning. Everything works fine, but I don't want to see this warning RASTER_HALF_LENGTH times.

 

Regards,

Kurt

 

Tags (2)
0 Kudos
3 Replies
Scholar markcurry
Scholar
1,026 Views
Registered: ‎09-16-2009

Re: readmemh gives weird warning

 

Your cosine table is defined as 13 bits - but your readmem file is feeding in 32-bit constants per entry.

 

The tool is (correctly IMHO) warning you that it's truncating data.  Tweak your readmem file to define just those 13 bits, and the tool should stop complaining.

 

Regards,

 

Mark

0 Kudos
Highlighted
Explorer
Explorer
1,010 Views
Registered: ‎07-29-2009

Re: readmemh gives weird warning

That's kind of hard to specify using readmemh, which reads a hex value, which are in units of 4 bits each... Any thoughts on that?

Tags (1)
0 Kudos
Scholar markcurry
Scholar
1,007 Views
Registered: ‎09-16-2009

Re: readmemh gives weird warning

 

I'd imagine the tool would stop issuing warnings if your mem file contained just 4 hex digits per line. 

 

Regards,

 

Mark

 

 

0 Kudos