Forum Discussion
37 Replies
- Altera_Forum
Honored Contributor
It could be a problem in your Cygwin installation. Are you doing this from the Nios II command shell? Could you check the value of your PATH environment variable (echo $PATH in the Nios II command shell) and check that you have /cygdrive/*/altera/*/nios2eds/sdk2/bin in it?
- Altera_Forum
Honored Contributor
Hi,
Sorry but I am not much familiar with FPGA environment and actually I didn't understand exactly what you mean. I am applying the software part of that tutorial in Altera Monitor Program software running in windows XP 64 bit and getting that error. I am not sure this is what you mean but I checked like this from start menu\allprogram\Nios II EDS\Nios2 Command Shell and it shows: ------------------------------------------------ Altera Nios2 Command Shell [GCC 4] Version 12.1, Build 177 ------------------------------------------------ Administrator@..../cygdrive/c/altera/12.1 $ when I use here the command: echo $PATH the output is: ------------------------------------------------ Altera Nios2 Command Shell [GCC 4] Version 12.1, Build 177 ------------------------------------------------ Administrator@.... /cygdrive/c/altera/12.1 $ echo $path Administrator@.... /cygdrive/c/altera/12.1 $ and didn't get like: /cygdrive/*/altera/*/nios2eds/sdk2/bin - Altera_Forum
Honored Contributor
It needs to be echo $PATH with capital letters, environment variables are case sensitive.
And what happens if you type nios2-app-generate-makefile in the Nios II command shell? Do you also have the command not found, or something like "SEVERE missing required command line option" ? (if it is the latter, then it means that your cygwin installation is ok) - Altera_Forum
Honored Contributor
Hi Daixiwen,
when I use echo $PATH, it is: Administrator@.... /cygdrive/c/altera/12.1 Then I changed it into the Path(you mentioned above) by using: $ export PATH=/cygdrive/c/altera/12.1/nios2eds/sdk2/bin But after compiling the program in Altera Monitor Program, the error is same as before: usr\bin\bash nios2-app-generate-makefile: command not found I checked the next command you suggested: $ nios2-app-generate-makefile and it gives: SEVERE: Missing required command line option: "--bsp-dir". SEVERE: nios2-app-generate-makefile failed when I restart my PC, it again set to default as follows: Administrator@.... /cygdrive/c/altera/12.1 and error is still same. What could be the solution then? - Altera_Forum
Honored Contributor
It looks like the problem lies in the Altera monitor then, form what I am seeing you can use nios2-app-generate-makefile from the Nios command shell.
Unfortunately I don't have that monitor so I can run any tests. Can't you generate the application from the Nios Console instead? - Altera_Forum
Honored Contributor
--- Quote Start --- Can't you generate the application from the Nios Console instead? --- Quote End --- Hi Daixiwen, Is that mean to check the application with "Nios II 12.1 Software Build Tools for Eclipse" software instead of "Altera Monitor Program" software? - Altera_Forum
Honored Contributor
Hi Daixiwen,
Thank you! I just checked the application with "Nios II 12.1 Software Build Tools for Eclipse" and Its working :) - Altera_Forum
Honored Contributor
Well I didn't help you that much but I'm glad you found a solution ;)
- Altera_Forum
Honored Contributor
Hi Daixiwen,
Now, I want to use this tutorial for the real application. The C Program code which have given to me for this tutorial is in attachment. Which print what the user types in the terminal window and send the message through the Ethernet port when the user presses the Enter key. If at any time a message is received, the received message will be printed in the terminal window. I modify it little bit like removing this part from the program: // Add new typed characters to the transmit frame until the user types the return character while ( (new_char = alt_getchar()) != '\n' ) { if (new_char == 0x08 && text_length > 0) { // Check if character is a backspace and if there is anything to delete alt_printf( "%c", new_char ); text_length--; // Maintain the terminal character after the text tx_frame[16 + text_length] = '\0'; } else if (text_length < 45) { // Check if there is still room in the frame for another character alt_printf( "%c", new_char ); // Add the new character to the output text tx_frame[16 + text_length] = new_char; text_length++; // Maintain the terminal character after the text tx_frame[16 + text_length] = '\0'; } } alt_printf( "\nsend> " ); text_length = 0; and now I am able to send via ethernet1 port to the my PC. but speed I am reaching is at 30 Mbps. I want to increase the speed around 400 Mbps, what Should be the modification? Does here changing the length from 62 to lets say 1024 help? // Create transmit sgdma descriptor alt_avalon_sgdma_construct_mem_to_stream_desc( &tx_descriptor, &tx_descriptor_end, tx_frame, 1024, 0, 1, 1, 0 ); or is there any other alternative? - Altera_Forum
Honored Contributor
Actually 30Mbps is not bad already.
Yes, increasing the packet size will improve the bandwidth, as the CPU is spending a lot of time to process each packet, so the more data you can fit in one packet, the better. There are several things that can be done to make the system faster. The one with the most impact is to compile your software with optimizations (-O2). I haven't used Eclipse in a while, but it should be somewhere in the project C/C++ settings. Compiling the project in Release mode instead of Debug might be enough to enable the optimizations. But if you already have 30Mbps with so small packets, maybe you are already using optimizations? Other than that you can use some hardware improvements. If your CPU doesn't have data or instruction caches, enable them. Add to your SOPC/QSYS project a double port packet memory, with one port connected to the DMAs and another to the CPU through a tightly coupled data port. You will also need to change some parameters in the software driver, the procedure is explained in application note 440 (http://www.altera.com/literature/an/an440.pdf). There are other optimizations that can be done, but they are much harder. Once I used a software profiler to find which functions were most used, and placed them in a tightly coupled instruction memory. Together with the data optimization, I managed to get a 100MHz Nios II system to send or receive data at about 80-100Mb/s, but I really think it is the maximum you can obtain with this TCP/IP stack. 400Mb/s seems rather unrealistic. You could try to use the LwIP stack instead (I think you'll find some threads about this stack on the forum) or move to a hardware solution, as shown in the offload example on the wiki (http://www.alterawiki.com/wiki/nios_ii_udp_offload_example).