Type: Answers

Area: Intellectual Property


IP Product: Triple Speed Ethernet MAC

The performance of the Triple-Speed Ethernet (TSE) MAC when used with the NicheStack networking stack seems slow for Quartus II software version 8.0. What is causing this problem?

Description

There's a bug in the TSE MAC driver which causes a sent packet to be unecessarily copied into a temporary buffer before being dispatched to the TSE driver. The code section in which this bug is found is performing a conditional copy of a packet's contents to transform it from being word-unaligned to word aligned. The bug in this section of the driver arises because of a pointer dereferencing error, which is easily fixable through the steps outlined below:

1) Locate your Quartus® II IP directory installation, version 8.0: The default path for the root directory is typically C:\altera\80\ip on a Windows workstation.

2) Locate the TSE MAC driver folder: In the directory mentioned above, go into the triple_speed_ethernet\lib\sopc_builder\altera_triple_speed\UCOSII\src\iniche directory.

3) Modify the file ins_tse_mac.c : Open the file ins_tse_mac.c in a text editor. Locate the function tse_mac_raw_send, and within the body of this function, find the code block which looks like this:

if

(((unsigned int)*data & 0x03) == 0)
{

/* 32-bit aligned start, then header starts ETHHDR_BIAS later => 16 bit shift is ok */

ActualData = (unsigned int*)data;
/* base driver will detect 16-bit shift. */
}

Remove the asterisk from the data variable, so that the function now looks like this:

if

(((unsigned int)data & 0x03) == 0)
{
/* 32-bit aligned start, then header starts ETHHDR_BIAS later => 16 bit shift is ok */
ActualData = (unsigned int*)data; /* base driver will detect 16-bit shift. */
}

Once you have done this, save and close the file.

After you have performed these steps, the next time you generate any project making use of the TSE MAC and NicheStack your project sources will contain the fix.

Note: If you have already generated your software project from a template, you can just modify the local copy of ins_tse_mac.c, which resides in your project's system library folder. Follow the instructions in step #3 (above), then rebuild your application.