Metadata-Version: 2.4
Name: dau-sim
Version: 0.1.0
Summary: dau simulator
Project-URL: Repository, https://github.com/dau-dev/dau-sim
Project-URL: Homepage, https://github.com/dau-dev/dau-sim
Author-email: the dau authors <dev@dau.dev>
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: amaranth
Requires-Dist: csp
Requires-Dist: pyslang
Requires-Dist: rich
Requires-Dist: typer
Provides-Extra: develop
Requires-Dist: build; extra == 'develop'
Requires-Dist: bump-my-version; extra == 'develop'
Requires-Dist: check-dist; extra == 'develop'
Requires-Dist: cocotb; extra == 'develop'
Requires-Dist: codespell; extra == 'develop'
Requires-Dist: dau-build; extra == 'develop'
Requires-Dist: hatch-js; extra == 'develop'
Requires-Dist: hatchling; extra == 'develop'
Requires-Dist: mdformat; extra == 'develop'
Requires-Dist: mdformat-tables>=1; extra == 'develop'
Requires-Dist: pytest; extra == 'develop'
Requires-Dist: pytest-benchmark; extra == 'develop'
Requires-Dist: pytest-cov; extra == 'develop'
Requires-Dist: ruff; extra == 'develop'
Requires-Dist: twine; extra == 'develop'
Requires-Dist: ty; extra == 'develop'
Requires-Dist: uv; extra == 'develop'
Requires-Dist: wheel; extra == 'develop'
Description-Content-Type: text/markdown

# dau sim

dau simulator

[![Build Status](https://github.com/dau-dev/dau-sim/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/dau-dev/dau-sim/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/dau-dev/dau-sim/branch/main/graph/badge.svg)](https://codecov.io/gh/dau-dev/dau-sim)
[![License](https://img.shields.io/github/license/dau-dev/dau-sim)](https://github.com/dau-dev/dau-sim)
[![PyPI](https://img.shields.io/pypi/v/dau-sim.svg)](https://pypi.python.org/pypi/dau-sim)

## Overview

dau-sim simulates digital hardware designs using [csp](https://github.com/Point72/csp)'s reactive stream processing engine. Hardware signals become CSP time-series edges, combinational logic becomes CSP nodes, and clock domains become CSP clock processes — giving you cycle-accurate simulation with deterministic event scheduling and multi-clock support.

**Supported inputs:**

- [Amaranth HDL](https://amaranth-lang.org/) — Python-native hardware description
- [SystemVerilog / Verilog](https://www.systemverilog.io/) — via [pyslang](https://github.com/MikePopoloski/pyslang)
- Hand-constructed IR — for programmatic design generation

**Output formats:** VCD (IEEE 1364-2001) waveform files, with FST and live streaming planned.

## Installation

```bash
pip install dau-sim
```

For development:

```bash
git clone https://github.com/dau-dev/dau-sim.git
cd dau-sim
pip install -e ".[develop]"
```

## Quick Start

```python
from amaranth.lib import wiring
from amaranth.lib.wiring import In, Out
from amaranth.hdl import Module

from dau_sim.frontends import from_amaranth
from dau_sim.compiler import compile_module


class Counter(wiring.Component):
    en: In(1)
    count: Out(8)

    def elaborate(self, platform):
        m = Module()
        with m.If(self.en):
            m.d.sync += self.count.eq(self.count + 1)
        return m


cm = compile_module(from_amaranth(Counter()))
traces = cm.run(cycles=20, inputs={"en": 1})
cm.write_vcd("counter.vcd", traces)
```

## Documentation

| Topic                                          | Description                                |
| ---------------------------------------------- | ------------------------------------------ |
| [Amaranth](docs/src/amaranth.md)               | Simulating Amaranth HDL designs            |
| [Verilog / SystemVerilog](docs/src/verilog.md) | Simulating SV/V designs and hand-built IR  |
| [cocotb](docs/src/cocotb.md)                   | Running cocotb testbenches against dau-sim |
| [CLI](docs/src/cli.md)                         | Command-line interface reference           |
| [Architecture](docs/src/architecture.md)       | Pipeline and internal design               |
| [API Reference](docs/src/api.md)               | Full API tables                            |
| [Benchmarks](docs/src/benchmarks.md)           | Performance numbers and execution modes    |

## License

This project is licensed under the Apache 2.0 License — see [LICENSE](LICENSE) for details.
