mirror of
https://github.com/YosysHQ/sby.git
synced 2026-05-11 06:52:30 +00:00
Docs: regex tag matching
This feels cursed.
This commit is contained in:
parent
974c2339d9
commit
aed51170fb
3 changed files with 107 additions and 0 deletions
42
docs/examples/tags/alt.log
Normal file
42
docs/examples/tags/alt.log
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
./gen.sh -s alt -t unbounded_hAdX
|
||||
$ sby --dumptasks alt.sby
|
||||
$ sby --dumptags alt.sby
|
||||
known
|
||||
liveness
|
||||
unbounded
|
||||
$ sby --dumptags alt.sby unbounded_hAdX
|
||||
\w+_h[AB]d[XY]
|
||||
known
|
||||
unbounded
|
||||
unbounded_h.d.
|
||||
$ sby --dumpdefaults alt.sby
|
||||
$ sby --dumpcfg alt.sby
|
||||
[tasks]
|
||||
unbounded_h.d. : unbounded
|
||||
liveness_h.d. : liveness
|
||||
\w+_h[AB]d[XY] : known
|
||||
|
||||
[options]
|
||||
|
||||
[engines]
|
||||
abc pdr
|
||||
aiger suprove
|
||||
|
||||
[script]
|
||||
|
||||
[files]
|
||||
$ sby --dumpcfg alt.sby unbounded_hAdX
|
||||
[options]
|
||||
mode prove
|
||||
|
||||
[engines]
|
||||
abc pdr
|
||||
|
||||
[script]
|
||||
read -sv A.v X.v unbounded.v
|
||||
prep -top unbounded
|
||||
|
||||
[files]
|
||||
unbounded.v
|
||||
hostA.v
|
||||
deviceX.v
|
||||
38
docs/examples/tags/alt.sby
Normal file
38
docs/examples/tags/alt.sby
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
[tasks]
|
||||
unbounded_h.d. : unbounded
|
||||
liveness_h.d. : liveness
|
||||
\w+_h[AB]d[XY] : known
|
||||
|
||||
[options]
|
||||
unbounded: mode prove
|
||||
liveness: mode live
|
||||
|
||||
[engines]
|
||||
~liveness: abc pdr
|
||||
~unbounded: aiger suprove
|
||||
|
||||
[script]
|
||||
--pycode-begin--
|
||||
m = re.fullmatch(r'(unbounded|liveness)_h(.)d(.)', task or '')
|
||||
if m:
|
||||
top, h, d = m.groups()
|
||||
output(f'read -sv {h}.v {d}.v {top}.v')
|
||||
output(f'prep -top {top}')
|
||||
else:
|
||||
assert task is None, f'Invalid task {task!r}'
|
||||
--pycode-end--
|
||||
|
||||
[files]
|
||||
--pycode-begin--
|
||||
m = re.fullmatch(r'(\w+)_h(\w)d(\w)', task or '')
|
||||
if m:
|
||||
assert 'known' in tags, f'Unknown host/device {task!r}'
|
||||
top, h, d = m.groups()
|
||||
sources = [
|
||||
f"{top}.v",
|
||||
f"host{h}.v",
|
||||
f"device{d}.v",
|
||||
]
|
||||
for source in sources:
|
||||
output(source)
|
||||
--pycode-end--
|
||||
Loading…
Add table
Add a link
Reference in a new issue