Fpga Et Ethernet
Fpga Et Ethernet
Fpga Et Ethernet
Patrick Nayman
Introduction
Raliser une connexion rapide entre un FPGA et un systme hte avec ETHERNET 10-100-1000 Mbits (vitesse relle). Avantages
Rapide Possibilit dun cble relativement long Full duplex Debugger gratuit TCPDUMP (linux) , WireShark (Windows) Mise en uvre relativement facile
Interface FPGA/ETHERNET
Les Composants
FPGA ALTERA srie Cyclone (Stratix galement) Bas sur un core GEDEK UDP (socit ALSE)
Restriction : ncessite une liaison point point (pas de collision)
Non compatible avec les anciens PHY/MAC Transformateur (peut tre inclus dans la prise RJ45)
Interface FPGA/ETHERNET
Connexion Rseau
Encapsulation of Application Data Application Transport (TCP or UDP) Internet Link
UDP (User Datagram Protocol) : simpler messaging transmissions TCP (Transmission Control Protocol): more complex protocol reliable transmission when collisions
Interface FPGA/ETHERNET 4
Implmentation
Utilisation dUDP (standard de transmission) la place de TCP
Faibles ressources utilises: low cost FPGA (~30) Plus rapide
Interface FPGA/ETHERNET
LInterface globale
GMII FPGA MDIO
MARVELL 88E1119R
LEDs
Gigabit PHY
RJ45+ Magntique
Interface FPGA/ETHERNET
Interface FPGA/ETHERNET
LInterface FPGA-Marvell
Ce qui entre et sort du FPGA
Vers le MARVELL
Clock pour gigabit (125MHz) Management Interface Clock (1MHz) Management Interface I/O Bidir Data envoyer (8 ou 4 bits) Data Enable : etx_d valide
erx_d/etx_d :
Interface FPGA/ETHERNET
Exemple de Projet
: Media Independant Interface : Media Access Control : User Datagram Protocol : Internet Control Message Protocol Interface FPGA/ETHERNET : Address Resolution Protocol
Interface FPGA/ETHERNET
10
FPGA Board MAC Address Destination MAC Address Destination IP Address Etc.
-- interface register Cpu_Sel Cpu_R Cpu_W Cpu_Ad Cpu_Wdata Cpu_RData Cpu_WaitRequest
Interface FPGA/ETHERNET
11
Linterface de donnes
REF_UserRxUDP_Sop : Out REF_UserRxUDP_Eop : Out REF_UserRxUDP_Dav : Out REF_UserRxUDP_Data: Out REF_UserTxUDP_Busy : Out REF_UserTxUDP_Sop : in REF_UserTxUDP_Eop : in REF_UserTxUDP_Dav : in REF_UserTxUDP_Data : in REF_UserDest_Port : in Std_logic; -- Flag indicating a new frame, Rx side Std_logic; -- Flag indicating a end of frame, Rx side Std_logic; -- Flag indicating that data is valid, Rx side Std_logic_vector(31 downto 0); -- Data, Rx side Std_logic; -- Signal indicating that the Gedek IP is ready Std_logic; -- Flag indicating a new frame, Tx side Std_logic; -- Flag indicating a end of frame, Tx side Std_logic; -- Flag indicating that data is valid, Tx side Std_logic_vector(31 downto 0); -- Data, Tx side Std_logic_vector(15 downto 0); -- PN
Interface FPGA/ETHERNET
12
2- Dans QUARTUS : Settings/Assignments/Device and Pin Options/Dual-Purpose Pins Data[0] Use as regular I/O Data[1] Use as regular I/O DCLK Use as regular I/O Flash_nCE/nCS Use as regular I/O
Interface FPGA/ETHERNET
13
Interface FPGA/ETHERNET
14
Les Signaux
Flot : Start of Protocol, Data/Data Valid, End of Protocol En lecture ETH vers FPGA
Interface FPGA/ETHERNET
15
- On peut utiliser PLLLocked pour faire un Reset : Resetb <= not PLLLocked;
Interface FPGA/ETHERNET
16
Interface FPGA/ETHERNET
17
Top_dbm
1 2
Interface FPGA/ETHERNET
18
Fifo_Tx
Ref_UserTxUDP_Busy Ref_UserTxUDP_Data (31:0)
1 2 3 4
Interface FPGA/ETHERNET
19
| | | | | |
Etat sSending
Etat sEnd
Et en global :
RdReq <= '1' when (UserSdState=sSending) and FifoTx_Empty ='0' and RefUserTx_Busy='0' else'0';
Interface FPGA/ETHERNET 20
Interface FPGA/ETHERNET
21
Address 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F
Interface FPGA/ETHERNET
Interface FPGA/ETHERNET
23
Pour simuler !
2 fichiers txt : input et output
Input dfinit les commandes ETHERNET Output donnera le rsultat de la simulation
Interface FPGA/ETHERNET
24
Exemple de input.txt
# Wait Delay: The provided integer is the waiting time in us # S2 # Ping Frame -> Command is 'P' # First Parameter is the IP of the ping sender (here source ip is c0.a8.01.00 = 192.168.1.0) # Second Parameter is the target IP (here destination ip is c0.a8.01.17 = 192.168.1.23) # P c0a80100 c0a80117 # Data Frame -> Command is 'D' # The 'D' command is followed by the destination port then the origin port in decimal !! # The Frame content is provided on the same line with always 8 hexa. digits (ie 0 => 00000000) # # CNTRLNectarReg # D 04D2 4096 AAAAAAAA 00007E3E 00000001 00000002 00000003 00000004 00000005 AAAAAAAA
Interface FPGA/ETHERNET
25
Exemple de output.txt
0D 0A 47 45 44 45 4B 20 2D 20 44 65 66 61 75 6C 74 20 20 28 63 29 20 32 30 30 39 20 41 4C 53 45 2E 46 52 @11977.502 ns => Data Frame to 192.168.1.207:1200 BBBBBBBB 0000EE10 EDA1B2C4 C0A80112 66322E2A 66320019 C0A801CF C0A801CF BBBBBBBB
@15292.502 ns => Data Frame to 192.168.1.207:1200 AAAAAAAA 0000CCC3 C0A80112 00000001 AAAAAAAA
Interface FPGA/ETHERNET
26
Interface FPGA/ETHERNET
27
Interface FPGA/ETHERNET
28
Etc.
Interface FPGA/ETHERNET 29
CONCLUSIONS
Interface FPGA/ETHERNET
30