Forum Discussion
Data from FPGA to host
Hi,
I have a DE0-nano board and I compute data (only 4 bits generated at about 10MHz) and I'd like to communicate it to the host cpu through the USB-blaster so programs could read it. I've read this (http://www.alteraforum.com/forum/showthread.php?t=32354) and there's instructive information but it's a bit old and maybe there exist other ways. I thought about a FIFO that would be written by the FPGA then read by the host through the USB link. Is it possible? Have I to use a virtual JTAG component? Thanks for your help.85 Replies
- Altera_Forum
Honored Contributor
Sorry, I've typed something wrong. It's not MHz but kHz. What is the maximum data rate I can use?
I can't explain everything but I get data from another device and the design uses it to compute a 4-bit word and my computer has to use it for a software computation. I don't use a PCIe slot because it's a laptop and I only have access to USB. - Altera_Forum
Honored Contributor
--- Quote Start --- Sorry, I've typed something wrong. It's not MHz but kHz. What is the maximum data rate I can use? --- Quote End --- The USB-Blaster JTAG interface operates with a 6MHz clock, and it takes about 10 clocks per byte, so the maximum data rate is 600kBytes/s or 4.8Mbps. See the performance analysis here; https://www.ovro.caltech.edu/~dwh/correlator/pdf/altera_jtag_to_avalon_analysis.pdf Your data rate of 40kbits/s can be implemented using the JTAG interface. The initial responses at the beginning of this thread have already provided an answer to your question. You can use the JTAG UART or the JTAG-to-Avalon-MM bridge. Go and take a look at the DE0-nano SDRAM example in this thread; http://www.alteraforum.com/forum/showthread.php?t=45927 The design includes a Qsys system and Tcl commands to access the board. The SystemConsole master_read_memory and master_write_memory are the most efficient commands for transferring blocks of data. Cheers, Dave - Altera_Forum
Honored Contributor
OµµµµµµµµµµK, I'll read it next week because it's friday night there and I stop working and won't be there for the week-end. I'll let you know what I don't understand.
- Altera_Forum
Honored Contributor
I tried the de0_nano_sdram tutotial from http://http://www.alteraforum.com/forum/showthread.php?t=45927 (http://http://www.alteraforum.com/forum/showthread.php?t=45927)
but the Quartus tcl console says: - Altera_Forum
Honored Contributor
I tried the sdram tutorial first: http://http://www.alteraforum.com/forum/showthread.php?t=45927 (http://http://www.alteraforum.com/forum/showthread.php?t=45927)
but the console says: - Altera_Forum
Honored Contributor
Hello,
I tried to post something but it doesn't appear, maybe because of an attached file. So I tried the sdram tutorial on http://www.alteraforum.com/forum/showthread.php?t=45927 but my console tells: Writing to 256 SDRAM locations Error:invalid command name "get_service_paths" Error: while executing Error:"unknown_original get_service_paths master" Error: ("eval" body line 1) Error: invoked from within Error:"eval unknown_original $cmd $args" Error: (procedure "::unknown" line 7) Error: invoked from within Error:"get_service_paths master" Error: (procedure "jtag_open" line 9) Error: invoked from within Error:"jtag_open" Error: (procedure "jtag_write" line 7) Error: invoked from within Error:"jtag_write $addr $data" Error: ("uplevel" body line 4) Error: invoked from within Error:"uplevel 1 $cmd" Error: invoked from within Error:"for {set i 0} {$i < $len} {incr i} { Error: set addr [expr {4*$i}] Error: set data [expr {0x12340000 + $i}] Error: jtag_write $addr $data Error: }" Error: (procedure "sdram_test" line 4) Error: invoked from within Error:"sdram_test" and I don't know what I should do. Do you understand the error? - Altera_Forum
Honored Contributor
The moderation policy is making it impossible for me to post. I've tried the sdram tutorial but I've got tcl errors that I don't understand. I'll try...
- Altera_Forum
Honored Contributor
--- Quote Start --- The moderation policy is making it impossible for me to post. I've tried the sdram tutorial but I've got tcl errors that I don't understand. I'll try... --- Quote End --- You posted this text, so you could have posted your Tcl errors :) What version of Quartus were you trying to use, and what operating system? I can re-run the script and check it works. Cheers, Dave - Altera_Forum
Honored Contributor
I tried first to post the log as an attached file but impossible.
Then I copied the text but impossible. So I only posted the first error. It's version 13.1.0 on Windows 7 64-bit Enterprise edition. - Altera_Forum
Honored Contributor
--- Quote Start --- I tried first to post the log as an attached file but impossible. Then I copied the text but impossible. So I only posted the first error. --- Quote End --- But you didn't post any details on the error, just that you had one, so its a bit hard to help :) --- Quote Start --- It's version 13.1.0 on Windows 7 64-bit Enterprise edition. --- Quote End --- Ok, I have 13.1 on a Win7 machine, here's a copy of the Quartus Tcl console log showing no errors;
If you're still having trouble, just email me directly (at my forum name). Cheers, Davetcl> cd {C:\Temp\de0_nano_sdram} tcl> source scripts/synth.tcl Synthesizing the DE0-nano 'sdram' design ---------------------------------------- - Quartus Version 13.1.4 Build 182 03/12/2014 SJ Full Version - Creating the Quartus work directory * C:/Temp/de0_nano_sdram/qwork - Create the project 'de0_nano' * create a new de0_nano project - Applying constraints - Creating the VHDL files list - Generate the Qsys system * creating the Qsys file in the work directory * Tcl-to-Qsys generation for Quartus version 13.1 * generating the Qsys system (please wait) - Processing the design - Processing completed