Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yosys-tests
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yosys-tests
Commits
f8b3a5c2
Commit
f8b3a5c2
authored
Nov 03, 2019
by
Miodrag Milanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make scripts generic
parent
9d1a8df3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
111 deletions
+5
-111
architecture/Makefile
+2
-2
generate.py
+1
-1
regression/Makefile
+2
-2
regression/generate.py
+0
-20
regression/run.sh
+0
-86
run.sh
+0
-0
No files found.
architecture/Makefile
View file @
f8b3a5c2
...
...
@@ -7,7 +7,7 @@ clean:: run-test.mk
@
rm
-f
.stamp
@
$(MAKE)
-f
run-test.mk clean
run-test.mk
:
generate.py
@
$(PYTHON_EXECUTABLE)
generate.py
>
run-test.mk
run-test.mk
:
../
generate.py
@
$(PYTHON_EXECUTABLE)
../
generate.py
>
run-test.mk
.PHONY
:
all clean
architecture/
generate.py
→
generate.py
View file @
f8b3a5c2
...
...
@@ -12,7 +12,7 @@ for root, dirs, files in sorted(os.walk(".")):
print
(
"
\t
@echo 'Skipping heavy test {0}..'"
.
format
(
dir
,
work
))
continue
print
(
"
\t
@echo 'Running {2}{1}..'
\n
"
"
\t
@./run.sh {0} {1}
\n
"
"
\t
@.
.
/run.sh {0} {1}
\n
"
"clean::
\n
"
"
\t
@echo 'Cleaning {1}..'
\n
"
"
\t
@rm -rf {0}/work_{1}"
.
format
(
dir
,
work
,
"heavy "
if
heavy
else
""
))
...
...
regression/Makefile
View file @
f8b3a5c2
...
...
@@ -7,7 +7,7 @@ clean:: run-test.mk
@
rm
-f
.stamp
@
$(MAKE)
-f
run-test.mk clean
run-test.mk
:
generate.py
@
$(PYTHON_EXECUTABLE)
generate.py
>
run-test.mk
run-test.mk
:
../
generate.py
@
$(PYTHON_EXECUTABLE)
../
generate.py
>
run-test.mk
.PHONY
:
all clean
regression/generate.py
deleted
100644 → 0
View file @
9d1a8df3
import
os
is_heavy_enabled
=
int
(
os
.
getenv
(
'ENABLE_HEAVY_TESTS'
,
'0'
))
==
1
for
root
,
dirs
,
files
in
sorted
(
os
.
walk
(
"."
)):
for
file
in
files
:
if
file
.
endswith
(
'.ys'
):
dir
=
os
.
path
.
basename
(
root
)
work
=
os
.
path
.
splitext
(
file
)[
0
]
heavy
=
os
.
path
.
exists
(
os
.
path
.
join
(
dir
,
"heavy_test"
))
print
(
"all:: {0}/work_{1}/.stamp
\n
"
"{0}/work_{1}/.stamp:"
.
format
(
dir
,
work
))
if
(
heavy
and
not
is_heavy_enabled
):
print
(
"
\t
@echo 'Skipping heavy test {0}..'"
.
format
(
dir
,
work
))
continue
print
(
"
\t
@echo 'Running {2}{1}..'
\n
"
"
\t
@./run.sh {0} {1}
\n
"
"clean::
\n
"
"
\t
@echo 'Cleaning {1}..'
\n
"
"
\t
@rm -rf {0}/work_{1}"
.
format
(
dir
,
work
,
"heavy "
if
heavy
else
""
))
print
(
".PHONY: all clean"
)
\ No newline at end of file
regression/run.sh
deleted
100755 → 0
View file @
9d1a8df3
#!/bin/bash
set
-x
test
-d
$1
test
-f
$2
.ys
rm
-rf
$1
/work_
$2
mkdir
$1
/work_
$2
cd
$1
/work_
$2
touch .start
#
if
[[
$2
=
~
"_fail"
]]
;
then
#4 - An error expected
if
yosys
-ql
yosys.log ../
$2
.ys
;
then
echo
FAIL
>
${
1
}
_
${
2
}
.status
else
if
[
-f
"../
$2
.pat"
]
;
then
expectation
=
$(
<../
$2
.pat
)
if
grep
"
$expectation
"
yosys.log
;
then
echo
PASS
>
${
1
}
_
${
2
}
.status
else
echo
FAIL
>
${
1
}
_
${
2
}
.status
fi
else
echo
PASS
>
${
1
}
_
${
2
}
.status
fi
fi
else
#2 - All asserts in .ys script
yosys
-ql
yosys.log ../
$2
.ys
if
[
$?
!=
0
]
;
then
echo
FAIL
>
${
1
}
_
${
2
}
.status
touch .stamp
exit
0
else
#3 Output log check
if
[
-f
"../
$2
.pat"
]
;
then
# Expected behavior
expectation
=
$(
<../
$2
.pat
)
if
grep
"
$expectation
"
result.out
;
then
echo
PASS
>
${
1
}
_
${
2
}
.status
else
echo
FAIL
>
${
1
}
_
${
2
}
.status
fi
elif
[
-f
"../
$2_n
.pat"
]
;
then
# Not expected behavior
expectation
=
$(
<../
$2_n
.pat
)
if
grep
"
$expectation
"
result.out
;
then
echo
FAIL
>
${
1
}
_
${
2
}
.status
else
echo
PASS
>
${
1
}
_
${
2
}
.status
fi
#1 Iverilog run when testbench exists
elif
[
-f
"../testbench.v"
]
;
then
if
[
-f
"../../../../../techlibs/common/simcells.v"
]
;
then
COMMON_PREFIX
=
../../../../../techlibs/common
TECHLIBS_PREFIX
=
../../../../../techlibs
else
COMMON_PREFIX
=
/usr/local/share/yosys
TECHLIBS_PREFIX
=
/usr/local/share/yosys
fi
if
[
-f
"../iverilog_adds.txt"
]
;
then
iverilog_adds
=
$(
<../iverilog_adds.txt
)
else
iverilog_adds
=
""
fi
iverilog
-o
testbench ../testbench.v synth.v ../../common.v
$COMMON_PREFIX
/simcells.v
$COMMON_PREFIX
/simlib.v
$iverilog_adds
if
[
$?
!=
0
]
;
then
echo
FAIL
>
${
1
}
_
${
2
}
.status
touch .stamp
exit
0
fi
if
!
vvp
-N
testbench
>
testbench.log 2>&1
;
then
grep
'ERROR'
testbench.log
echo
FAIL
>
${
1
}
_
${
2
}
.status
elif
grep
'ERROR'
testbench.log
||
!
grep
'OKAY'
testbench.log
;
then
echo
FAIL
>
${
1
}
_
${
2
}
.status
else
echo
PASS
>
${
1
}
_
${
2
}
.status
fi
else
echo
PASS
>
${
1
}
_
${
2
}
.status
fi
fi
fi
touch .stamp
architecture/
run.sh
→
run.sh
View file @
f8b3a5c2
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment