From 1bc9dc0e9d17febb9104c6ac11fdf1c2b9697bd7 Mon Sep 17 00:00:00 2001 From: stefan Date: Sat, 9 May 2026 14:41:53 +0900 Subject: [PATCH] bench parsing docs --- src/kyupy/bench.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kyupy/bench.py b/src/kyupy/bench.py index d678db3..63cb8b4 100644 --- a/src/kyupy/bench.py +++ b/src/kyupy/bench.py @@ -5,6 +5,10 @@ Historically it was first used in the `ISCAS89 benchmark set `_. Besides loading these benchmarks, this module is also useful for easily constructing simple circuits: ``c = bench.parse('input(x, y) output(a, o, n) a=and(x,y) o=or(x,y) n=not(x)')``. + +This parser automatically translates gate to simulation primitives supported by kyupy. +In most cases this means just adding the number of inputs to the name: e.g. NAND -> NAND2, OR -> OR4, INV -> INV1. +Since simulators only support at most four-input-gates, gates with more than four inputs are implemented as tree. """ from lark import Lark, Transformer