3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-18 19:02:21 +00:00

Test --link functionality

This commit is contained in:
Krystine Sherwin 2025-06-23 16:18:32 +12:00
parent 829b4cc32f
commit 67ffd25c49
No known key found for this signature in database
6 changed files with 45 additions and 0 deletions

2
tests/links/Makefile Normal file
View file

@ -0,0 +1,2 @@
SUBDIR=links
include ../make/subdir.mk

View file

@ -0,0 +1,3 @@
read -sv picorv32.v
read -sv prv32fmcmp.v
prep -top prv32fmcmp

1
tests/links/prv32fmcmp.v Symbolic link
View file

@ -0,0 +1 @@
../unsorted/prv32fmcmp.v

12
tests/links/symlink.py Normal file
View file

@ -0,0 +1,12 @@
import os
from pathlib import Path
import sys
def main():
workdir, task = sys.argv[1:]
src = Path(workdir) / "src"
for srcfile in src.iterdir():
assert(srcfile.is_symlink() == (task == "link"))
if __name__ == "__main__":
main()

18
tests/links/symlink.sby Normal file
View file

@ -0,0 +1,18 @@
[tasks]
link
copy
[options]
mode prep
[engines]
btor btormc
[script]
read -noverific
script dir/script.ys
[files]
../../docs/examples/demos/picorv32.v
prv32fmcmp.v
dir

9
tests/links/symlink.sh Normal file
View file

@ -0,0 +1,9 @@
#!/bin/bash
set -e
if [[ $TASK == link ]]; then
flags="--setup --link"
else
flags="--setup"
fi
python3 $SBY_MAIN -f $SBY_FILE $TASK $flags
python3 ${SBY_FILE%.sby}.py $WORKDIR $TASK