Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15468 Discussions

Reading a file from external memory via System Console

skon
Novice
1,298 Views

Hello,

 

My design captures images from an external video source and records them to DDR3.

In addition to my custom logic, I also have a Jtag to Avalog master connected the DDR3 controller (via Qsys).

Is it possible to save a section of the memory (representing a single image) into a file on my hard drive via System Console ?

0 Kudos
4 Replies
RParks
Novice
183 Views

I've done something similar so this might help:

 

proc DDR3_read_to_file {} {

  set imagefile [open "C:/Users/RParks/system_console/scripts/image_read.mem" w]

  # set imagefile [open "/root/system_console/scripts/image_read.mem" w]

   

  set read_data [<ddr_read_command> <addr> <length>]

  # puts $read_data

   

  puts $imagefile [format "%s" $read_data]

   

  close $imagefile

}

skon
Novice
183 Views

Hi,

Thanks for the reply.

 

But where in your script do you specify the DDR3 address range that you want to be copied to the file ?

RParks
Novice
183 Views

Hi, so my solution wasn't for DDR3 and you'd need to customise it for your system but in mine I wrote a separate proc <ddr_read_command> which took 2 arguments, the address and length.

 

The below might be a helpful starting point for you to write your own:

 

proc memory_rd_cmd {addr length} {

  variable claimed_path

   

  set readdata {}

  for {set i 0} {$i < $length} {incr i} {

    lappend readdata [master_read_32 $claimed_path [expr {$addr+$i}] 1]

  }

  return $readdata

}

skon
Novice
183 Views

Thanks.

I'll try it.

 

I thought I'd easily find an online example for this exact scenario - but I can't.

Reply