Enabling local loopback, Enabling local loopback –12 – Altera 10-Gbps Ethernet MAC MegaCore Function User Manual

Page 30

Advertising
background image

3–12

Chapter 3: 10GbE MAC Design Examples

10GbE Testbenches

10-Gbps Ethernet MAC MegaCore Function User Guide

February 2014

Altera Corporation

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 RX Statistics
and TX Statistics:

# framesOK = 8
# framesErr = 0
# framesCRCErr = 0
# octetsOK = 5138
# pauseMACCtrlFrames = 2
# ifErrors = 0
# unicastFramesOK = 4
# unicastFramesErr = 0
# multicastFramesOK = 1
# multicastFramesErr = 0
# broadcastFramesOK = 1
# broadcastFramesErr = 0
# etherStatsOctets = 5310
# etherStatsPkts = 8
# etherStatsUndersizePkts = 0
# etherStatsOversizePkts = 0
# etherStatsPkts64Octets = 4
# etherStatsPkts65to127Octets = 0
# etherStatsPkts128to255Octets = 0
# etherStatsPkts256to511Octet = 1
# etherStatsPkts512to1023Octets = 0
# etherStatsPkts1024to1518Octets = 3
# etherStatsPkts1519OtoXOctets = 0
# etherStatsFragments = 0
# etherStatsJabbers = 0
# etherStatsCRCErr = 0
# unicastMACCtrlFrames = 1
# multicastMACCtrlFrames = 1
# broadcastMACCtrlFrames = 0

3.6.6. Enabling Local Loopback

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 U_AVALON_DRIVER.avalon_mm_csr_wr(offset,value) where

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:

Advertising