10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
1. About This IP Core
Avalon-ST
Interface
Client
Module
Altera FPGA
10GbE MAC or
1G/10GbE MAC or
10M/100M/
1000M/10GbE MAC
External PHY
XAUI or
10GBASE-R or
Backplane Ethernet
10GBASE-KR PHY or
1G/10Gbps Ethernet
SDR XGMII/
GMII/MII
Serial
Interface
The 10-Gbps Ethernet (10GbE) Media Access Controller (MAC) IP core is a
configurable component that implements the IEEE 802.3-2008 specification. The IP
core offers the following modes:
■ 10 Gbps mode—uses the Avalon
side and the single data rate (SDR) XGMII on the network side.
■ 1 Gbps/10 Gbps mode— uses the Avalon-ST interface on the client side and
GMII/SDR XGMII on the network side.
■ 10 Mbps/100 Mbps/1 Gbps/10 Gbps (10M-10G) mode—uses the Avalon-ST
interface on the client side and MII/GMII/SDR XGMII on the network side.
To build a complete Ethernet subsystem in an Altera
external device, you can use the 10GbE MAC IP core with an Altera PHY IP core such
as a soft XAUI PHY in FPGA fabric, hard silicon-integrated XAUI PHY, a 10GBASE-R
PHY, a Backplane Ethernet 10GBASE-KR PHY, or a 1G/10 Gbps Ethernet PHY IP.
®
Streaming (Avalon-ST) interface on the client
®
device and connect it to an
Figure 1–1 illustrates a system with the 10GbE MAC IP core.
■ Avalon-ST 64-bit wide client interface running at 156.25 MHz.
■ Direct interface to 4-bit MII running at 125 MHZ with clock enable; 2.5 MHz for
10 Mbps and 25 MHz for 100 Mbps.
■ Direct interface to 8-bit GMII running at 125 MHZ.
■ Direct interface to 64-bit SDR XGMII running at 156.25 MHZ.
■ Virtual local area network (VLAN) and stacked VLAN tagged frames filtering as
specified by IEEE 802.IQ and 802.1ad (Q-in-Q) standards respectively.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
1–2Chapter 1: About This IP Core
■ Optional cyclic redundancy code (CRC)-32 computation and insertion on the
Release Information
transmit datapath; CRC checking on the receive datapath with optional
forwarding of the frame check sequence (FCS) field to the client application.
■ Checking of receive frames for FCS error, undersized and oversized frames, and
payload length error.
■ Deficit idle counter (DIC) for optimized performance with average inter-packet
gap (IPG) of 12 bytes for LAN applications.
■ Optional statistics collection on the transmit and receive datapaths.
■ Packets termination when the transmit datapath receives incomplete packets.
■ Programmable maximum length of transmit and receive frames up to
64 Kbytes (KB).
■ Programmable promiscuous (transparent) mode.
■ Optional Ethernet flow control and priority-based flow control (PFC) using pause
frames with programmable pause quanta. The PFC supports up to 8 priority
queues.
■ Optional padding termination on the receive datapath and insertion on the
transmit datapath.
■ Design examples with optional loopback and testbench for design verification.
■ Optional preamble passthrough mode on the transmit and receive datapaths. The
preamble passthrough mode allows you to define the preamble in the client frame.
■ Programmable datapath option to allow separate instantiation of MAC TX block,
MAC RX block, or both MAC TX and MAC RX blocks.
■ Optional IEEE 1588v2 feature for the following configurations:
■10GbE MAC with 10GBASE-R PHY MegaCore function
■1G/10GbE MAC with Backplane Ethernet 10GBASE-KR PHY MegaCore
function
■Multi-speed 10M-10GbE MAC with Backplane Ethernet 10GBASE-KR PHY
MegaCore function
1.2. Release Information
Tab le 1– 1 lists information about this release of the 10GbE MAC IP core.
Table 1–1. Release Information
Version13.1
Release DateNovember 2013
Ordering CodeIP-10GETHMAC
Product IDID 00D9
Vendor ID6AF7
ItemDescription
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 1: About This IP Core1–3
Device Family Support
1.3. Device Family Support
MegaCore functions provide the following support for Altera device families:
■ Preliminary support—Altera verifies the IP core with preliminary timing models for
this device family. The core meets all functional requirements, but might still be
undergoing timing analysis for the device family. It can be used in production
designs with caution.
■ Final support—Altera verifies the IP core with final timing models for this device
family. The core meets all functional and timing requirements for the device family
and can be used in production designs.
Tab le 1– 2 shows the level of support offered by the 10GbE MAC for the following
Altera device family.
Table 1–2. Device Family Support for 10GbE MAC
Device FamilySupport
®
II GX, GZFinal
Arria
Arria V GT, GX, and GZPreliminary
Arria V SoCPreliminary
®
Cyclone
Cyclone VPreliminary
Cyclone V SoCPreliminary
Stratix
Stratix IVFinal
Stratix VPreliminary
IV GXFinal
III Final
Tab le 1– 3 shows the devices supported by the different configurations.
Table 1–3. Device Family Support for Configurations
ConfigurationArria V GTArria V GZStratix V
Multi-Speed 10M-10GbE MAC—vv
Multi-Speed 10M-10GbE MAC with IEEE 1588v2—vv
10GbE MAC with 10GBASE-R PHYvvv
10GbE MAC with 10GBASE-R PHY and IEEE
1588v2
Multi-Speed 10M-10GbE MAC with Backplane
Ethernet 10GBASE-KR PHY
Multi-Speed 10M-10GbE MAC with Backplane
Ethernet 10GBASE-KR PHY and IEEE 1588v2
Multi-Speed 10M-10GbE MAC with 1G/10Gbps
Ethernet PHY
Multi-Speed 10M-10GbE MAC with 1G/10Gbps
Ethernet PHY and IEEE 1588v2
Note for Table 1–3:
(1) Supports only Arria V GT devices with speed grade of 3_H3.
v (1)vv
—vv
———
—vv
—vv
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
1–4Chapter 1: About This IP Core
IP Core Verification
1.4. IP Core Verification
To ensure compliance with the IEEE specification, Altera performs extensive
validation of the 10GbE MAC IP core. Validation includes both simulation and
hardware testing.
1.4.1. Simulation Environment
Altera performs the following tests in the simulation environment:
■ Directed tests that test all types and sizes of transaction layer packets and all bits of
the configuration space.
■ Error injection tests that inject errors in the link, transaction layer packets, and data
link layer packets, and check for the proper response from the IP core.
■ Random tests that test a wide range of traffic patterns across one or more virtual
channels.
1.4.2. Compatibility Testing Environment
Altera has performed significant hardware testing of the 10GbE MAC IP core to
ensure a reliable solution. The IP core has been tested with the following devices:
■ Arria V, Stratix IV, and Stratix V
■ Soft XAUI PHY
■ Soft and hard 10GBASE-R PHY
■ Hard Backplane Ethernet 10GBASE-KR PHY
■ 1G/10Gbps Ethernet PHY
The IP core has passed all interoperability tests conducted by the UNH. In addition,
Altera internally tests every release with the Spirent Ethernet and 10G testers.
1.5. Performance and Resource Utilization
Tab le 1– 4 provides the estimated performance and resource utilization of the 10GbE
MAC for the Cyclone IV device family. The estimates are obtained by compiling the
10GbE MAC with the Quartus II software targeting a Cyclone IV
(EP4CGX110DF31C7) device with speed grade –7.
1To achieve your timing requirement in the Quartus II software, Altera recommends
that you use multiple seeds in the Design Space Explorer to find the optimal Fitter
settings for your design, follow the recommendations of the Timing Optimization
Advisor, apply the Speed Optimization Technique and use the LogicLock regions.
Table 1–4. Cyclone IV Performance and Resource Utilization
All options enabled with
memory-based statistics counters
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
4,4243,2452>156.25
11,8458,35511>156.25
MAX
(MHz)
Chapter 1: About This IP Core1–5
Performance and Resource Utilization
Tab le 1– 5 provides the estimated performance and resource utilization of the
10GbE MAC for the Stratix IV device family. The estimates are obtained by compiling
the 10GbE MAC with the Quartus II software targeting a Stratix IV GX
(EP4SGX70HF35C2) device with speed grade –2.
Table 1–5. Stratix IV Performance and Resource Utilization
All options enabled with
memory-based statistics counters
All options enabled with
register-based statistics counters
1,9543,1570>156.25
5,6848,3497>156.25
8,13510,1173>156.25
Tab le 1– 6 provides the estimated performance and resource utilization of the
10GbE MAC for the Cyclone V device family. The estimates are obtained by compiling
the 10GbE MAC with the Quartus II software targeting a Cyclone V GX
(5CGXFC7D6F31C6) device with speed grade –6.
Table 1–6. Cyclone V Performance and Resource Utilization
All options enabled with
memory-based statistics counters
All options enabled with
register-based statistics counters
2,3223,4442>156.25
4,4175,4646>156.25
6,8677,1132>156.25
MAX
MAX
(MHz)
(MHz)
Tab le 1– 7 provides the estimated performance and resource utilization of the
10GbE MAC for the Stratix V device family. The estimates are obtained by compiling
the 10GbE MAC with the Quartus II software targeting a Stratix V GX
(5SGXEA7H3F35C3) device with speed grade –3.
Table 1–7. Stratix V Performance and Resource Utilization for 10GbE MAC (Part 1 of 2)
SettingsCombinational ALUTs
All options disabled
All options enabled with
memory-based statistics counters
All options enabled with
register-based statistics counters
2,0013,0770>156.25
5,7728,1977>156.25
8,2029,9653>156.25
Dedicated Logic
Registers
Memory Block (M20K)f
MAX
(MHz)
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
1–6Chapter 1: About This IP Core
Performance and Resource Utilization
Table 1–7. Stratix V Performance and Resource Utilization for 10GbE MAC (Part 2 of 2)
SettingsCombinational ALUTs
Dedicated Logic
Registers
IEEE 1588v2 feature enabled with
2-step synchronization
■ Timestamping is enabled
■ ptp_1step is disabled
4,8275,9218>156.25
IEEE 1588v2 feature enabled with
1-step and 2-step synchronization
■ Timestamping is enabled
■ ptp_1step is disabled
6,8227,92611>156.25
Tab le 1– 8 provides the estimated performance and resource utilization of the
multi-speed 10M-10GbE MAC for the Stratix V device family. The estimates are
obtained by compiling the 10M-10GbE MAC with the Quartus II software targeting a
Stratix V GX (5SGXEA7H3F35C3) device with speed grade –3.
Table 1–8. Stratix V Performance and Resource Utilization for 10M-10GbE MAC
SettingsCombinational ALUTs
All options disabled
All options enabled with
memory-based statistics counters
All options enabled with
register-based statistics counters
3,6544,6457>156.25
4,8775,79711>156.25
7,3137,5447>156.25
Dedicated Logic
Registers
Memory Block (M20K)f
Memory Block (M20K)f
MAX
MAX
(MHz)
(MHz)
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
2. Getting Started with Altera IP Cores
<path>
<IP core name>
Contains the IP core files and documentation
common
Contains shared components
Installation directory
ip
Contains the Altera IP Library and third-party IP cores
altera
Contains the Altera IP Library
This chapter provides a general overview of the Altera IP core design flow to help you
quickly get started with any Altera IP core. The Altera IP Library is installed as part of
the Quartus II installation process. You can select and parameterize any Altera IP core
from the library. Altera provides an integrated parameter editor that allows you to
customize IP cores to support a wide variety of applications. The parameter editor
guides you through the setting of parameter values and selection of optional ports.
The following sections describe the general design flow and use of Altera IP cores.
2.1. Installation and Licensing
The Altera IP Library is distributed with the Quartus II software and
downloadable from the Altera website (www.altera.com).
Figure 2–1 shows the directory structure after you install an Altera IP core, where
<
path> is the installation directory. The default installation directory on Windows is
C:\altera\<version number>; on Linux it is /opt/altera<version number>.
Figure 2–1. IP core Directory Structure
You can evaluate an IP core in simulation and in hardware until you are satisfied with
its functionality and performance. Some IP cores require that you purchase a license
for the IP core when you want to take your design to production. After you purchase
a license for an Altera IP core, you can request a license file from the Altera Licensing
page of the Altera website and install the license on your computer. For additional
information, refer to Altera Software Installation and Licensing.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
2–2Chapter 2: Getting Started with Altera IP Cores
Design Flows
2.2. Design Flows
You can use the following flow(s) to parameterize Altera IP cores:
■ “MegaWizard Plug-In Manager Flow”
■ “Qsys System Integration Tool Design Flow”
Figure 2–2 shows the design flows for the MegaWizard Plug-In Manager and Qsys
system integration tool.
Figure 2–2. Design Flows
Select Design Flow
Perform
Functional Simulation
Does
Simulation Give
Expected Results?
Debug Design
Qsys
Flow
Specify Parameters
Complete
Qsys System
Optional
Yes
and Compile Design
MegaWizard
Flow
Specify Parameters
Add Constraints
IP Complete
2.3. MegaWizard Plug-In Manager Flow
The MegaWizard Plug-In Manager flow allows you to customize the 10GbE MAC IP
core and manually integrate the function into your design.
2.3.1. Specifying Parameters
To specify the 10GbE MAC IP core parameters with the MegaWizard Plug-In
Manager, follow these steps:
1. Open an existing Quartus II project or create a new project using the New Project Wizard available from the File menu.
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 2: Getting Started with Altera IP Cores2–3
MegaWizard Plug-In Manager Flow
2. In the Quartus II software, launch the MegaWizard Plug-in Manager from the
Tools menu, and follow the prompts in the MegaWizard Plug-In Manager
interface to create or edit a custom IP core variation.
3. In the Installed Plug-Ins list on page 2a of the MegaWizard Plug-In Manager
interface, expand the Interfaces folder and then the Ethernet folder. Select
Ethernet 10G MAC. Specify the type and name of the output file you want to
create.
4. Specify the parameters on the Parameter Settings pages. For detailed explanations
of these parameters, refer to “10GbE MAC Parameter Settings” on page 2–6.
5. Specify appropriate options in the wizard to generate a simulation model.
1Altera IP supports a variety of simulation models, including
simulation-specific IP functional simulation models and encrypted RTL
models. These are all cycle-accurate models. The models allow for fast
functional simulation of your IP core instance using industry-standard
VHDL or Verilog HDL simulators.
f For more information about functional simulation models for Altera IP
cores, refer to Simulating Altera Designs in volume 3 of the Quartus II
Handbook.
cUse the simulation models only for simulation and not for synthesis or any
other purposes. Using these models for synthesis creates a nonfunctional
design.
6. Click Finish. The parameter editor generates the top-level HDL code for the
10GbE MAC IP core and a simulation directory which includes files for
simulation.
1The Finish button may be unavailable until all parameterization errors
listed in the messages window are corrected.
7. Click Yes if you are prompted to add the Quartus II IP File (.qip) to the current
Quartus II project. You can also turn on Automatically add Quartus II IP Files to all projects.
You can now integrate your custom 10GbE MAC IP core instance in your design,
simulate, and compile.
f For information about the Quartus II software and the MegaWizard Plug-In Manager,
refer to Quartus II Help.
2.3.2. Simulate the IP Core
You can simulate the 10GbE MAC IP core with the functional simulation model
generated by the Quartus II software. To perform a successful simulation of the 10GbE
MAC IP core using the MegaWizard Plug-In Manager flow, you are required to
compile all files listed in the <project directory>/<variation name>_sim output file.
Otherwise, the simulation may fail.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
2–4Chapter 2: Getting Started with Altera IP Cores
DDR3
SDRAM
Ethernet
Subsystem
Ethernet
Embedded Cntl
PCI Express
Subsystem
Qsys System
PCIe to Ethernet Bridge
PCIe
CSR
Mem
Mstr
Mem
Slave
PHY
Cntl
Mem
Mstr
CSR
DDR3
SDRAM
Controller
Qsys System Integration Tool Design Flow
f For more information about simulating Altera IP cores, refer to Simulating Altera
Designs in volume 3 of the Quartus II Handbook.
2.4. Qsys System Integration Tool Design Flow
You can use the Qsys system integration tool to build a system that includes your
customized IP core. You easily can add other components and quickly create a Qsys
system. Qsys automatically generates HDL files that include all of the specified
components and interconnections. In Qsys, you specify the connections you want.
The HDL files are ready to be compiled by the Quartus II software to produce output
files for programming an Altera device.
Figure 2–3 shows a high level block diagram of an example Qsys system.
Figure 2–3. Example Qsys System
f For more information about the Qsys system interconnect, refer to the Qsys
Interconnect chapter in volume 1 of the Quartus II Handbook and to the Avalon Interface
Specifications.
f For more information about the Qsys tool and the Quartus II software, refer to the
System Design with Qsys section in volume 1 of the Quartus II Handbook and to Quartus
II Help.
2.4.1. Specify Parameters
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
To specify parameters for your IP core using the Qsys flow, follow these steps:
1. Open an existing Quartus II project or create a new project using the New Project Wizard available from the File menu.
2. On the Tools menu, click Qsys.
3. On the Component Library tab, expand the Interfaces Protocols list and then the
Ethernet list. Double-click Ethernet 10G MAC to add it to your system. The
relevant parameter editor appears.
Chapter 2: Getting Started with Altera IP Cores2–5
Qsys System Integration Tool Design Flow
4. Specify the required parameters in the Qsys tool. For detailed explanations of
these parameters, refer to “10GbE MAC Parameter Settings” on page 2–6.
5. Click Finish to complete the IP core instance and add it to the system.
2.4.2. Complete the Qsys System
To complete the Qsys system, follow these steps:
1. Add and parameterize any additional components.
2. Connect the components using the Connections panel on the System Contents
tab.
3. In the Export As column, enter the name of any connections that should be a
top-level Qsys system port.
4. If you intend to simulate your Qsys system, on the Generation tab, turn on one or
more options under Simulation to generate desired simulation files.
5. If you want to generate synthesis RTL files, turn on Create HDL design files for synthesis.
6. Click Generate to generate the system. Qsys generates the system and produces
the <system name>.qip file that contains the assignments and information required
to process the IP core or system in the Quartus II Compiler.
7. In the Quartus II software, click Add/Remove Files in Project on the Project menu
and add the .qip file to the project.
8. Compile your design in the Quartus II software.
2.4.3. Simulate the System
During system generation, Qsys generates a functional simulation model which you
can use to simulate your system easily in any Altera-supported simulation tool.
f For information about the latest Altera-supported simulation tools, refer to the
Quartus II Software Release Notes.
f For general information about simulating Altera IP cores, refer to Simulating Altera
Designs in volume 3 of the Quartus II Handbook.
f For information about simulating Qsys systems, refer to the System Design with Qsys
section in volume 1 of the Quartus II Handbook.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
2–6Chapter 2: Getting Started with Altera IP Cores
10GbE MAC Parameter Settings
2.5. 10GbE MAC Parameter Settings
You customize the 10GbE MAC by specifying the parameters on the MegaWizard
Plug-in Manager, or Qsys in the Quartus II software. Tab le 2– 1 describes the
parameters and how they affect the behavior of the IP core.
Table 2–1. 10GbE Parameters
ParameterDescription
Use this parameter to select the speed options. By default, the 10G MAC option is
Speed select for 10G MAC
Preamble pass-through mode
Priority-based flow control (PFC)
Number of PFC priorities
Datapath option
Supplementary address
CRC on transmit path
Statistics collectionTurn on this parameter to collect statistics on the transmit and receive datapaths.
Statistics counters
Enable time stamping
Enable PTP 1-step clock support
Timestamp fingerprint width
selected. Select Enable 1G/10G MAC to implement the 10-Gbps and 1-Gbps MAC;
select Enable Multi-Speed 10M-10Gb MAC to implement the 10-Mbps, 100-Mbps, 1-
Gbps, and 10-Gbps MAC.
Turn on this parameter to enable the preamble passthrough mode. To enable the
preamble passthrough mode, you must turn on this parameter and set the
This parameter is disabled if you selected Enable 1G/10G MAC.
Turn on this parameter to enable PFC. Refer to “Priority-Based Flow Control” on
page 7–19 for more information on PFC and its operations.
Indicates the number of PFC priority levels that the 10GbE MAC IP core supports. The
valid range is from 2 to 8. This option is enabled only if you turn on the Priority-based flow control (PFC) parameter.
Use this parameter to select the datapath option that determines the MAC variation to
instantiate. By default, the TX & RX option is selected. The default datapath
instantiates the MAC TX and MAC RX blocks. Selecting TX only instantiates the MAC
TX block; selecting RX only instantiates the MAC RX block.
Turn on this parameter to enable supplementary addresses. To enable supplementary
addresses, you must turn on this parameter and set the
rx_frame_control
Turn on this parameter to calculate and insert CRC on the transmit datapath. To
compute and insert CRC on the transmit datapath, you must turn on this parameter
and set the
When you turn on Statistics collection, the default implementation of the statistics
counters is Memory-based.
Use Memory-based statistics counters to free up the logic elements (the MAC does
not clear the statistic counters after the counters are read); Register-based statistics
counters to free up the memory (the MAC clears the statistic counters after the
counters are read).
Register-based statistics counters are not supported for Cyclone IV GX devices.
Turn on this parameter to enable time stamping on the transmitted and received
frames.
Turn on this parameter to insert time stamp on PTP messages for 1-step clock based
on the TX Egress Timestamp Insert Control interface.
This parameter is disabled if you do not turn on Enable time stamping.
Use this parameter to set the width in bits for the time stamp fingerprint on the TX
path. The default value is 4 bits.
tx_crcins_control
register to 1.
registers to 1.
EN_SUPP0/1/2/3
[1] register bit to 1.
, and
bits in the
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
3. 10GbE MAC Design Examples
You can use the following 10GbE design examples and testbenches to help you get
started with the 10GbE MAC IP core and use the core in your design:
■ 10GbE MAC with XAUI PHY
■ 10GbE MAC with 10GBASE-R PHY
1XAUI PHY and 10GBASE-R PHY do not support Stratix III devices.
3.1. Software and Hardware Requirements
Altera uses the following hardware and software to test the 10GbE design examples
and testbenches:
■ Quartus II software 13.1
■ Stratix IV GX FPGA development kit (for XAUI PHY)
■ Transceiver Signal Integrity development kit, Stratix IV GT Edition (for
10GBASE-R PHY)
■ ModelSim
®
-AE 6.6c, ModelSim-SE 6.6c or higher
f For more information on the development kits, refer to the following documents:
■ Stratix IV GX Development Kit User Guide
■ Stratix IV GX Development Kit Reference Manual
■ Transceiver Signal Integrity Development Kit, Stratix IV GT Edition User Guide
■ Transceiver Signal Integrity Development Kit, Stratix IV GT Edition Reference Manual
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
Ethernet
Loopback
JTAG to Avalon Master
Bridge
Pipeline Bridge
10GbE MAC
XAUI
or
10GBASE-R
PHY
External
PHY
MDIO
64-bit Avalon-ST
64-bit Avalon-ST
32-bit
Avalon-MM
MDIO Signals
32-bit Avalon-MM
System Console
(for debugging)
XAUI / 10GBASE-R
72-bit SDR XGMII
72-bit SDR XGMII
Tx FIFO Buffer
Rx FIFO Buffer
Client
Application
Altera FPGA
Design Example
Client Application
(Configuration, Status, and
Statistics)
Avalon-ST
Single-Clock / Dual-Clock
FIFO
Configuration and Debugging Tools
32
64
64
72
72
72
72
32
64
64
3–2Chapter 3: 10GbE MAC Design Examples
10GbE Design Example Components
3.2. 10GbE Design Example Components
You can use the 10GbE MAC IP core design example to simulate a complete 10GbE
design in an Altera FPGA. You can compile the design example using the simulation
files generated by the Quartus II software and program the targeted Altera device
after a successful compilation.
Figure 3–1 shows the block diagram of the 10GbE design examples.
Figure 3–1. 10GbE Design Example Block Diagram
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 3: 10GbE MAC Design Examples3–3
10GbE Design Example Components
The design example comprises the following components:
■ 10GbE Ethernet MAC—the MAC IP core with default settings. This IP core
includes memory-based statistics counters.
■ XAUI PHY or 10GBASE-R PHY—the PHY IP core with default settings. The XAUI
PHY is set to Hard XAUI by default.
■ Ethernet Loopback— the loopback module provides a mechanism for you to
verify the functionality of the MAC and PHY. Refer to Section 3.2.0.1, Ethernet
Loopback Module for more information about this module.
■ RX and TX FIFO buffers—Avalon-ST Single-Clock or Dual-Clock FIFO cores that
buffer receive and transmit data between the MAC and client. These FIFO buffers
are 64 bits wide and 512 bits deep. The default configuration is Avalon-ST
Single-Clock FIFO, which operates in store and forward mode and you can
configure it to provide packet-based flushing when an error occurs.
1To enable the Avalon-ST Single-Clock FIFO to operate in cut through mode,
turn off the Use store and forward parameter in the Avalon-ST Single
Clock FIFO parameter editor.
■ Configuration and debugging tools—provides access to the registers of the
following components via the Avalon Memory-Mapped (Avalon-MM) interface:
MAC, MDIO, Ethernet loopback, PHY, and FIFO buffers. The provided testbench
includes an Avalon driver which uses the pipeline bridge to access the registers.
You can use the system console to access the registers via the JTAG to Avalon
Master Bridge core when verifying the design in the hardware.
f To learn more about the components, refer to the respective documents:
■ XAUI PHY and 10GBASE-R PHY, refer to Altera Transceiver PHY IP Core User
Guide.
■ Avalon-ST Single-Clock or Dual-Clock FIFO, JTAG to Avalon Master Bridge, and
MDIO cores, refer to Embedded Peripherals IP User Guide.
■ Pipeline bridge, refer to Avalon Memory-Mapped Bridges in volume 4 of the Quartus
II Handbook.
■ System Console, refer to Analyzing and Debugging Designs with the System Console in
volume 3 of the Quartus II Handbook.
3.2.0.1. Ethernet Loopback Module
You can enable one of the following loopback types:
■ Local loopback—turn on this loopback to verify the functionality of the MAC
during simulation. When you enable the local loopback, the Ethernet loopback
module takes the transmit frame from the MAC XGMII TX and loops it back to the
MAC XGMII RX datapath. During this cycle, the loopback module also forwards
the TX frame to the PHY. While the local loopback is turned on, the loopback
module ignores any frame it receives from the PHY.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
3–4Chapter 3: 10GbE MAC Design Examples
■ Line loopback—turn on this loopback to verify the functionality of the PHY when
10GbE Design Example Components
verifying the design example in hardware. When you enable the line loopback, the
Ethernet loopback module takes the XGMII RX signal received from the PHY and
loops it back to the PHY’s XGMII TX signal. During this cycle, the loopback
module also forwards the XGMII RX signal to the MAC. While the line loopback is
turned on, the loopback module ignores any frame transmitted from the MAC.
Tab le 3– 1 describes the registers you can use to enable or disable the desired loopback.
Table 3–1. Loopback Registers
Byte OffsetRegisterDescription
0x00
0x04Reserved—
0x08
line loopback
local loopback
Set this register to 1 to enable line loopback; 0 to disable it.
Set this register to 1 to enable local loopback; 0 to disable it.
3.2.0.2. Base Addresses
Tab le 3– 2 lists the design example components that you can reconfigure to suit your
verification objectives. To reconfigure the components, write to their registers using
the base addresses listed in the table and the register offsets described in the
components' user guides. Refer to Tab le 3– 1 for the Ethernet loopback registers.
Table 3–2. Base Addresses of Design Example Components
ComponentBase Address
10GbE MAC0x000
XAUI or 10GBASE-R PHY0x40000
MDIO0X10000
Ethernet loopback0x10200
RX FIFO (Avalon-ST Single-Clock FIFO)0x10400
TX FIFO (Avalon-ST Single-Clock FIFO)0x10600
1This design example uses a 19-bit width address bus to access the base address of
components other than the MAC.
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 3: 10GbE MAC Design Examples3–5
10GbE Design Example Files
3.3. 10GbE Design Example Files
Figure 3–2 shows the directory structure for the design examples and testbenches. The
..\csr_script directory contains the design example script files.
Figure 3–2. Design Example Folders
<ip_lib>/ethernet/altera_eth_10g_design_example
altera_eth_10g_mac_base_r
testbench
altera_eth_10g_mac_base_r_sv
testbench
altera_eth_10g_mac_xaui
testbench
altera_eth_10g_mac_xaui_sv
testbench
csr_scripts
design_example_components
source
Tab le 3– 3 lists the design example files. For the description of testbench files, refer to
Table 3–5 on page 3–10.
Table 3–3. 10GbE Design Example Files (Part 1 of 2)
File NameDescription
A Tcl script that creates a new Quartus II project
setup_proj.tcl
and sets up the project environment for your
design example. Not applicable for Stratix V
design.
A Tcl script that creates a new Quartus II project
setup_proj_sv.tcl
for Stratix V design and sets up the project
environment for your design example.
A Qsys file for the 10GbE MAC and XAUI PHY
altera_eth_10g_design_mac_xaui.qsys
design example. The PHY is set to hard XAUI by
default.
A Qsys file for the 10GbE MAC and XAUI PHY
altera_eth_10g_design_mac_xaui_sv.qsys
design example with the Quartus II software
targeting the Stratix V device. The PHY is set to
hard XAUI by default.
altera_eth_10g_design_mac_base_r.qsys
A Qsys file for the 10GbE MAC and 10GBASE-R
PHY design example.
A Qsys file for the 10GbE MAC and 10GBASE-R
altera_eth_10g_design_mac_base_r_sv.qsys
PHY design example with the Quartus II software
targeting the Stratix V device.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
3–6Chapter 3: 10GbE MAC Design Examples
Table 3–3. 10GbE Design Example Files (Part 2 of 2)
File NameDescription
A Tcl script that sets the pin assignments and I/O
setup_SIVGX230C2ES.tcl
setup_EP4S100G5H40I3.tcl
setup_5SGXEA7N2F40C2ES.tcl
top.sdc
top.v
top_sv.v
common.tcl
config.tclA Tcl script that configures the design example.
csr_pkg.tcl
show_stats.tcl
altera_eth_10g_design_example_hw.tcl
standards for the Stratix IV GX FPGA
development board. Use this Tcl script for the
10GbE MAC with XAUI PHY design example.
A Tcl script that sets the pin assignments and I/O
standards for the Stratix IV GT Signal Integrity
development board. Use this Tcl script for the
10GbE MAC with 10GBASE-R PHY design
example.
A Tcl script that sets the pin assignments and I/O
standards for the Stratix V GX Signal Integrity
development board. Use this Tcl script for the
10GbE MAC with 10GBASE-R PHY design
example.
The Quartus II SDC constraint file for use with
the TimeQuest timing analyzer.
The top-level entity file of the design example for
verification in hardware. Not applicable for
Stratix V design.
The top-level entity file of the design example—
with the Quartus II software targeting the
Stratix V device—for verification in hardware.
A Tcl script that contains basic functions based
on the system console APIs to access the
registers through the Avalon-MM interface.
A Tcl script that maps address to the Avalon-MM
control registers. The script contains APIs which
is used by config.tcl and show_stats.tcl.
A Tcl script that displays the MAC statistics
counters.
A hardware Tcl script that contains the
composition of the Ethernet system.
Creating a New 10GbE Design
3.4. Creating a New 10GbE Design
You can use the Quartus II software to create a new 10GbE design. Altera provides a
customizable Qsys design example file to facilitate the development of your 10GbE
design. Follow these steps to create the design:
1. Copy the respective design example directory to your preferred project directory:
altera_eth_10g_mac_xaui or altera_eth_10g_mac_base_r from
<ip library>/ethernet/altera_eth_10g_design_example.
2. Launch the Quartus II software and open the top.v file from the project directory.
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 3: 10GbE MAC Design Examples3–7
Creating a New 10GbE Design
3. Open the Quartus II Tcl Console window by pointing to Utility Windows on the
View menu and then selecting Tcl Co ns ol e. In the Quartus II Tcl Console window,
type the following command to set up the project environment:
source setup_proj.tcl
r
4. Load the pin assignments and I/O standards for the development board:
■For the 10GbE MAC with XAUI PHY design example, type the following
command:
source setup_SIVGX230C2ES.tcl
r
This command assigns the XAUI serial interface to the pins that are connected
to the HSMC Port A of the Stratix IV GX development board.
■For the 10GbE MAC with 10GBASE-R design example, type the following
command:
source setup_EP4S100G2F40I1.tcl
r
This command assigns the 10GBASE-R serial interface to the pins that are
connected to the SMA connectors (J38 to J41) of the Stratix IV GT development
board.
f For more information about the development boards, refer to the respective
reference manuals: Stratix IV GX Development Kit Reference Manual or
Transceiver Signal Integrity Development kit, Stratix IV GT Edition Reference
Manual.
5. Launch Qsys from the Tools menu and open the altera_eth_10g_mac_base_r.qsys
or altera_eth_10g_mac_xaui.qsys file. For design targeting the Stratix V device
family, use the altera_eth_10g_mac_base_r_sv.qsys or altera_eth_10g_mac_xaui_sv.qsys file.
1By default, the design example targets the Stratix IV device family. To
change the target device family, click on the Project Settings tab and select
the desired device from the Device family list.
6. Turn off the additional module under the Use column if your design does not
require them. This action disconnects the module from the 10GbE system.
7. Double-click eth_10g_design_example_0 to launch the parameter editor.
8. Specify the required parameters in the parameter editor. For detailed explanations
of these parameters, refer to “10GbE Design Example Parameter Settings” on
page 3–8.
9. Click Finish.
10. On the Generation tab, select either a Verilog HDL or a VHDL simulation model
and make sure that the Create HDL design files for synthesis option is turned on.
11. Click Generate to generate the simulation and synthesis files.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
3–8Chapter 3: 10GbE MAC Design Examples
10GbE Design Example Parameter Settings
3.5. 10GbE Design Example Parameter Settings
You can customize the 10GbE design example by specifying the parameters using the
parameter editor. Ta ble 3–4 describes these parameters.
Table 3–4. Design Example Parameters
NameValueDescription
Configuration
Specifies whether the Ethernet system requires a MDIO core to
access the external PHY device management registers for
configuration and management purposes.
Specifies which protocol-specific PHY IP core to use for the
Ethernet system. For XAUI PHY, you can choose to implement the
system in soft or hard logic.
Specifies which FIFO buffer to use for the Ethernet system. The
Avalon-ST Single Clock FIFO operates with a common clock for the
input and output ports while the Avalon-ST Dual Clock FIFO
operates with independent clocks for the input and output ports.
You cannot enable a different FIFO option for TX datapath and RX
datapath. If you select Avalon-ST Single Clock FIFO, the design
includes single clock FIFO at both TX and RX datapaths.
MDIO
PHY IP
FIFO
MDIO
None
XAUI PHY
10GBase-R PHY
None
Avalon-ST Single Clock FIFO
Avalon-ST Dual Clock FIFO
Avalon-ST Single Clock FIFO
+ Avalon-ST Dual Clock FIFO
None
1The parameter values you select on Configuration tab correspond with the
other tabs that require further parameterization. You should only
parameterize the components you selected and omit the others. Editing the
component parameters that were not selected may cause the system
generation to fail.
f For more information about the parameter settings of other components,
refer to the respective documents:
■ 10GbE MAC, refer to “10GbE MAC Parameter Settings” on page 2–6.
■ Avalon-ST Single-Clock or Dual-Clock FIFO and MDIO core, refer to
Embedded Peripherals IP User Guide.
■ XAUI PHY and 10GBASE-R PHY, refer to Altera Transceiver PHY IP Core
User Guide.
3.6. 10GbE Testbenches
Altera provides testbenches for you to verify the design examples. The following
sections in this document describe the testbench, its components, and use.
3.6.1. 10GbE Testbench
The testbenches operate in loopback mode. Figure 3–3 shows the flow of the packets.
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 3: 10GbE MAC Design Examples3–9
10GbE Testbenches
Figure 3–3. Testbench Block Diagram
Testbench
Ethernet
Packet
Avalon-MM
Control
Register
Avalon-ST
Transmit
Frame
Generator
Monitor
Avalon-ST
DUT
Avalon-MM
Loopback
on XGMII
Avalon-ST
Receive
Frame
Monitor
avalon_bfm_wrapper.sv
Avalon Driver
Avalon-ST
Ethernet
Monitor
3.6.2. 10GbE Testbench Component
The 10GbE testbench comprises the following modules:
■ Device under test (DUT)—the design example.
■ Avalon driver—uses Avalon-ST bus functional models (BFMs) to exercise the
transmit and receive paths. The driver also utilizes the Avalon-MM BFM to access
the Avalon-MM interfaces of the design example components.
■ Packet monitors—monitors the transmit and receive datapaths, and displays the
frames in the simulator console.
3.6.3. 10GbE Testbench Files
The following directories contain the 10GbE testbench files which are in clear text:
Packet
■ 10GbE MAC and XAUI PHY testbench—<ip library>/ethernet/
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
3–10Chapter 3: 10GbE MAC Design Examples
10GbE Testbenches
Tab le 3– 5 describes the files that implement the testbench.
Table 3–5. Testbench Files
File NameDescription
avalon_bfm_wrapper.sv
A wrapper for the Avalon BFMs that the avalon_driver.sv file
uses.
A SystemVerilog HDL driver that utilizes the BFMs to exercise
avalon_driver.sv
the transmit and receive path, and access the Avalon-MM
interface.
A SystemVerilog HDL testbench that contains parameters to
avalon_if_params_pkg.sv
configure the BFMs. Because the configuration is specific to
the DUT, you must not change the contents of this file.
avalon_st_eth_packet_monitor.sv
eth_mac_frame.sv
eth_register_map_params_pkg.sv
tb_run.tcl
tb_run_sv.tcl
A SystemVerilog HDL testbench that monitors the Avalon-ST
transmit and receive interfaces.
A SystemVerilog HDL class that defines the Ethernet frames.
The avalon_driver.sv file uses this class.
A SystemVerilog HDL package that maps addresses to the
Avalon-MM control registers.
A Tcl script that starts a simulation session in the ModelSim
simulation software. Not applicable for Stratix V design.
A Tcl script that starts a simulation session in the ModelSim
simulation software for Stratix V design only.
The top-level testbench file. This file includes the customized
tb.sv
10GbE MAC which is the device under test (DUT), a client
packet generator, and a client packet monitor along with
other logic blocks. Not applicable for Stratix V design.
The top-level testbench file for Stratix V design only. This file
tb_sv.sv
includes the customized 10GbE MAC which is the device
under test (DUT), a client packet generator, and a client
packet monitor along with other logic blocks.
wave.do
A signal tracing macro script to be used with the ModelSim
simulation software to display testbench signals.
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
Chapter 3: 10GbE MAC Design Examples3–11
10GbE Testbenches
3.6.4. 10GbE Testbench Simulation Flow
Upon a simulated power-on reset, each testbench performs the following operations:
1. Initializes the DUT by configuring the following options via the Avalon-MM
interface:
a. In the MAC, enables address insertion on the transmit path and sets the
transmit primary MAC address to EE-CC-88-CC-AA-EE.
b. In the TX and RX FIFO (Avalon-ST Single Clock FIFO core), enables drop on
error.
2. Starts packet transmission. The testbench sends a total of eight packets:
a. 64-byte basic Ethernet frame
b. Pause frame
c. 1518-byte VLAN frame
d. 1518-byte basic Ethernet frame
e. 64-byte stacked VLAN frame
f. 500-byte VLAN frame
g. Pause frame
h. 1518-byte stacked VLAN frame
3. Ends the transmission and displays the MAC statistics in the transcript pane.
3.6.5. Simulating the 10GbE Testbench with the ModelSim Simulator
To use the ModelSim simulator to simulate the testbench design, follow these steps:
1. Copy the respective design example directory to your preferred project directory:
altera_eth_10g_mac_xaui or altera_eth_10g_mac_base_r from
<ip library>/ethernet/altera_eth_10g_design_example.
2. The design example and testbench files are set to read only. Altera recommends
that you turn off the read-only attribute of all design example and testbench files.
3. Launch the Quartus II software and open the top.v file from the project directory.
4. Open the Quartus II Tcl Console window by pointing to Utility Windows on the
View menu and then selecting Tcl Co ns ol e. In the Quartus II Tcl Console window,
type the following command to set up the project environment:
source setup_proj.tcl
5. Launch Qsys from the Tools menu and open altera_eth_10g_mac_base_r.qsys or
altera_eth_10g_mac_xaui.qsys in the File menu.
r
6. For the 10GbE MAC with XAUI design example, the default setting of the XAUI
PHY is Hard XAUI. Follow these steps if you want to set the PHY to Soft XAUI:
a. Double-click the XAUI PHY module to open the parameter editor.
b. On the General Options tab, select Soft XAUI for XAUI Interface Type.
7. On the Generation tab, select Verilog simulation model.
February 2014 Altera Corporation10-Gbps Ethernet MAC MegaCore Function User Guide
3–12Chapter 3: 10GbE MAC Design Examples
10GbE Testbenches
8. Click Generate to generate the system.Launch the ModelSim simulator software.
9. Change the working directory to <project directory>/<design example directory>/testbench in the File menu.
10. Run the following command to set up the required libraries, compile the
generated IP Functional simulation model, and exercise the simulation model with
the provided testbench:
do tb_run.tcl
r
The ModelSim transcript pane in Main window displays messages from the
testbench reflecting the current task being performed.
Upon a successful simulation, the simulator displays the following
and
You can turn on local loopback to verify the functionality of the MAC during
simulation. Follow these steps to enable local loopback:
1. Open the tb.sv file.
2. Insert the command
offset is the sum of the base address of the loopback module and the register offset,
and value is the value to write to the register.
3. Set value to 1 to enable local loopback; 0 to disable it. Altera recommends that you
insert the command after the command that configures the RX FIFO. For example,
the following code segment enables local loopback:
10-Gbps Ethernet MAC MegaCore Function User GuideFebruary 2014 Altera Corporation
U_AVALON_DRIVER.avalon_mm_csr_wr(offset,value)
where
Loading...
+ 145 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.