cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
206 Views
Registered: ‎04-21-2020

Dumbing the entire physical memory in xilinx

Hi,

      I want to dump  the entire RAM to a file which I can use for future analysis. I could use /dev/mem only in the area of RAM not required by any driver. I want to dump the memory in the way similar to /dev/ram but with out any restriction.

0 Kudos
6 Replies
Highlighted
Moderator
Moderator
197 Views
Registered: ‎09-12-2007

You could use JTAG using XSCT to do this. It might take a while though

 

0 Kudos
Highlighted
Adventurer
Adventurer
182 Views
Registered: ‎04-21-2020

Hi ,

       My system currently running baremetal, then uboot, and then linux. If I use JTAG, I can watch the memory all the way through right.

 

0 Kudos
Highlighted
Adventurer
Adventurer
143 Views
Registered: ‎04-21-2020

Hi @stephenm ,

                         I used this trick mentioned by you and I could see the entire RAM using the JTAG and sdk. Do we have a option to see the system address beyond system RAM memory.

For eg : IP block is in the range of 0x43d00000 which is beyond the ram(In our case the ram size is 512MB ) . If I can see this address in the sdk, It will help me to visually verify if the data is written perfectly in this address.

 

Thanks

0 Kudos
Highlighted
Moderator
Moderator
132 Views
Registered: ‎09-12-2007

you can use the mrd command to read any valid memory or register address 

0 Kudos
Highlighted
Adventurer
Adventurer
70 Views
Registered: ‎04-21-2020

Hi @stephenm ,

                           Thank you for your reply. I tried mrd command. But could not get it right. Could you please let me know what mistake I am doing

xsct% mrd -address-space ap1 0x43ca0000
xsct% unknown or ambiguous address space "ap1": must be PA

mrd -address-space PA 0x43ca0000
xsct% Memory read error at 0x43CA0000. Blocked address 0x43ca0000. PL AXI slave ports access is not allowed. This address has not beed added to the memory map

mrd -address-space AP0 0x43ca0000
xsct% unknown or ambiguous address space "AP0": must be PA

mrd -address-space AP0 0x43d00000
xsct% unknown or ambiguous address space "AP0": must be PA

mrd -address-space AP1 0x43d00000
xsct% unknown or ambiguous address space "AP1": must be PA

mrd -force 0x43d00000

 

In my case at 0x43d00000 I have  IP block, and I would like to check the register contents of the ipblock.

0 Kudos
Highlighted
Moderator
Moderator
55 Views
Registered: ‎09-12-2007

You could make a script to do this for you. Input the HDF/XSA file and use the HSI API to read the all the IP in a processors address map. Then get the base address and high address.

proc dump {filter file} {
	set fileId [open $file "w"]
	if {$filter == 0} {
		set mem [hsi::get_cells *]
	} else {
		set mem [hsi::get_cells * -filter $filter]
	}
	for {set j 0} {$j < [llength $mem]} {incr j} {
		puts $fileId "[common::get_property NAME [lindex $mem $j]]"
		puts $fileId  "BASE_VALUE: [common::get_property CONFIG.C_S_AXI_BASEADDR [hsi::get_cells [lindex $mem $j]]]"
		puts $fileId  "HIGH_VALUE: [common::get_property CONFIG.C_S_AXI_HIGHADDR [lindex $mem $j]]"
		set range [get_range [lindex $mem $j] [common::get_property CONFIG.C_S_AXI_HIGHADDR [lindex $mem $j]] [common::get_property CONFIG.C_S_AXI_BASEADDR [lindex $mem $j]]]
		if {$range > 0} {
			if { [catch {[mrd -force [common::get_property CONFIG.C_S_AXI_BASEADDR [hsi::get_cells [lindex $mem $j]]] $range]} fid] } {
			    puts "Warning: $fid"
			} else {
				puts $fileId [mrd -force [common::get_property CONFIG.C_S_AXI_BASEADDR [hsi::get_cells [lindex $mem $j]]] $range]
			}
		}
	}
	close $fileId
	puts "Info: $file created"
}

This uses the XSCT mrd. It also has a catch so it wont crash on an illegal access

I have attached a TCL script to do this in XSCT:

Just source this, and run the command below:

dump_xsct.PNG

This will create a dump.log

There is a filter that you can use too, and you should use this otherwise it will dump everything in your system. 

dump_mem -filter {IP_TYPE == MEMORY}