An open API service indexing awesome lists of open source software.

https://github.com/serhaturtis/dd-tcpoffloadengineip


https://github.com/serhaturtis/dd-tcpoffloadengineip

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

# TCP Offload Engine

A hardware-accelerated TCP/IP stack implementation in VHDL for Xilinx FPGAs with RGMII interface.

## ๐Ÿš€ Features

- **Complete TCP/IP Stack**: TCP, UDP, DHCP, ICMP protocols
- **RGMII Interface**: 125 MHz operation with auto-negotiation
- **Dual Interfaces**: AXI4-Lite control + AXI4-Stream data
- **Hardware Acceleration**: Offloads TCP processing from CPU
- **Multi-Connection**: Supports minimum 2 simultaneous TCP connections
- **Advanced TCP Features**: SACK, timestamps, congestion control
- **FPGA Optimized**: Uses Block RAM for 4KB packet buffering

## ๐Ÿ“ Project Structure

```
tcp-offload-engine/
โ”œโ”€โ”€ src/vhdl/ # VHDL source code
โ”‚ โ”œโ”€โ”€ core/ # Core components
โ”‚ โ”‚ โ”œโ”€โ”€ tcp_offload_pkg.vhd # Package definitions
โ”‚ โ”‚ โ””โ”€โ”€ packet_buffer.vhd # BRAM packet buffering
โ”‚ โ”œโ”€โ”€ interfaces/ # Interface modules
โ”‚ โ”‚ โ”œโ”€โ”€ rgmii_interface.vhd # RGMII PHY interface
โ”‚ โ”‚ โ”œโ”€โ”€ axi4_lite_interface.vhd # AXI4-Lite control
โ”‚ โ”‚ โ””โ”€โ”€ axi4_stream_interface.vhd # AXI4-Stream data
โ”‚ โ”œโ”€โ”€ protocols/ # Protocol implementations
โ”‚ โ”‚ โ”œโ”€โ”€ ethernet_mac.vhd # Ethernet MAC layer
โ”‚ โ”‚ โ”œโ”€โ”€ ip_layer.vhd # IP layer with ICMP
โ”‚ โ”‚ โ”œโ”€โ”€ tcp_engine.vhd # TCP protocol engine
โ”‚ โ”‚ โ”œโ”€โ”€ udp_engine.vhd # UDP protocol engine
โ”‚ โ”‚ โ””โ”€โ”€ dhcp_client.vhd # DHCP client
โ”‚ โ”œโ”€โ”€ testbench/ # Test infrastructure
โ”‚ โ”‚ โ”œโ”€โ”€ tcp_protocol_tb_pkg.vhd # Test utilities
โ”‚ โ”‚ โ”œโ”€โ”€ tcp_offload_tb.vhd # Basic functionality test
โ”‚ โ”‚ โ”œโ”€โ”€ tcp_connection_test_tb.vhd # TCP connection tests
โ”‚ โ”‚ โ”œโ”€โ”€ udp_dhcp_test_tb.vhd # UDP/DHCP tests
โ”‚ โ”‚ โ””โ”€โ”€ packet_gen_test_tb.vhd # Packet generation tests
โ”‚ โ””โ”€โ”€ tcp_offload_engine_top.vhd # Top-level integration
โ”œโ”€โ”€ scripts/ # Build and test scripts
โ”‚ โ”œโ”€โ”€ run_sim.sh # Basic simulation
โ”‚ โ””โ”€โ”€ run_comprehensive_tests.sh # Full test suite
โ”œโ”€โ”€ docs/ # Documentation
โ”‚ โ”œโ”€โ”€ ARCHITECTURE.md # System architecture
โ”‚ โ”œโ”€โ”€ INTEGRATION_GUIDE.md # Integration guide
โ”‚ โ”œโ”€โ”€ COMPREHENSIVE_TESTING_GUIDE.md # Testing guide
โ”‚ โ””โ”€โ”€ TEST_SUITE_SUMMARY.md # Test results summary
โ”œโ”€โ”€ tests/ # Test configurations
โ”œโ”€โ”€ examples/ # Usage examples
โ””โ”€โ”€ tools/ # Development tools
```

## ๐Ÿ”ง Requirements

### Hardware
- **FPGA**: Xilinx 7-series or later
- **PHY**: RGMII-compatible Gigabit Ethernet PHY
- **Resources**: ~50K LUTs, ~100 Block RAMs (estimated)

### Software
- **GHDL**: 1.0.0 or later for simulation
- **GTKWave**: For waveform viewing
- **Vivado**: 2019.1 or later for synthesis

