Hi,I have the dsp development kit, cyclone iii edition (http://www.altera.com/products/devkits/altera/kit-cyc3-dsp.html). How can I use the Ethernet? In my altera > 80 > ip Directory I have triple_speed_ethernet. Will that work with this board? Or will I need additional IP-Cores? Will they also be shipped with my dev. kit? And are there IP-Cores for USB-Communication? Kind regards, Stefan__
Yes you can use triple_speed_ethernet from your quartus installation directory. It will shipped wit open core pulse feature enable so that without license you will able generate timelimited sof file.There is no any core require to communicate with PC. For USB IP Core, there is in built IP core shipped with Quartus software desiged from SLS. (altera -> 80 -> ip -> SLS). Regards, Hardik
Thanks for your response!But what about the avalon stream interface? Should I use this, too? And is there any possibility to make that Ethernet stuff a little bit more simple?
--- Quote Start --- Yes you need to use that interface to send your Ethernet packets. It is rather simple to use. --- Quote End --- But it is only for unidirectional communication: --- Quote Start --- You can use Avalon Streaming (Avalon-ST) interfaces for components that drive high bandwidth, low latency, unidirectional data. --- Quote End --- (Source: http://www.altera.com/literature/manual/mnl_avalon_spec.pdf) Is there also something for bidirectional data?
Where can I get this avalon ethernet core?At opencores.org I find some Ethernet Projects, but which of them is the right one...? And is it for GigaBit Ethernet? Maybe I should ask in another way: Which is the best possibility to communicate from Cyclone III Board to PC via Ethernet?
This is the Altera Triple Speed Ethernet, available in SOPC builder, or seperately from the MegaWizard in Quartus. But I thought you found it, according to your first post.I don't know what you mean by "best", it depends on your needs and resources. The easiest way would be to use a Nios CPU and an operating system with a TCP/IP stack. Without the Nios you'll need to code at least the ARP and UDP/IP protocols in hardware.
--- Quote Start --- The easiest way would be to use a Nios CPU and an operating system with a TCP/IP stack. --- Quote End --- OK, I understand. So I have a question about nios now: As I have read, the NIOS II is an embedded soft processor on the Board. Is it possible to write a program in C for the NIOS and use that NIOS program as a core/entity in my Quartus Block Diagram/Schematic File? To get a fast speed I want to use mainly VHDL. But if Ethernet is that difficult with VHDL, I could maybe use the NIOS. I have attached two Images so you can see what I am doing.
You can use C-2-H feature for converting your Nios C code into hardware. Using this all your c code convert into hardware block by altera tools and surly you will get the speed. But condition is that your c code is without any altera API ( like IORD, IOWR etc... ).
Thanks for your responses.--- Quote Start --- I'd look at the udp offload (http://www.nioswiki.com/exampledesigns/nios2udpoffloadexample) example on the Wiki. That should give you the performance you desire. --- Quote End --- Hopefully it will work with Quartus II 8.0, too... I will try both but I can't do this by now because my development kit / board is not yet delivered.
--- Quote Start --- You can use C-2-H feature for converting your Nios C code into hardware. Using this all your c code convert into hardware block by altera tools and surly you will get the speed. But condition is that your c code is without any altera API ( like IORD, IOWR etc... ). --- Quote End --- "The C2H Compiler improves the performance of Nios II programs by implementing specific C functions as hardware accelerators. the c2h compiler is not designed to create arbitrary hardware systems from c code. Rather, the C2H Compiler is a tool for generating a hardware accelerator module, functionally identical to the original C function, that offloads and enhances the performance of the Nios II processor." "The C2H Compiler is not designed to build all types of FPGA systems. It is designed specifically to augment the performance of programs that run on the Nios II processor; it does not replace the processor." (source: http://www.altera.com/literature/ug/ug_nios2_c2h_compiler.pdf) -> So it is not exactly what I am looking for. But OK, finally there are two possibilities and both of them have some disadvantages:
The Nios is the easiest way if you don't want to spend too much time on the project.If you need performance, the offload example given by slaker is a good way to go: you use a CPU for all the protocols that are better handled in software (ARP, TCP...) and use hardware only for specific high-speed UDP ports.
--- Quote Start --- The Nios is the easiest way if you don't want to spend too much time on the project. --- Quote End --- On the one hand, I got several months to get it working but on the other hand I am still a beginner... I got another question: --- Quote Start --- Also included is a complete MAC driver to be used in conjunction with Altera's implementation of the InterNiche TCP/IP Stack. The driver and MAC have been tested with both the UCOSII and Superloop implementations of the stack. you should be able to drop it into your system and be able to run altera's simplesocket server example without problems. You may need to do a little work to support your PHY (explained in the enclosed MSWORD document). --- Quote End --- I downloaded this and put it in Quartus but I couldn't understand how to use this, even not when reading the included Guide (the DOC-File). But if it says that I should be able to run the SimpleSocket Server example, so it is not true that I need to code ARP/TCP/... by myself, because I think that this InterNiche TCP/IP Stack is doing this for me. Where can I read how to use the avalon opencores 10/100 ethernet mac and who can give me an example design with it and Cyclone III Board?
Yes, if you use the Interniche stack all the protocols will be handled automatically and you can just use the standard socket API.As for the example design, I don't think they made any for the DSP kit that includes the Ethernet interface. You can have a look at the nios ii 3c120 design example (http://www.nioswiki.com/exampledesigns/niosii3c120designexample) on the Nios Wiki. For the software side you can create a Simple Sockets Server project directly from the IDE.
OK, so let me resume what I have understood until now (please correct me if I am wrong):If we look in wikipedia in the article ethernet (http://en.wikipedia.org/wiki/ethernet) we can see how the different layers are called:
When you are communicating with the PC, you are sending IP packets, either TCP or UDP. Those protocols are in the Network and Transport layers.To transmit IP packets from one system to another, you need a link that is on the Physical layer. Ethernet is the most popular today. To implement an Ethernet link, you need 3 parts:
Thanks for your response, that helped a lot!--- Quote Start --- If you choose the hardware way, remember that you need to fill in the complete packet headers, including Ethernet, IP and UPD. --- Quote End --- OK. I am sorry if I am changing the subject/topic so abruptly, but my next question is: Do you think it would be a more simple and faster solution to use USB instead for communicating with the PC? --- Quote Start --- The downsides to USB are that it has limited connectivity (length, point-to-point) and you have to write everything pretty much yourself. You don't get to take advantage of the existing software and hardware that are built around TCP/IP. Ethernet is nice because you don't have to write any of the low-level stuff. --- Quote End --- So here we can compare now: What is more difficult: Generating the Ethernet frames in hardware (and fill in all these headers) or using USB and writing everything pretty much myself?
To generate the Ethernet frames in hardware, you need to know the PC's MAC address (that is usually found from it's IP using the ARP protocol) and compute the IP and UDP checksums.For the USB communication, the USB part of the board isn't documented, and it doesn't seem easy. There is another thread on that subject in this forum. An alternative would be to use the embedded USB blaster in JTAG mode, and use the system console tools on the PC to directly access the Nios' memory and read the data in there. Unfortunately I'm not sure the performance will be very high...
--- Quote Start --- ...directly access the nios' memory --- Quote End --- I think the size of the Nios' memory is about 4 MBit. So I guess it's not the same as the ddr2-sdram on the Board... For my project, I think I am going to use Ethernet (with NIOS). My VHDL-Hardware will fill the DDR2-SDRAM with Data (received from ADC). Then the NIOS should read the DDR2-SDRAM and send the Data via Ethernet to the PC. I will take care of the speed of Ethernet later, at first I am glad if it works at all... In this case, my hardware and software are independent in a way. Could there be problems when the FPGA and the NIOS both access the DDR2-SDRAM? Thank you, Daixiwen! :)