FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP

UDP for TSE MAC

Altera_Forum
Honored Contributor II
1,519 Views

Hi all, 

 

Currently I am using TSE MAC, but is there any UDP Verilog module already available to connect with TSE MAC? I tried to search around but can not find one. Thanks a lot!
0 Kudos
15 Replies
Altera_Forum
Honored Contributor II
423 Views
0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Thanks, it's exactly what I need!

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

 

--- Quote Start ---  

Have a look here (http://www.alterawiki.com/wiki/nios_ii_udp_offload_example). 

--- Quote End ---  

 

 

It seems that the NiosIIUDOffloadExample does not work for Stratix III FPGA. When I compile the software in Nios IDE, errors show up when compile "alt_sys_init.c" file. What's wrong with it?
0 Kudos
Altera_Forum
Honored Contributor II
423 Views

First you have to redo the hardware project to be sure it is adapted to your board. Then you need to check that your SOPC configuration has everything that is required by the software. The error while compiling is probably coming from the fact that some required SOPC components are missing, or don't have the name that the software expected. Check also that the software project is pointing to the correct hardware description.

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Hi, Daixiwen, Errors still show up even I use the original hardware description to compile in Nios. The error information is as follows:  

 

system_description/alt_sys_init.c:128: error: `GENERATOR_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:128: error: (Each undeclared identifier is reported only once 

system_description/alt_sys_init.c:128: error: for each function it appears in.) 

system_description/alt_sys_init.c:128: error: `generator_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:129: error: `GENERATOR_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:129: error: `generator_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:130: error: `GENERATOR_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:130: error: `generator_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:131: error: `GENERATOR_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:131: error: `generator_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:132: warning: implicit declaration of function `UDP_PAYLOAD_INSERTER_INIT' 

system_description/alt_sys_init.c:132: error: `UDP_INSERTER_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:132: error: `udp_inserter_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:133: error: `UDP_INSERTER_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:133: error: `udp_inserter_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:134: error: `UDP_INSERTER_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:134: error: `udp_inserter_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:135: error: `UDP_INSERTER_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:135: error: `udp_inserter_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:136: warning: implicit declaration of function `ERROR_PACKET_DISCARD_INIT' 

system_description/alt_sys_init.c:136: error: `ERROR_DISCARD' undeclared (first use in this function) 

system_description/alt_sys_init.c:136: error: `error_discard' undeclared (first use in this function) 

system_description/alt_sys_init.c:137: warning: implicit declaration of function `UDP_PORT_TO_CHANNEL_MAPPER_INIT' 

system_description/alt_sys_init.c:137: error: `UDP_MAPPER' undeclared (first use in this function) 

system_description/alt_sys_init.c:137: error: `udp_mapper' undeclared (first use in this function) 

system_description/alt_sys_init.c:138: warning: implicit declaration of function `OVERFLOW_PACKET_DISCARD_INIT' 

system_description/alt_sys_init.c:138: error: `OVERFLOW_DISCARD' undeclared (first use in this function) 

system_description/alt_sys_init.c:138: error: `overflow_discard' undeclared (first use in this function) 

system_description/alt_sys_init.c:139: warning: implicit declaration of function `UDP_PAYLOAD_EXTRACTOR_INIT' 

system_description/alt_sys_init.c:139: error: `EXTRACTOR_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:139: error: `extractor_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:140: error: `EXTRACTOR_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:140: error: `extractor_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:141: error: `EXTRACTOR_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:141: error: `extractor_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:142: error: `EXTRACTOR_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:142: error: `extractor_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:143: warning: implicit declaration of function `PRBS_PACKET_CHECKER_INIT' 

system_description/alt_sys_init.c:143: error: `CHECKER_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:143: error: `checker_0' undeclared (first use in this function) 

system_description/alt_sys_init.c:144: error: `CHECKER_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:144: error: `checker_1' undeclared (first use in this function) 

system_description/alt_sys_init.c:145: error: `CHECKER_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:145: error: `checker_2' undeclared (first use in this function) 

system_description/alt_sys_init.c:146: error: `CHECKER_3' undeclared (first use in this function) 

system_description/alt_sys_init.c:146: error: `checker_3' undeclared (first use in this function) 

make[1]: *** [obj/alt_sys_init.o] Error 1 

make: *** [system_project] Error 2 

 

I checked the original "alt_sys_init.c" file and found that there was no operation on these IPs for the protocol. Do I miss something? Thanks!
0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Which "original hardware description" are you using? The one from the kit? 

It looks like you are missing all the acceleration components in your hardware description. You need to add them to your SOPC project.
0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Hi, thanks for the reply. What do you mean the "acceleration components"? I have added the IP components concerning the Ethernet packet formulation.

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

the hardware description i'm using is the one i build the SOPC system by following the example step by step and have the complete compilation.

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Could you check the system.h file in the system_description folder, and verify that it contains the definitions for those IP components (look for GENERATOR_0, for example)?

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

I found the definitions for these IP components in my "system.h" file. The file is also attached in the following.

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

It looks fine indeed... Could you also attach your alt_sys_init.c ? Maybe something went wrong when it was generated.

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Please find the "alt_sys_init.c" in the following.

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

Hi, Daixiwen, I also have another question about this example. I find that the packet format is different from the typical UDP packet. In this case, can we transfer data from the board to the PC via UDP? Also do we need to rewrite our own packet receive application code to get the data, rather than using "recvfrom()" socket? Thanks!

0 Kudos
Altera_Forum
Honored Contributor II
423 Views

It seems that there is something wrong in your bsp generation... The acceleration components have this line in their *_sw_tcl file: 

set_sw_property auto_initialize falseand this should instruct the tools not to put the *_INIT macros in the alt_sys_init() function. 

What version of quartus/Nios do you use? I tried to compile the example with both 8.0 and 9.0SP2 (I don't have 10.0) and in both cases it created the alt_sys_init() without those macro calls. Did you do any change to the *_sw.tcl files in the components? 

As a temporary workaround you can comment those lines in alt_sys_init.c, but you,ll need to do that again each time it is regenerated: 

void alt_sys_init( void ) { ALTERA_AVALON_TIMER_INIT( SYS_CLK_TIMER, sys_clk_timer ); ALTERA_AVALON_TIMER_INIT( HIGHT_RES_TIMER, hight_res_timer ); ALTERA_AVALON_TIMER_INIT( STAT_TIMER, stat_timer ); ALTERA_AVALON_CFI_FLASH_INIT( EXT_FLASH, ext_flash ); ALTERA_AVALON_JTAG_UART_INIT( JTAG_UART, jtag_uart ); ALTERA_AVALON_SYSID_INIT( SYSID, sysid ); TRIPLE_SPEED_ETHERNET_INIT( TSE_MAC, tse_mac ); ALTERA_AVALON_SGDMA_INIT( SGDMA_TX, sgdma_tx ); ALTERA_AVALON_SGDMA_INIT( SGDMA_RX, sgdma_rx ); /* PRBS_PACKET_GENERATOR_INIT( GENERATOR_0, generator_0 ); PRBS_PACKET_GENERATOR_INIT( GENERATOR_1, generator_1 ); PRBS_PACKET_GENERATOR_INIT( GENERATOR_2, generator_2 ); PRBS_PACKET_GENERATOR_INIT( GENERATOR_3, generator_3 ); UDP_PAYLOAD_INSERTER_INIT( UDP_INSERTER_0, udp_inserter_0 ); UDP_PAYLOAD_INSERTER_INIT( UDP_INSERTER_1, udp_inserter_1 ); UDP_PAYLOAD_INSERTER_INIT( UDP_INSERTER_2, udp_inserter_2 ); UDP_PAYLOAD_INSERTER_INIT( UDP_INSERTER_3, udp_inserter_3 ); ERROR_PACKET_DISCARD_INIT( ERROR_DISCARD, error_discard ); UDP_PORT_TO_CHANNEL_MAPPER_INIT( UDP_MAPPER, udp_mapper ); OVERFLOW_PACKET_DISCARD_INIT( OVERFLOW_DISCARD, overflow_discard ); UDP_PAYLOAD_EXTRACTOR_INIT( EXTRACTOR_0, extractor_0 ); UDP_PAYLOAD_EXTRACTOR_INIT( EXTRACTOR_1, extractor_1 ); UDP_PAYLOAD_EXTRACTOR_INIT( EXTRACTOR_2, extractor_2 ); UDP_PAYLOAD_EXTRACTOR_INIT( EXTRACTOR_3, extractor_3 ); PRBS_PACKET_CHECKER_INIT( CHECKER_0, checker_0 ); PRBS_PACKET_CHECKER_INIT( CHECKER_1, checker_1 ); PRBS_PACKET_CHECKER_INIT( CHECKER_2, checker_2 ); PRBS_PACKET_CHECKER_INIT( CHECKER_3, checker_3 ); */ } 

 

As for your second questions, the packets generated or received by the hardware have the Ethernet, IP and UDP header in addition to the data, so this may be why they look different. 

In this system you can have both hardware and software handled packets. The idea is to handle the low bandwidth traffic in software (through the standard BSD sockets API, including recvfrom) and handle the high bandwidth traffic directly in hardware (through the acceleration components).
0 Kudos
Altera_Forum
Honored Contributor II
423 Views

I did not change anything about *_sw.tcl files in the components, and I compiled the example in Quartus II 8.0. All the files in the acceleration components are used directly without any change. Now the situation is that such errors did not show up when compiling the example directly. However, I changed the device from Stratix II GX to Stratix III, and also changed the ddr2 dram configuration. Without any other changes, I compiled the project and still got the same errors. I don't understand the reason.

0 Kudos
Reply