## ๐Ÿš€ Quick Start

### 1. Clone Repository
```bash
git clone https://github.com/your-org/tcp-offload-engine.git
cd tcp-offload-engine
```

### 2. Run Basic Tests
```bash
# Basic functionality test
chmod +x scripts/run_sim.sh
./scripts/run_sim.sh

# Comprehensive protocol tests
chmod +x scripts/run_comprehensive_tests.sh
./scripts/run_comprehensive_tests.sh
```

### 3. View Results
```bash
# View simulation logs
cat work/simulation.log

# View waveforms
gtkwave work/wave.ghw
```

## ๐Ÿ“‹ Configuration

### AXI4-Lite Register Map
| Address | Register | Description |
|---------|----------|-------------|
| 0x00 | CONTROL | Engine enable, protocol enables |
| 0x04 | STATUS | Link status, engine status |
| 0x08 | MAC_ADDR_LOW | MAC address [31:0] |
| 0x0C | MAC_ADDR_HIGH | MAC address [47:32] |
| 0x10 | IP_ADDR | Local IP address |
| 0x14 | SUBNET_MASK | Subnet mask |
| 0x18 | GATEWAY | Gateway IP address |
| 0x1C | TCP_PORT_0 | TCP port 0 configuration |
| 0x20 | TCP_PORT_1 | TCP port 1 configuration |

### Key Parameters
- **Clock Frequency**: 125 MHz (system), 100 MHz (AXI)
- **Buffer Size**: 4KB per connection
- **Maximum Frame Size**: 1518 bytes
- **TCP Window Size**: Configurable, default 8KB

## ๐Ÿงช Testing

The project includes comprehensive test suites:

### Test Levels
1. **Unit Tests**: Individual component validation
2. **Protocol Tests**: TCP/UDP/DHCP protocol compliance
3. **Integration Tests**: End-to-end functionality
4. **Performance Tests**: Throughput and latency

### Test Coverage
- โœ… **Packet Generation**: Validated protocol packet creation
- โœ… **Interface Testing**: AXI4-Lite/Stream functionality
- โœ… **Basic Protocol**: TCP handshake, UDP packets, DHCP discovery
- โš ๏ธ **Advanced Features**: SACK, timestamps (framework ready)
- โŒ **Performance**: Throughput testing (planned)

See [Testing Guide](docs/COMPREHENSIVE_TESTING_GUIDE.md) for details.

## ๐Ÿ—๏ธ Architecture

The TCP Offload Engine implements a complete hardware TCP/IP stack:

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Host Application โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ AXI4-Stream
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ AXI4-Stream Interface โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ TCP Engine โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ UDP Engine โ”‚ DHCP Client โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ IP Layer โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Ethernet MAC โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ RGMII Interface โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ RGMII
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Ethernet PHY โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

See [Architecture Guide](docs/ARCHITECTURE.md) for detailed design.

## ๐Ÿ“– Documentation

- **[Architecture](docs/ARCHITECTURE.md)**: System design and component details
- **[Integration Guide](docs/INTEGRATION_GUIDE.md)**: How to integrate into your design
- **[Testing Guide](docs/COMPREHENSIVE_TESTING_GUIDE.md)**: Complete testing methodology
- **[Test Results](docs/TEST_SUITE_SUMMARY.md)**: Current validation status

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Ensure all tests pass
5. Submit a pull request

### Development Standards
- All VHDL code must be VHDL-2008 compliant
- Comprehensive test coverage required
- Documentation must be updated
- Follow existing coding style

## ๐Ÿ“„ License

This project is licensed under a modified version of the MIT License with an exception (Erhan IPEK) - see the [LICENSE](LICENSE) file for details.

## ๐Ÿท๏ธ Status

**Current Version**: 1.0.0-beta
**Status**: Development/Testing
**Last Updated**: 2025-06-17

### Readiness Levels
- ๐ŸŸข **Development Ready**: Core infrastructure complete
- ๐ŸŸก **Testing Phase**: Protocol validation in progress
- ๐Ÿ”ด **Production**: Additional validation required

## ๐Ÿ“ž Support

- **Issues**: Use GitHub Issues for bug reports
- **Discussions**: Use GitHub Discussions for questions
- **Documentation**: Check the `docs/` folder

## ๐Ÿ™ Acknowledgments

- Built using GHDL open-source VHDL simulator
- Tested with GTKWave waveform viewer
- Designed for Xilinx FPGA platforms