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: 
Highlighted
Visitor frturan
Visitor
823 Views
Registered: ‎02-13-2018

updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Hello,

I am working on a RISCV processor design. It implements bootloader code in a ROM. This ROM is coded as a SystemVerilog file you can see here on GitHub. I want to update the contents of this ROM, so that can play with modifications on the bootloader code. However, I don't want to re-synthesize and re-implement the whole hardware after each change. It takes hours. So I wanted to update the memory content with data2mem or updatemem tool. I am using ZCU102, which is not supported for data2mem. Similarly, updatemem does not seems to help, yet.

To use the updatemem, I followed this documentation. As I don't have a microblaze core or address mapped AXI memory in my design, 'write_mem_info' tool became useless for me to generate an mmi file. So I wrote an mmi file myself, by following the documentation page. You can find my mmi file in the attachments.

I can see in the implemented design that two ramb36e2 elements are used for the bootrom. I provide the screenshots of their properties in the attachments as well.

For these two ramb elements, I have two sections in my mmi file, each has address range from 0->1023. This is not byte address, which make me wonder if it is ok. However, the 'bram_addr_end' property is also set to 1023 in the implementation results (in the screenshot). So should be fine. For the datawidths, I set one to 0->35, and the other to 36->63. Again I used the implementation results for these.

I created a mem file as given in the attachments, and wanted to update the bitstream with the created mmi and mem files using the updatemem. The output of the tool is given below. I don't get any error, but a critical warning.

I don't know what the tool does, but the memory is not updated. Still the RISC-V core executes the previous code in the bootrom.

Might anyone have an idea how to use this tool to update memory contents of an arbitrary ramb instance in the design?

Kind Regards,

updatemem --meminfo bootrom.mmi --data src/bootrom/bootrom.mem --bit ariane.runs/impl_1/ariane_xilinx.bit --proc i_bootrom --out test.bit --debug --force
WARNING: [Common 17-259] Unknown Tcl command 'updatemem --meminfo bootrom.mmi --data src/bootrom/bootrom.mem --bit ariane.runs/impl_1/ariane_xilinx.bit --proc i_bootrom --out test.bit --debug --force' sending command to the OS shell for execution. It is recommended to use 'exec' to send the command to the OS shell.

****** updatemem v2018.2 (64-bit)
  **** SW Build 2258646 on Thu Jun 14 20:02:38 MDT 2018
  **** IP Build 2256618 on Thu Jun 14 22:10:49 MDT 2018
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

source /volume1/fturan/xilinx/Vivado2018.2/Vivado/2018.2/scripts/updatemem/main.tcl -notrace
Command: update_mem -meminfo bootrom.mmi -data src/bootrom/bootrom.mem -proc i_bootrom -bit ariane.runs/impl_1/ariane_xilinx.bit -out test.bit -force -debug
CRITICAL WARNING: [Memdata 28-237] Out of bounds code segment for ram space. 
 

Dump the BRAM Initialization Strings. 
Loading bitfile ariane.runs/impl_1/ariane_xilinx.bit
Loading data files...
Updating memory content...
Creating bitstream...
Writing bitstream test.bit...
0 Infos, 0 Warnings, 1 Critical Warnings and 0 Errors encountered.
update_mem completed successfully
update_mem: Time (s): cpu = 00:00:17 ; elapsed = 00:00:21 . Memory (MB): peak = 882.867 ; gain = 267.895 ; free physical = 2284 ; free virtual = 13986
INFO: [Common 17-206] Exiting updatemem at Tue Jun 11 14:30:49 2019...
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Visitor frturan
Visitor
436 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Finally, I have a solution to the problem, and I am sharing it here.

First of all there were two BRAM instances for a 64-bit data storage. However, they were not sharing the data in equal lenghts. One received lower 36 bits and the other received higher 28 bits. That upper 28 was not a problem, but lower 36-bit was, because 32 of them were put into the bram's data storage, while the remaining 4 bits were in the parity section. And unfortunately, updatemem tool is not capable of updating the parity bits. As a workaround, I divided the bootloader code into two 32-bit data words, and instantiated two separate brams for each. That prevents Vivado from using weird data widths for each bram instance, and using non-updateable parity bits. To complete the memory update operation, I created two mmi and mem files, one for each bram, and run the updatemem tool twice.

Now everything works well.

Kind Regards,

0 Kudos
12 Replies
Moderator
Moderator
797 Views
Registered: ‎09-12-2007

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

The address range is wrong in your mmi. 

Can you change this to 2047 and try again?

0 Kudos
Visitor frturan
Visitor
784 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Hello stephenm,

By saying "change this", I think you meant "change the address range".  I tried; however, there is no change. I still have the bootrom contents in the new bitstream.

Moreover, if I was replacing the memory content in a wrong way and corrupting it, then the execution of my RISCV core should fail, because the bootload code would become garbage. However, that code is not corrupted. It is just not updated.

In fact the input and output bitstreams of the updatemem tool  are different, I can check with file comparison using "diff". However, the executed bootrom code in the memory is still unchanged.

The only message I get from the updatemem is "CRITICAL WARNING: [memdata-28-237] "; however, I stiill could not find a related information to solve the problem with that.

Unfortunately, the "debug" flag to the updatemem also not helpful, it does not give me a meaningful extra information.

Kind Regars,

 

 

0 Kudos
Moderator
Moderator
780 Views
Registered: ‎09-12-2007

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

The -debug flag should show you the contents on the init_strings in the BRAM. Is this not the case?

0 Kudos
Visitor frturan
Visitor
776 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

I posted all the output I am getting from the updatemem in the original question. The "debug" flag was active in that run, and the output does not show me the "init_strings". Maybe, it is another proof that nothing is updated, but still I wondering what is the cause, and where is my mistake.

Regards,

0 Kudos
Moderator
Moderator
774 Views
Registered: ‎09-12-2007

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Can you share the bit, mmi please?

 

0 Kudos
Visitor frturan
Visitor
767 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

I am sending the bit, mmi, and mem files.

Regards,

0 Kudos
Moderator
Moderator
750 Views
Registered: ‎09-12-2007

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Can you view the init_string property in the cell property of the BRAM?

0 Kudos
Visitor frturan
Visitor
748 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

No, that property does not exist. I added in to the attachmentsa spredsheet output of all properties for both brams from the implementation results.

Kind Regards,

0 Kudos
Moderator
Moderator
738 Views
Registered: ‎09-12-2007

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Can you show your RTL instance?

0 Kudos
Visitor frturan
Visitor
735 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Hello again,

You can find the code here: https://github.com/pulp-platform/ariane/blob/master/fpga/src/bootrom/bootrom.sv

Kind Regards,

0 Kudos
Visitor frturan
Visitor
734 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

In fact, I made a small modification on it, to fix the size to 1024 addresses. My version is in the attachments.

Regarsd,

0 Kudos
Visitor frturan
Visitor
437 Views
Registered: ‎02-13-2018

Re: updatemem to change the memory contents of an arbitrary ramb instance

Jump to solution

Finally, I have a solution to the problem, and I am sharing it here.

First of all there were two BRAM instances for a 64-bit data storage. However, they were not sharing the data in equal lenghts. One received lower 36 bits and the other received higher 28 bits. That upper 28 was not a problem, but lower 36-bit was, because 32 of them were put into the bram's data storage, while the remaining 4 bits were in the parity section. And unfortunately, updatemem tool is not capable of updating the parity bits. As a workaround, I divided the bootloader code into two 32-bit data words, and instantiated two separate brams for each. That prevents Vivado from using weird data widths for each bram instance, and using non-updateable parity bits. To complete the memory update operation, I created two mmi and mem files, one for each bram, and run the updatemem tool twice.

Now everything works well.

Kind Regards,

0 Kudos