Metadata-Version: 2.4
Name: cocotbext-mipi-csi2
Version: 0.1.1
Summary: MIPI CSI-2 simulation framework for cocotb
Author-email: David stonelyd <stonelyd@yahoo.com>
License-Expression: MIT
Project-URL: Bug Tracker, https://github.com/stonelyd/cocotbext-mipi-csi2/issues
Project-URL: Source Code, https://github.com/stonelyd/cocotbext-mipi-csi2
Project-URL: Documentation, https://cocotbext-mipi-csi2.readthedocs.io/
Keywords: mipi,csi-2,dphy,cphy,camera,cocotb,simulation
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: cocotb
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cocotb>=1.9.0
Requires-Dist: cocotb-bus>=0.2.1
Requires-Dist: numpy>=1.16.0
Provides-Extra: test
Requires-Dist: pytest>=6.0; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: cocotb-test>=0.2.4; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: cocotb-test>=0.2.4; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-rtd-theme; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: license-file

# MIPI CSI-2 simulation framework for Cocotb

[![Regression Tests](https://github.com/stonelyd/cocotbext-mipi-csi2/actions/workflows/regression-tests.yml/badge.svg)](https://github.com/stonelyd/cocotbext-mipi-csi2/actions/workflows/regression-tests.yml)
[![codecov](https://codecov.io/gh/stonelyd/cocotbext-mipi-csi2/branch/master/graph/badge.svg)](https://codecov.io/gh/stonelyd/cocotbext-mipi-csi2)
[![PyPI version](https://badge.fury.io/py/cocotbext-mipi-csi2.svg)](https://pypi.org/project/cocotbext-mipi-csi2)
[![Downloads](https://pepy.tech/badge/cocotbext-mipi-csi2)](https://pepy.tech/project/cocotbext-mipi-csi2)

GitHub repository: https://github.com/stonelyd/cocotbext-mipi-csi2


Note: This project is in active developmnet, many of the features listed below have not be implamented or tested.

## Introduction

MIPI CSI-2 (Camera Serial Interface 2) simulation framework for [cocotb](https://github.com/cocotb/cocotb).

This package provides comprehensive simulation models for MIPI CSI-2 protocol, supporting both D-PHY and C-PHY physical layers. It includes transmitter and receiver models for testing CSI-2 implementations with extensive error injection and validation capabilities.

## Features

### Protocol Support
- **CSI-2 v4.0.1 compliant** implementation
- **D-PHY** physical layer support (1, 2, 4 lanes)
- **C-PHY** physical layer support (1, 2, 3 trios)
- **Virtual Channel** support (0-15)
- **Multiple data types**: RAW8/10/12/16, RGB888/565, YUV422/420

### Packet Handling
- **Short packets**: Frame/Line Start/End, Generic short packets
- **Long packets**: Image data, Generic long packets
- **Error Correction Code (ECC)** generation and validation
- **Checksum** calculation and verification
- **Lane distribution** and merging for multi-lane configurations

### Testing Capabilities
- **Error injection**: ECC errors, checksum errors, timing violations
- **Frame assembly** and validation
- **Timing validation** with configurable parameters
- **Performance analysis** and throughput measurement
- **Pattern generation** for testing (ramp, checkerboard, solid)

### Advanced Features
- **Continuous streaming** simulation
- **Multi-virtual channel** concurrent transmission
- **Lane deskew** handling
- **Scrambling** support (CSI-2 v2.0+)
- **Extended virtual channels** (CSI-2 v2.0+)

## Installation

Installation from pip (release version, stable):

    $ pip install cocotbext-mipi-csi2


Installation for active development:

    $ git clone https://github.com/stonelyd/cocotbext-mipi-csi2
    $ pip install -e cocotbext-mipi-csi2

