Skip to content

Commit f3ad895

Browse files
committed
[tapcell] Add unit test for invalid cells
1 parent 713bdb8 commit f3ad895

File tree

3 files changed

+113
-2
lines changed

3 files changed

+113
-2
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env bash
2+
3+
################################################################################
4+
## Authors: Mateus Fogaca, Eder Matheus Monteiro
5+
## (Advisor: Ricardo Reis)
6+
##
7+
## BSD 3-Clause License
8+
##
9+
## Copyright (c) 2019, Federal University of Rio Grande do Sul (UFRGS)
10+
## All rights reserved.
11+
##
12+
## Redistribution and use in source and binary forms, with or without
13+
## modification, are permitted provided that the following conditions are met:
14+
##
15+
## * Redistributions of source code must retain the above copyright notice, this
16+
## list of conditions and the following disclaimer.
17+
##
18+
## * Redistributions in binary form must reproduce the above copyright notice,
19+
## this list of conditions and the following disclaimer in the documentation
20+
## and#or other materials provided with the distribution.
21+
##
22+
## * Neither the name of the copyright holder nor the names of its
23+
## contributors may be used to endorse or promote products derived from
24+
## this software without specific prior written permission.
25+
##
26+
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27+
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29+
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30+
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32+
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33+
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34+
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36+
## POSSIBILITY OF SUCH DAMAGE.
37+
################################################################################
38+
39+
GREEN=0
40+
RED=2
41+
42+
if [ "$#" -ne 2 ]; then
43+
exit 2
44+
fi
45+
46+
binary=$1
47+
testdir=$2
48+
49+
ln -s ../test_rows_origin/input.* .
50+
51+
$binary -no_init < run.tcl > test.log 2>&1
52+
53+
rm ./input.lef
54+
rm ./input.def
55+
56+
grep -q "Master FILLCELL_X1x not found" ./test.log
57+
status=$?
58+
59+
mkdir -p ../../results/test_invalid_cells/
60+
cp test.log ../../results/test_invalid_cells/tapcell.log
61+
62+
if [ $status -eq 0 ]; then
63+
exit $GREEN
64+
else
65+
echo " - [ERROR] Test failed. Check $testdir/src/check_invalid_cells/test.log"
66+
exit $RED
67+
fi
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
################################################################################
2+
## Authors: Vitor Bandeira, Eder Matheus Monteiro e Isadora Oliveira
3+
## (Advisor: Ricardo Reis)
4+
##
5+
## BSD 3-Clause License
6+
##
7+
## Copyright (c) 2019, Federal University of Rio Grande do Sul (UFRGS)
8+
## All rights reserved.
9+
##
10+
## Redistribution and use in source and binary forms, with or without
11+
## modification, are permitted provided that the following conditions are met:
12+
##
13+
## * Redistributions of source code must retain the above copyright notice, this
14+
## list of conditions and the following disclaimer.
15+
##
16+
## * Redistributions in binary form must reproduce the above copyright notice,
17+
## this list of conditions and the following disclaimer in the documentation
18+
## and#or other materials provided with the distribution.
19+
##
20+
## * Neither the name of the copyright holder nor the names of its
21+
## contributors may be used to endorse or promote products derived from
22+
## this software without specific prior written permission.
23+
##
24+
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26+
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27+
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28+
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29+
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30+
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31+
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32+
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33+
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+
## POSSIBILITY OF SUCH DAMAGE.
35+
################################################################################
36+
37+
read_lef "input.lef"
38+
read_def "input.def"
39+
40+
tapcell -endcap_cpp "1" -distance "25" -tapcell_master "FILLCELL_X1x" -endcap_master "FILLCELL_X1x"
41+
42+
write_def "tap.def"
43+
44+
exit

src/tapcell/test/src/test_rows_origin/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ $binary -no_init < run.tcl > test.log 2>&1
5050

5151
report=$(grep -e '---- #Tapcells inserted:' ./test.log)
5252

53-
mkdir -p ../../results/test_cells_inserted/
54-
cp test.log ../../results/test_cells_inserted/tapcell.log
53+
mkdir -p ../../results/test_rows_origin/
54+
cp test.log ../../results/test_rows_origin/tapcell.log
5555

5656
if grep -q -e "$report" golden.cells;
5757
then

0 commit comments

Comments
 (0)