Sleep mode, Magic packet detection, Mac local loopback – Altera Triple Speed Ethernet MegaCore Function User Manual
Page 54: Mac local loopback -18

Sleep Mode
You can only put a node to sleep (set
SLEEP
bit in the
command_config
register to 1 and deassert the
magic_sleep_n
signal) if magic packet detection is enabled (set the
MAGIC_ENA
bit in the
command_config
register to 1).
Altera recommends that you do not put a node to sleep if you disable magic packet detection.
Network transmission is disabled when a node is put to sleep. The receiver remains enabled, but it ignores
all traffic from the line except magic packets to allow a remote agent to wake up the node. In the sleep mode,
only
etherStatsPkts
and
etherStatsOctets
count the traffic statistics.
Magic Packet Detection
Magic packet detection wakes up a node that was put to sleep. The MAC function detects magic packets
with any of the following destination addresses:
• Any multicast address
• A broadcast address
• The primary MAC address configured in the
mac_0
and
mac_1
registers
• Any of the supplementary MAC addresses configured in the following registers if they are enabled:
smac_0_0
,
smac_0_1
,
smac_1_0
,
smac_1_1
,
smac_2_0
,
smac_2_1
,
smac_3_0
and
smac_3_1
When the MAC function detects a magic packet, the
WAKEUP
bit in the
command_config
register is set to 1,
and the
etherStatsPkts
and
etherStatsOctets
statistics registers are incremented.
Magic packet detection is disabled when the
SLEEP
bit in the
command_config
register is set to 0. Setting the
SLEEP
bit to 0 also resets the
WAKEUP
bit to 0 and resumes the transmit and receive operations.
MAC Local Loopback
You can enable local loopback on the MII/GMII/RGMII of the MAC function to exercise the transmit and
receive paths. If you enable local loopback, use the same clock source for both the transmit and receive clocks.
If you use different clock sources, ensure that the difference between the transmit and receive clocks is less
than ±100 ppm.
To enable local loopback:
1. Initiate software reset by setting the
SW_RESET
bit in
command_config
register to 1.
Software reset disables the transmit and receive operations, flushes the internal FIFOs, and clears the
statistics counters. The
SW_RESET
bit is automatically cleared upon completion.
2. When software reset is complete, enable local loopback on the MAC's MII/GMII/RGMII by setting the
LOOP_ENA
bit in
command_config
register to 1.
3. Enable transmit and receive operations by setting the
TX_ENA
and
RX_ENA
bits in
command_config
register
to 1.
4. Initiate frame transmission.
5. Compare the statistics counters
aFramesTransmittedOK
and
aFramesReceivedOK
to verify that the
transmit and receive frame counts are equal.
6. Check the statistics counters
ifInErrors
and
ifOutErrors
to determine the number of packets
transmitted and received with errors.
7. To disable loopback, initiate a software reset and set the
LOOP_ENA
bit in
command_config
register to 0.
Functional Description
Altera Corporation
UG-01008
Sleep Mode
4-18
2014.06.30