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: 
785 Views
Registered: ‎01-19-2017

updatemem doesn't write data to memory

Jump to solution

I've been trying to put together a design based on a RISC-V softcore along with some other peripheral devices. The softcore has it's own memory protocol but the project also provides AXI adaptors so that the core can interface with a memory that implements the AXI interface. 

I've managed to build my system and test it using the AXI VIP Cores and everything runs as expected. I've now transitioned to instantiating XPM Memories in the top-level design and am trying to use updatemem to set the contents of the these memories so I can observe some outputs using the System ILA before I develop the system further. 

When I use updatemem it seems to run fine and reports no errors and checking over the debug output this also seems sensible. However when I program my FPGA (VC707) and try and read back the contents of memory I simply get 0's and my data is nowhere to be seen. I've gone through several iterations of what's wrong including checking all my resets and clocks and solving all my timing issues but this problem still persists so any help would be greatly appreciated.

Below is included a portion of my top-level design that shows the instantiation of the XPMs and also attached is the MMI file generated by the tools and the handwritten MEM file I'm attempting to use to load the memory (uploaded with txt/xml extensions but they are correct). 

Feel free to ask any further questions or clarifications, this is probably down to me not understanding something or just being foolish!

 

module kuuga_ila_top (
reset,
sys_diff_clock_clk_n,
sys_diff_clock_clk_p
);

input reset;
input sys_diff_clock_clk_n;
input sys_diff_clock_clk_p;

wire reset;
wire sys_diff_clock_clk_n;
wire sys_diff_clock_clk_p;
wire inst_clk;
wire inst_rst;
wire [31:0] inst_douta;
wire [15:0] inst_addra;
wire [31:0] inst_dina;
wire inst_ena;
wire [3:0] inst_wea;

...

(* DONT_TOUCH = "TRUE" *) xpm_memory_spram #( .ADDR_WIDTH_A(16), // DECIMAL .AUTO_SLEEP_TIME(0), // DECIMAL .BYTE_WRITE_WIDTH_A(8), // DECIMAL .ECC_MODE("no_ecc"), // String .MEMORY_INIT_FILE("test_prog_inst.mem"), // String .MEMORY_INIT_PARAM(""), // String .MEMORY_OPTIMIZATION("false"), // String .MEMORY_PRIMITIVE("block"), // String .MEMORY_SIZE(2097152), // DECIMAL .MESSAGE_CONTROL(0), // DECIMAL .READ_DATA_WIDTH_A(32), // DECIMAL .READ_LATENCY_A(2), // DECIMAL .READ_RESET_VALUE_A("0"), // String .USE_MEM_INIT(0), // DECIMAL .WAKEUP_TIME("disable_sleep"), // String .WRITE_DATA_WIDTH_A(32), // DECIMAL .WRITE_MODE_A("read_first") // String ) xpm_inst_mem ( .douta(inst_douta), // READ_DATA_WIDTH_A-bit output: Data output for port A read operations. .addra(inst_addra), // ADDR_WIDTH_A-bit input: Address for port A write and read operations. .clka(inst_clk), // 1-bit input: Clock signal for port A. .dina(inst_dina), // WRITE_DATA_WIDTH_A-bit input: Data input for port A write operations. .ena(inst_ena), // 1-bit input: Memory enable signal for port A. Must be high on clock // cycles when read or write operations are initiated. Pipelined // internally. .rsta(inst_rst), // 1-bit input: Reset signal for the final port A output register stage. // Synchronously resets output port douta to the value specified by // parameter READ_RESET_VALUE_A. .wea(inst_wea) // WRITE_DATA_WIDTH_A-bit input: Write enable vector for port A input // data port dina. 1 bit wide when word-wide writes are used. In // byte-wide write configurations, each bit controls the writing one // byte of dina to address addra. For example, to synchronously write // only bits [15-8] of dina when WRITE_DATA_WIDTH_A is 32, wea would be // 4'b0010. );

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
643 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution

