maheshpalve

DATA2MEM problem

Recommended Posts

hello,

i'm using papilio one 500k board for developing an 8-bit processor. The working was good so far and I came to know about data2mem tool thr google ....

I'm trying to use this tool for many days now. It gives me an updated bit file which I verified by dumping into text file. But, apperantly the data is not being written to BRAM by the this new bit file, because the processor is not executing the new code in BRAM.

When I initialize BRAM by .coe file, the code executes. So, no problem with BRAM!!!

Only, the new bit file doesn't work!!

any suggestions?????

Share this post


Link to post
Share on other sites

I have found that data2mem doesn't work as expected when line lengths are a little odd. I documented my findings here:

 

http://forum.gadgetfactory.net/index.php?/topic/1153-a-big-boring-tutorial-on-how-to-get-programs-into-your-papillo-one/

 

"Due to unexpected behaviour in data2mem the ".mem" file needs to have an even number of bytes per line. A line length of 105 is enough to have 32 bytes on each line and matches nicely with the data in the '.hex' file."

  • Like 1

Share this post


Link to post
Share on other sites

my .mem file is like:

 

@0000
0C01
6800
FFFF
0C08
6800
FFFF
0000

 

and dump file shows:

 

RAM data, Column 00, Row 00. Design instance "rom0/BU2/U0/blk_mem_generator/valid.cstr/ramloop[0].ram.r/s3_noinit.ram/spram.ram".

 00000000:   0C 01 68 00 FF FF 0C 08 68 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ..h.....h.......................
 00000020:   00 00 00 00 00 00 00 00  etc. etc.

 

 

and when I upload the new bit-stream the processor executes nothing!!

 

Is anything wrong with the .mem  content?

 

I even tried :

@0000
0C016800FFFF0C086800FFFF0000

which gives same result in dump file.

 

- Mahesh

Share this post


Link to post
Share on other sites

Well, it does look to be working. Are what does the equivalent MEMFILE and dump look like for the code that is placed in there when you use a .COE file?

 

Could it be a byte ordering thing? e.g. does this Memfile work?

@0000
010C
0068
FFFF
080C
0068
FFFF
0000

Share this post


Link to post
Share on other sites

The mem file content order is OK.

For a .coe file placed, the initial dumpfile shows code from .coe file.

After data2mem, it changes that code i.e. replaces it with .mem file content.

 

 

Well, I don't know what the problem was! But, this time I used RAMB16_S18 primitive directly, to instantiate my ROM in top module, instead of  the core-generator. Then re-synthesis, re-implementation . . . Again used data2mem. And wow, it worked!!!

Maybe  I was wrong somewhere in synthesizing memory from core generator or something else.

 

Thanks for your fast replies hamster . . . :)

 

 

- Mahesh

Share this post


Link to post
Share on other sites

Glad you got this worked out, data2mem can be a real hassle to get working, but once you get it dialed in it works great. My guess is that you might have been using an old BMM file or something that was not pointing to the correct memory block... It seems like everything else was correct, watch out for when you get longer code though. The error that hamster is talking about will creep up on you... I use gawk to remove carriage returns from the file so its one long line.

 

Jack.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now