Forum Discussion
Altera_Forum
Honored Contributor
14 years agoTutorial: Using the USB-Blaster as an SOPC/Qsys Avalon-MM master
Hi all,
I've put together a tutorial on how to use the Altera JTAG-to-Avalon-MM master and Altera Verification IP Avalon-MM BFM Master under both SOPC builder and Qsys. http://www.ovro.caltech.edu/~dwh/correlator/pdf/altera_jtag_to_avalon_mm_tutorial.pdf (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/altera_jtag_to_avalon_mm_tutorial.pdf) http://www.ovro.caltech.edu/~dwh/correlator/pdf/altera_jtag_to_avalon_mm_tutorial.zip (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/altera_jtag_to_avalon_mm_tutorial.zip) The tutorial walks the user through the creation of an SOPC or Qsys system design, and provides scripts that automate the re-generation of the system. The tutorial shows how to simulate using Modelsim-ASE, and shows how to communicate with the hardware using System Console, quartus_stp, and then how to run a TCP/IP server under System Console or quartus_stp, and then communicate with that server from client code written in Tcl/Tk (a simple GUI) and a command-line C interface. Let me know if you like it, or have feedback/suggestions on how to improve the document. Cheers, Dave119 Replies
- Altera_Forum
Honored Contributor
Any suggestions on how (or if) the usb-blaster avalon jtag master could be used to transfer a block of memory that sits on the avalon bus? I'm trying to debug a video buffer, and it would be super useful if I could pull the raw binary data directly from memory, repeatedly, and as fast as the blaster protocol allows.
- Altera_Forum
Honored Contributor
--- Quote Start --- Any suggestions on how (or if) the usb-blaster avalon jtag master could be used to transfer a block of memory that sits on the avalon bus? I'm trying to debug a video buffer, and it would be super useful if I could pull the raw binary data directly from memory, repeatedly, and as fast as the blaster protocol allows. --- Quote End --- Just use the JTAG-to-Avalon-MM bridge and connect it as another master to the memory. Cheers, Dave - Altera_Forum
Honored Contributor
Very useful. Thanks for sharing!
- Altera_Forum
Honored Contributor
--- Quote Start --- Just use the JTAG-to-Avalon-MM bridge and connect it as another master to the memory. Cheers, Dave --- Quote End --- But on the pc side, it's there an altera tool to transfer data, or would it require a custom (tcl) application. For example, I found this but also doesn't seem to be for bust transfers.: Goo.gl/JKcw2M - Altera_Forum
Honored Contributor
--- Quote Start --- But on the pc side, it's there an altera tool to transfer data, or would it require a custom (tcl) application --- Quote End --- If you read the tutorial you would know the answer. I provide several options using Altera tools, and in the discussion above described how you can create custom software to access the core, but that takes much more work, and may break at anytime if Altera decides to change the protocol. If you need to transfer data, just add a USB-to-UART/FIFO. FTDI have plenty. They're fast, read these ... https://www.ovro.caltech.edu/~dwh/correlator/pdf/ftdi.pdf https://www.ovro.caltech.edu/~dwh/correlator/pdf/ftdi_spi.pdf Or use an AVR-USB or ARM-USB enabled micro. You'll be much happier than you would be reverse-engineering Altera's stuff ... Cheers, Dave - Altera_Forum
Honored Contributor
*** OFF TOPIC ***
Hi Dave, this is a little bit "off topic", but what (I suppose) Latex package do you use for your timing diagrams? Regards, Maik - Altera_Forum
Honored Contributor
Hi Maik,
--- Quote Start --- this is a little bit "off topic", but what (I suppose) Latex package do you use for your timing diagrams? --- Quote End --- I use Inkscape (a free drawing tool). It generates nice .pdf files and understands how to tear a PDF apart, so I can extract pages from data sheets, pull the images into Inkscape, and then annotate the images. For the timing diagrams, I just draw things by hand ... time consuming the first time, but most of the time I just start with a previous diagram. I can post the Inkscape .svg file for anything you'd like so you can play with it. Just ask. Cheers, Dave - Altera_Forum
Honored Contributor
Hi Dave,
thanks for the answer and offer to provide some .svg files. Coincidentally, I installed Inkscape a couple of weeks ago in order to draw a (very simple) diagram for a paper I had to prepare. So yes, if you would provide some of your svg files (e.g. figures 18 and 29 from your ftdi.pdf), I'd be happy to have a look into it in order to see, if I could use this for some of my documentation, too. Very kind offer of yours, thank you! Regards, Maik - Altera_Forum
Honored Contributor
Maik, sorry I haven't read the forum for a while. Please email me at my forum name and I'll send a zip file.
Cheers, Dave - Altera_Forum
Honored Contributor
Hi Dave,
I integrated JTAG to Avalon MM Master bridge in to my design and tried write-read memories (implemented as Avalon Slaves) with the Client-Server scripts that you have provided. (Using Centos 5.9 and Quartus 16.0) I could start the server with % quartus_stp -t jtag_server.tcl Opened another tab % gcc -Wall -o jtag_client jtag_client.c % ./jtag_client -w 0x0000 -d 0x12345678 (SRAM sits on 0x0000) It shows me following messages on client side: ============================================= [svaishampayan@dev01 jtag_client_server]$ ./jtag_client -w 0x0000 -d 0x12345678 Connect to server localhost:2540 JTAG write (address, data) = (0x00000000, 0x12345678) [svaishampayan@dev01 jtag_client_server]$ ============================================= On Server side: ============================================= JTAG: USB-BlasterII [USB 1-3.1], FPGA: @1: 10AT115S(1|2) (0x02E060DD) Start the server on port 2540 Wait for clients Accept sock2aaaab339790 from 127.0.0.1 port 56979 Handle the client via a fileevent callback SERVER (sock2aaaab339790): jtag_write 0x00000000 0x12345678 SERVER: jtag_write 0x00000000 0x12345678 SERVER (sock2aaaab339790): Invalid command from the client SERVER (sock2aaaab339790): empty command SERVER (sock2aaaab339790): disconnected [svaishampayan@dev01 jtag_client_server]$ ============================================= Could you please explain why it is saying "Invalid command from the client"? Thanks in anticipation! Regards Sagar.