So I solved this one for myself, I wasn't setting the regcea pin high when I was instantiating the XPM and I had a non-zero read latency. So despite the fact that the memory was full no output value was being clocked into the output register because it wasn't being enabled. Now I can read back stuff I write in with updatemem so I'm much happier. Thanks for all your help everyone!

0 Kudos
11 Replies
Moderator
Moderator
736 Views
Registered: ‎10-06-2016

Re: updatemem doesn't write data to memory

Jump to solution

Hi @jonathanrainer

Which release of tools are you using? I mean there is a bug in 2018.3 release and a design advisory was published recently.

https://www.xilinx.com/support/answers/71948.html

 

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
727 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution

Hi,

I’m currently using 2018.2, I’d seen forum chatter about problems with the MMI generation but from my understanding that was more to do with the ordering of bytes. In my case whenever I use UpdateMEM and then try and read back the memory I simply get 0x00000000 as a response no matter the address. Even when I fill the memory with data. Also I’m not using a MicroBlaze in this design so I thought the problem I was having was different to the bug found.

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

Re: updatemem doesn't write data to memory

Jump to solution

Sounds like an interesting project

Can you verify that you are creating the MMI file correctly. There is a wiki added below that you can use as a reference to creating the MMI:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842458/Understanding+MEMDATA+flow+and+how+to+manually+create+MMI+file

 

 

0 Kudos
713 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution

The MMI file is the one generated by the write_mem_info command and corresponds to the way the BRAMs are laid out when you look at the synthesised design schematic, I haven't tried to handcraft this one. 

(Coincidentally I've had other problems when I put the BRAMs in CASCADE mode but that's not really relevant to this question).

At present I've got it arranged so the synthesised design contains 32 BRAMs per Memory Instance (as I'm instantiating Instruction & Data Memory seperately for the moment), which might not exactly match what's posted but it's causing the same problem regardless.

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

Re: updatemem doesn't write data to memory

Jump to solution

with the -debug option in upatemem, are you seeing the bram getting populated with your data?

for example

updatemem -debug -meminfo test.mmi -data test.elf -bit test.bit -proc microblazed_0 -out download.bit > dump.txt

The dump.txt will have the init strings for your BRAM.

Is this populated?

 

Howq are you verifying in HW? how are you reading the BRAM? via your sw code? or XSCT?

0 Kudos
701 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution
Yes the BRAM strings are being populated with data when updatemem is used. To verify the design in HW I'm using the System ILA block to read the results that come back from the BRAM controller and also have a 2 Slave/1 Master AXI Interconnect that has the Processor Memory Protocol (converted to AXI) on one Slave Port and an AXI-JTAG Block on the other. The Master is then connected to the BRAM Controller.
0 Kudos
Moderator
Moderator
699 Views
Registered: ‎09-12-2007

Re: updatemem doesn't write data to memory

Jump to solution

What is the address range in the MMI file?

Does the base address match up with your data file?

you can dissassemble this

mb-objdump -S executable.elf

It could be that your data file is placed into BRAm but at an offset, and you are not reading this connecting

via the ILA or JTAG to AXI?

 

 

0 Kudos
692 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution

The MMI file has address range up to 65536 and starts at 0 which matches with what's defined in the memory map. I thought of this idea and so tried filling the whole memory with randomly generated hex data and this still has led to me reading 0's rather than any data at all so I doubt it's a problem about offsetting if filling the whole memory still causes the same problem.

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

Re: updatemem doesn't write data to memory

Jump to solution

can you add a screenshot of your Block Design in IPI?

0 Kudos
677 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution

Here it is:

Screenshot from 2019-02-12 10-33-10.png

0 Kudos
Highlighted
644 Views
Registered: ‎01-19-2017

Re: updatemem doesn't write data to memory

Jump to solution

So I solved this one for myself, I wasn't setting the regcea pin high when I was instantiating the XPM and I had a non-zero read latency. So despite the fact that the memory was full no output value was being clocked into the output register because it wasn't being enabled. Now I can read back stuff I write in with updatemem so I'm much happier. Thanks for all your help everyone!

0 Kudos