New Account     Sign In        

LatticeNEWS June 2007


LatticeMico32 LogoLatticeMico32 and Tri-speed Ethernet MAC Reference Design

New reference design combines the open source LatticeMico32 "soft" microprocessor with the Tri-speed Ethernet MAC IP core.

Lattice FPGAs are routinely used in a wide variety of systems. Many of these systems are designed to communicate over the ubiquitous Ethernet communications interface and use the equally prevalent Internet Protocol. A designer may decide to implement portions of the Ethernet interface inside the FPGA. The LatticeMico32 Tri-Speed Ethernet MAC Reference Design shows how to combine a microprocessor, Ethernet MAC, Ethernet PHY, and a small memory footprint Internet Protocol software stack to communicate over a LAN connection to a networked computer.

Hardware Platform

The reference design is built and run on the LatticeMico32/DSP Evaluation Board for LatticeECP2 or for LatticeECP (hereafter referred to as the LatticeMico32/DSP Evaluation Board). The LatticeMico32/DSP Evaluation Board has the following features used to implement the reference design:

  • LatticeECP or LatticeECP2 FPGA FPGA
  • 10/100 TX Intel Ethernet PHY
  • MAX3232 UART PHY
  • 1MB SRAM
  • 32MB Flash
  • 4 DIP Switches
  • 8 Discrete LEDs

The FPGA is configured using the  Mico32 System Builder (MSB) software, which is an add-on for the standard Eclipse Integrated Development Environment. The Eclipse Mico System Builder plug-in contains predefined components that are used to control the evaluation board’s hardware resources. Each of the functional blocks inside the FPGA module, shown in the figure below, represents one predefined function that can be selected from the MSB. All of the blocks with the exception of the Tri-speed MAC are included with the Mico System software. The Tri-speed MAC is licensed IP and is available from the Lattice Intellectual Property server. The code available from the Lattice IP Server can be used without a license, which permits evaluation of the core. Designs using the core without a license have a time to live and discontinue functioning after the time to live period expires. The reference design operates for approximately one hour before the time to live period expires. Contact your local Lattice sales representative for information about purchasing a license for the Tri-speed Ethernet MAC IP that removes the timeout period.

 

Mico32/TSMAC Fig 1

Functional blocks inside the FPGA module


Software Implementation

The reference design software is built in three primary blocks:

  • Tri-speed MAC device driver
  • Open source lwIP (Light Weight Internet Protocol) software stack
  • A set of demonstration top-level protocols (HTTPD, Fingerd, and Ping handler)

The Tri-speed MAC device driver is available in the Mico System Software released coincident with ispLEVER 7.0. The lwIP software is freely available for download from the lwIP project website, but is also included with the reference design for convenience. The top-level protocol examples are supplied with the reference design package. 

Mico32 TSMAC Fig 2

Software implementation


Web Server Daemon

The web server implementation is a lightweight solution. The server listens on port 80, the default for internet requests, and dispatches a few different pages. The pages served are static only and compiled and stored in the LatticeMico32 data segment. Using a web browser, one of four HTML pages can be viewed:

  • Home page (index.html)
  • Tri-speed MAC information page
  • Auto-refreshing page showing the DIP switch settings on the evaluation board
  • A “404 file not found” page

Data sent/received from the HTTPD and the FINGERD are handled using the lwIP RAW API callback system.

Finger Daemon

A basic finger function is available. The finger protocol is used to acquire information about users on a remote system. In the reference design there are no user accounts. The protocol is used to return statistics about the state of the Ethernet link controlled by the LatticeMico32. Information such as the number of bytes sent, received, packets dropped, etc. are reported.

Ping Handler

A system implementing the TCP/IP protocol almost invariably implements the ping protocol. This protocol permits a local system to determine if a remote system is responding to data requests. The reference design implements a basic solution that does not rely on a callback structure like the finger or http protocols.

Summary

The Lattice Tri-Speed Ethernet MAC Reference Design provides all the building blocks required to test and implement network enabled systems. Be sure to visit the Lattice website to find out more about this solution.