Repository navigation
en getting started installation
By the end of this page, you should be able to import Toffee in a terminal. The commands use a Linux/macOS shell and require Python 3.11 or newer. No hardware simulator is needed yet.
Use the toffee directory containing pyproject.toml, examples/, and docs/. To obtain it:
git clone --branch main https://github.com/XS-MLVP/toffee.git
cd toffeeRun all following commands from that directory, rather than from src/ or examples/.
The distribution is named uc-toffee; the Python import is toffee.
python3 -m pip install "uc-toffee[runner]" also installs uc-xcomm>=1.1,<2, which supplies xspcomm.
The old pytoffee package belongs to Legacy Toffee.
The tutorial installs from source so the repository examples are available. When developing against unreleased native changes, prepare the pinned dependency described in the contribution guide.
python3 --version
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e '.[test]'
python3 -c 'import toffee; print(toffee.__file__)'The last command should print this checkout's src/toffee/__init__.py.
venv creates .venv; source selects it in the current shell. The editable -e installation makes
source changes immediately visible. Keep the quotes around .[test].
In a new terminal, enter the repository and run source .venv/bin/activate again.
pytest discovers and runs tests; pytest-asyncio runs the later asynchronous tests. You do not need to create an event loop or TaskGroup yourself.
| Symptom | Check |
|---|---|
| Python is older than 3.11 | Install a supported interpreter and recreate .venv
|
Missing venv or ensurepip
|
Install the distribution's Python venv component |
| pip cannot download packages | Check network access and the configured package mirror |
No module named toffee |
Activate the environment and use the same interpreter for installation and execution |
Missing examples or a test file |
Return to the repository root and use python3 -m pytest ...
|
Continue with your first PASS and FAIL. For native XClock usage, see
native integration. A matching wheel needs no local compilation;
building uc-xcomm from source requires system C++20 tools, CMake, and Python development headers.
内容由 CI 自动同步;请编辑主仓库文档。 Automatically synced by CI; edit the source documentation.
- 首页
- 教程
- 操作指南
- 参考
- 原理说明
- Home
-
Tutorials
- Learning path
- 0. Prepare your environment
- 1. Your first PASS and FAIL
- 2. Inputs and clocks
- 3. More cases and boundaries
- 4. Extract a Driver
- 5. Delayed output and a Monitor
- 6. Assemble an Agent
- 7. Models and the test environment
- 8. Pipelines, batches, and cancellation
- 9. Understand failures
- 10. Functional coverage
- Optional: out-of-order responses
- Optional: native clocks and project DUTs
-
How-to guides
- Find your task
- Simulation and events
- Verification components
- Coverage and regressions
- Migration and maintenance
- Runnable examples
- Reference
- Explanation