Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17253 Discussions

System Console script for Avalon-MM access

Altera_Forum
Honored Contributor II
2,252 Views

Hi, 

 

does anyone have a .tcl-script for writing data via the System Console to Avalon-MM slaves that he/she want's to share? 

 

Cheers, Peter
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,094 Views

Here's a pretty basic script ... 

 

# -----------------------------------------------------------------# jtag_cmds.tcl# # 11/9/2014 D. W. Hawkins (dwh@ovro.caltech.edu)# # SystemConsole commands.# # ----------------------------------------------------------------- # =================================================================# Master access# =================================================================# # -----------------------------------------------------------------# Open the JTAG master service# ----------------------------------------------------------------- # Open the first Avalon-MM master service proc jtag_open {} { global jtag # Close any open service if {} { jtag_close } set master_paths if { == 0} { puts "Sorry, no master nodes found" return } # Select the first master service set jtag(master) open_service master $jtag(master) return } # -----------------------------------------------------------------# Close the JTAG master service# -----------------------------------------------------------------# proc jtag_close {} { global jtag if {} { close_service master $jtag(master) unset jtag(master) } return } # -----------------------------------------------------------------# JTAG-to-Avalon-MM bridge read/write# -----------------------------------------------------------------# proc jtag_read {addr} { global jtag if {!} { jtag_open } # Read 32-bits set data return $data } proc jtag_write {addr data} { global jtag if {!} { jtag_open } # Write 32-bits master_write_32 $jtag(master) $addr return }  

 

You can start System Console and then type 

 

tcl> source jtag_cmds.tcl 

 

and then you can type jtag_read <address> or jtag_write <address> <data> 

 

These are dead-simple procedures. They are *not* efficient for transferring large amounts of data. Check out the other master procedures for better options (or ask). 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
1,094 Views

Hey Dave, 

 

thanks heaps! That should get me started. 

 

Cheers, Peter
0 Kudos
Reply