Browse Source

bench parsing docs

devel
stefan 3 days ago
parent
commit
1bc9dc0e9d
  1. 4
      src/kyupy/bench.py

4
src/kyupy/bench.py

@ -5,6 +5,10 @@ Historically it was first used in the @@ -5,6 +5,10 @@ Historically it was first used in the
`ISCAS89 benchmark set <https://people.engr.ncsu.edu/brglez/CBL/benchmarks/ISCAS89/>`_.
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

Loading…
Cancel
Save