第 1 /28 頁 implementation lan91c111-ne driver on altera cyclone nios soc development board...
Post on 20-Dec-2015
255 views
TRANSCRIPT
![Page 1: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/1.jpg)
第 1 /28 頁
Implementation LAN91c111-NE driver on Implementation LAN91c111-NE driver on Altera Altera cyclone NIOScyclone NIOS SoC development board SoC development board
蕭詣懋 SoC EE CCU
5/23/2005
蕭詣懋 “ [email protected]”
![Page 2: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/2.jpg)
第 2 /28 頁
outlineoutline
• Introduction
• Cyclone board ( platform introduction)
• lwIP
• Lan911c
![Page 3: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/3.jpg)
第 3 /28 頁
introductionintroduction
1. Porting a open source TCP/IP stack (Lwip) on Altera Nios Cyclone development borad
![Page 4: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/4.jpg)
第 4 /28 頁
Cyclone boardCyclone board
![Page 5: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/5.jpg)
第 5 /28 頁
FeaturesFeatures
A CycloneTM EP1C20F400C7device
• 8 Mbytes of flash memory
• 1 Mbyte of static RAM
• 16 Mbytes of SDRAM
• On board logic for configuring the Cyclone device from flash memory
• On-board Ethernet MAC/PHY device
• Two RS-232 DB9 serial ports
![Page 6: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/6.jpg)
第 6 /28 頁
Our ideaOur idea
• Find a small TCP/IP for small device. The small TCP/IP named LWIP that is created by Adam Dunkels.
• We hope that we can port LWIP to Nios and develop some sample programs for verifying it
“Adam Dunkels” http://www.sics.se/~adam/
![Page 7: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/7.jpg)
第 7 /28 頁
LWLWIP featureIP feature
lwIP is an implementation of the TCP/IP protocol stack. The focus of the lwIP stack is to reduce memory usage and code size, making lwIP suitable for use in small clients with very limited resources such as embedded systems. In order to reduce processing and memory demands,lwIP uses a tailor made API that does not require any data copying. This report describes the design and implementation of lwIP. The algorithms and data structures used both in the protocol implementations and in the sub systems such as the memory and buffer management systems are described.
“lwip” http://savannah.nongnu.org/projects/lwip/
![Page 8: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/8.jpg)
第 8 /28 頁
lwIPlwIP
![Page 9: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/9.jpg)
第 9 /28 頁
Line of Line of LWLWIP codeIP code
![Page 10: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/10.jpg)
第 10 /28 頁
Introduction to lwIPIntroduction to lwIP
• Since small devices such as sensors are often required to be physically small and inexpensive………..
lwIP describes the design and implementation of a small TCP/IP stack that is small enough to be use in minimal system.
![Page 11: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/11.jpg)
第 11 /28 頁
Protocol layeringProtocol layering
• lwIP allows using a more relaxed scheme for communication between the application and the lower layer protocol
Shared memory Also, since the application process can use the same
memory as the networking code the application can read and write directly to the internal buffers, thus saving the expense of performing a copy.
![Page 12: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/12.jpg)
第 12 /28 頁
OverviewOverview
• lwIP consists of several modules: Operating system emulation layer Buffer and memory management subsystems Network interface functions Functions for computing the Internet checksum lwIP also includes an abstract API
![Page 13: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/13.jpg)
第 13 /28 頁
Process modelProcess model
• lwIP It uses a process model in which all protocols reside in a
single process and thus separated form the operating system kernel
AP may either reside in the lwIP process, or be in separate process.
![Page 14: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/14.jpg)
第 14 /28 頁
Process model (cont’)Process model (cont’)
• Having lwIP implemented as a user space process rather than in the operating system kernel has both its advantages and disadvantages:
advantages
That is portable across different operating system disadvantages
The problem of having to wait for a scheduling quantum before getting a chance to service requests still is problem.
![Page 15: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/15.jpg)
第 15 /28 頁
The operating system emulation layerThe operating system emulation layer
• In order to make lwIP portable:
The operating system emulation layer provides a uniform interface to operating system services such as timers, process synchronization, and message passing mechanisms.
![Page 16: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/16.jpg)
第 16 /28 頁
Buffer and Memory ManagementBuffer and Memory Management
• Packet Buffers – pbufsSimilar to mbuf
Allocating dynamic memory to hold packet contents
Letting packet data reside in static memory
![Page 17: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/17.jpg)
第 17 /28 頁
Buffer and Memory ManagementBuffer and Memory Management
3 types:PBUF_RAMHeader stored in a PBUF_RAM
PBUF_ROMData is located in PBUF_ROMThis data may not modified
PBUF_POOLAllocating a single pbuf is fastUsed by network device driver
![Page 18: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/18.jpg)
第 18 /28 頁
Buffer and Memory ManagementBuffer and Memory Management
A PBUF_RAM pbuf chained with a PBUF_ROM pbuf that has data in external memory
![Page 19: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/19.jpg)
第 19 /28 頁
A chained PUBF_POOL pubf from the pbuf pool
![Page 20: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/20.jpg)
第 20 /28 頁
Network interface - Network interface - LWLWIPIP
![Page 21: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/21.jpg)
第 21 /28 頁
Network interface - BSDNetwork interface - BSD
![Page 22: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/22.jpg)
第 22 /28 頁
TCP Processing - TCP Processing - LWLWIPIP
![Page 23: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/23.jpg)
第 23 /28 頁
UDP processing - UDP processing - LWLWIPIP
![Page 24: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/24.jpg)
第 24 /28 頁
• Single Chip Ethernet Controller• Dual Speed - 10/100 Mbps• 8 Kbytes Internal Memory for Receive and
Transmit FIFO Buffers• Supports 8, 16 and 32 Bit CPU Accesses• Internal 32 Bit Wide Data Path (Into Packet
Buffer Memory)• Single 25 MHz Reference Clock for Both PHY
and MAC• Low Power CMOS Design
![Page 25: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/25.jpg)
第 25 /28 頁
Lan911c block diagramLan911c block diagram
![Page 26: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/26.jpg)
第 26 /28 頁
![Page 27: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/27.jpg)
第 27 /28 頁
Timing diagramTiming diagram
![Page 28: 第 1 /28 頁 Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”](https://reader035.vdocuments.net/reader035/viewer/2022081418/56649d4d5503460f94a2c8ca/html5/thumbnails/28.jpg)
第 28 /28 頁
demodemo
A stander socket program
( tcp_sender.c )
Linux
Cyclone
A lwip program(tcp_receiver.c)