FPGARelated.com
Forums

ETHERNET MAC

Started by ashwin October 25, 2005
Hello Everyone,
 I am doing a project on Implementing 10/100 ethernet mac on a fpga
using vhdl. I saw the link on fpga4fun.com, its implemented in verilog
and also i am not sure why he included ipaddreses and udp header. i
guess mac addresses of PC and fpga board should be sufficient.
 I have many questions on this. Infact i would like to speak with  or
chat with anyone who know something about this. I would really
appreciate if you could give your messenger id or telephone number so
that i can discuss about this for sometime.

MY MAIN OBJECTIVE AND FEW QUESTIONS:

I am implementing Ethernet MAC(ethernet packet transmit and receive
modules) on fpga using vhdl and i am trying to transfer the data
between the xilinx virtex 4 fpgaboard and the PC through the ethernet
cable. There is a DP83847 Ethernet PHY chip on the fpga board. I need
to test this chip, by sending and receiving ethernet frames between
fpga and PC. I am attaching the xilinx virtex-4 fpga manual(page
17-ethernet) and the DP83847 ethernet data sheet for your reference.
   I am able to hardware reset the PHY on the fpga board. when i
connect the fpga to PC through ethernet cable, i can see the link
active on the PC. And also , by default whenever the PHY is being
reset, its in full duplex mode.

   I understand that i need to write a small state machine, which
creates an ethernet frame ie (preamble, destination address, source
address, length/type, data, pad zero, crc) and send it 4 bits every
clock cycle(txclock -MII interface) by making the transmit enable high.
I didnt quite understand about implementing the analog part  in the
fpga, that you were saying in the end.


1)My ethernet frame consists of
 Preamble, destination address, source address, length/type, data,
padded zeros, crc
 The destination and source address i am using the physical MAC address
and not  ip addresses, is it okay?

2)How do i view on my PC , what ethernet frames are being sent from the
fpga board. Is there any  software which can detect the ethernet
frame's sent to the pc. If yes, Please suggest?( ethernet frame
consists of only mac addresses and no ip addresses).

thanks
ashwin

ashwin wrote:

> 2)How do i view on my PC , what ethernet frames are being sent from the > fpga board.
http://www.ethereal.com/ -- Mike Treseler

> 1)My ethernet frame consists of > Preamble, destination address, source address, length/type, data, > padded zeros, crc > The destination and source address i am using the physical MAC address > and not ip addresses, is it okay? >
They are the Physical MAC addresses, for now you can forget about IP addresses. You can choose your FPGA MAC address (Source Address in the Tx side of your MAC), for example "12.34.56.78.9a.bc". Ethereal will pick up all the packets from your MAC if you set it in 'promiscous mode'... -- I.U. Hernandez " I'm not normally a praying man, but if you're up there, please save me, Superman!" - Homer Simpson ;O)
Be careful of this... even in promiscuous mode, it will only pick up
what is on it's network segment. So if you connect your FPGA board to a
switch, it may or may not get to your computer if the MAC is wrong.
because a switch knows what MAC is associated with what port, it may
only transfer packets to the computer whos MAC address matches the
computers. Connect the board to the compute rwith a crossover and you
should be ok - Ethereal can capture everything in p. mode.

You can start anywhere down from the MAC layer (ie: just mac
addresses), and go all the way up to TCP and it should transmit fine.
That's the whole beauty of Ethernet.