OpenCores
URL https://opencores.org/ocsvn/xge_mac/xge_mac/trunk

Subversion Repositories xge_mac

[/] [xge_mac/] [trunk/] [README.TXT] - Blame information for rev 21

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 antanguay
 
2
========================
3
10GE MAC Core
4
========================
5
 
6 6 antanguay
 
7
------------------------
8
1. Directory Structure
9
------------------------
10
 
11
The directory structure for this project is shown below.
12
 
13
.
14
|-- doc                 - Documentation files
15
|
16
|-- rtl
17
|   |-- include         - Verilog defines and utils
18
|   `-- verilog         - Verilog source files for xge_mac
19
|
20
|-- sim
21
|   |-- systemc         - SystemC simulation directory
22
|   `-- verilog         - Verilog simulation directory
23
|
24
`-- tbench
25
    |-- systemc         - SystemC test-bench source files
26
    `-- verilog         - Verilog test-bench source files
27
 
28
 
29
 
30
------------------------
31
2. Simulation
32
------------------------
33
 
34
There are two simulation environments that can be used to validate the code.
35
The verilog simulation is very basic and meant for those who want to look
36
at how the MAC operates without going through the effort of setting up SystemC.
37
The SystemC environment is more sophisticated and covers all features of the MAC.
38
 
39
 
40
 
41
------------------------
42
2.1 Verilog Simulation
43
------------------------
44
 
45
To run the verilog simulation, compile all project files under rtl/verilog along with
46
top level testbench file:
47
 
48
  - tbench/verilog/tb_xge_mac.v
49
 
50
There is a Modelsim "do" file called "sim.do" under sim/verilog for those using Modelsim.
51
Once all the files are compiled, start simulation using entity "tb".
52
 
53
 
54
The verilog simulation reads packets from "packet_tx.txt" and writes them to the MAC
55
transmit fifo using the packet transmit interface (pkt_tx_data). As frames become
56
available in the transmit fifo, the MAC calulates the CRC and sends them out on xgmii_tx.
57
The xgmii_tx interface is looped-back to xgmii_rx in the testbench. The frames are thus
58
processed by the MAC receive engine and stored in the receive fifo. The testbench reads
59
frames from the receive interface (pkt_rx_data) and prints out the results.
60
 
61
 
62 21 antanguay
Simulation output:
63 6 antanguay
 
64 21 antanguay
  ------------------------
65
  Received Packet
66
  ------------------------
67
  0000010000010010
68
  9400000288b50001
69
  0203040506070809
70
  0a0b0c0d0e0f1011
71
  1213141516171819
72
  1a1b1c1d1e1f2021
73
  2223242526272829
74
  2a2b2c2d2e2f3031
75
  3233343506b33d40
76
  ------------------------
77
  All packets received. Sumulation done!!!
78
 
79
 
80 6 antanguay
------------------------
81
2.2 SystemC Simulation
82
------------------------
83
 
84
In order to use the SystemC environment it is required to first install SystemC from
85
www.systemc.org. Free membership may be required to download the core SystemC files.
86
 
87
The testbench was developed and tested with Verilator, a free HDL simulator that
88
compiles verilog into C++ or SystemC code. You can download Verilator from
89
www.veripool.org. You also need to install SystemPerl and Verilog-Perl for waveform
90
traces.
91
 
92
 
93
Once all the required tools are installed:
94
 
95
  - Move to directory sim/systemc
96
 
97
  - Type "./compile.sh"
98
 
99
  - Type "./run.sh"
100
 
101
 
102
If the simulation is running correctly you should see messages from the scoreboard
103
as packets are transmited and received on the various interfaces.
104
 
105
Simulation output:
106
 
107
    -----------------------
108 21 antanguay
    Packet size
109 6 antanguay
    -----------------------
110
    SCOREBOARD XGMII INTERFACE TX (60)
111
    SCOREBOARD XGMII INTERFACE TX (60)
112
    SCOREBOARD PACKET INTERFACE TX (50)
113
    SCOREBOARD XGMII INTERFACE TX (60)
114
    SCOREBOARD PACKET INTERFACE TX (51)
115
    SCOREBOARD XGMII INTERFACE TX (60)
116
    SCOREBOARD PACKET INTERFACE RX (TX SIZE=60  RX SIZE=60)
117
    ...

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.