Skip to content

Commit

Permalink
Merge pull request #558 from jwest115/issue-533
Browse files Browse the repository at this point in the history
Add `fpp-to-xml` topology tests to `fpp-to-layout`
  • Loading branch information
bocchino authored Jan 8, 2025
2 parents 274fba0 + f43b623 commit 822410e
Show file tree
Hide file tree
Showing 231 changed files with 1,871 additions and 55 deletions.
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.diff.txt
*.out.txt
*Layout
default-tests.sh
default-update-ref.sh
15 changes: 2 additions & 13 deletions compiler/tools/fpp-to-layout/test/duplicate_tops/clean
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
#!/bin/sh -e

. ../../../../scripts/utils.sh
export COMPILER_ROOT=../../../..

clean
rm -f default-tests.sh default-update-ref.sh

for file in `find . -name '*.ref.txt' -or -name '*.out.txt'`
do
rm $file
done

for dir in `find . -type d -name '*Layout.ref'`
do
rm -r $dir
done
sh ../scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module M {
}

topology Duplicate {
}
}
2 changes: 1 addition & 1 deletion compiler/tools/fpp-to-layout/test/duplicate_tops/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ duplicate()
{
run_test '' duplicate && \
compare_out duplicate
}
}
15 changes: 2 additions & 13 deletions compiler/tools/fpp-to-layout/test/multiple_tops/clean
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
#!/bin/sh -e

. ../../../../scripts/utils.sh
export COMPILER_ROOT=../../../..

clean
rm -f default-tests.sh default-update-ref.sh

for file in `find . -name '*.ref.txt' -or -name '*.out.txt'`
do
rm $file
done

for dir in `find . -type d -name '*Layout*'`
do
rm -r $dir
done
sh ../scripts/clean.sh
2 changes: 1 addition & 1 deletion compiler/tools/fpp-to-layout/test/multiple_tops/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ multiple_tops()
compare T1 C2 && \
compare T2 C3 && \
compare_out multiple_tops
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ multiple_tops()
update "" multiple_tops
move_layout_files T1 C1 C2
move_layout_files T2 C3
}
}
6 changes: 3 additions & 3 deletions compiler/tools/fpp-to-layout/test/scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
clean
rm -rf default-tests.sh default-update-ref.sh

for file in `find . -name '*.ref.txt' -or -name '*.out.txt'`
for file in `find . -name '*.out.txt'`
do
rm $file
done

for dir in `find . -type d -name '*Layout*'`
for dir in `find . -type d -name '*Layout'`
do
rm -r $dir
done
done
7 changes: 7 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/TLayout.ref/C.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
c1
pOut
0
c2
pIn
0

31 changes: 31 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/basic.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module M {

port P

passive component C1 {

output port pOut: P

}

passive component C2 {

sync input port pIn: P

}

instance c1: C1 base id 0x100
instance c2: C2 base id 0x200

topology T {

instance c1
instance c2

connections C {
c1.pOut -> c2.pIn
}

}

}
Empty file.
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e

export COMPILER_ROOT=../../../..

sh ../scripts/clean.sh
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export COMPILER_ROOT=../../../..

sh ../scripts/run.sh
6 changes: 6 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
basic()
{
run_test "" basic && \
compare T C && \
compare_out basic
}
3 changes: 3 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests="
basic
"
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/update-ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export COMPILER_ROOT=../../../..

sh ../scripts/update-ref.sh
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_basic/update-ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
basic()
{
update "" basic
move_layout_files T C
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a1
pOut
0
b
pIn
0

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a2
pOut
0
b
pIn
0

5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/basic/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e

export COMPILER_ROOT=../../../../..

sh ../../scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module M {

port P

passive component A {

output port pOut: P

}

passive component B {

sync input port pIn: P

}

instance a1: A base id 0x100
instance a2: A base id 0x200

instance b: B base id 0x400

topology S {

instance a1
instance b

connections C1 {
a1.pOut -> b.pIn
}

}

topology T {

import S

instance a2

connections C2 {
a2.pOut -> b.pIn
}

}

}
Empty file.
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/basic/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export COMPILER_ROOT=../../../../..

sh ../../scripts/run.sh
7 changes: 7 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/basic/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import_basic()
{
run_test "" import_basic && \
compare S C1 && \
compare T C2 && \
compare_out import_basic
}
3 changes: 3 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/basic/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests="
import_basic
"
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/basic/update-ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export COMPILER_ROOT=../../../../../

sh ../../scripts/update-ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import_basic()
{
update "" import_basic
move_layout_files S C1
move_layout_files T C2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a1
pOut
0
b
pIn
0

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
a1
pOut
0
b
pIn
0

a1
pOut
1
b
pIn
0

a2
pOut
0
b
pIn
0

5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/merge/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e

export COMPILER_ROOT=../../../../..

sh ../../scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module M {

port P

passive component A {

output port pOut: [2] P

}

passive component B {

sync input port pIn: P

}

instance a1: A base id 0x100
instance a2: A base id 0x200

instance b: B base id 0x400

topology S {

instance a1
instance b

connections C {
a1.pOut -> b.pIn
}

}

topology T {

import S

instance a2

connections C {
a1.pOut -> b.pIn
a2.pOut -> b.pIn
}

}

}
Empty file.
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/merge/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export COMPILER_ROOT=../../../../..

sh ../../scripts/run.sh
7 changes: 7 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/merge/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import_merge()
{
run_test "" import_merge && \
compare S C && \
compare T C && \
compare_out import_merge
}
3 changes: 3 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/merge/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests="
import_merge
"
5 changes: 5 additions & 0 deletions compiler/tools/fpp-to-layout/test/top_import/merge/update-ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export COMPILER_ROOT=../../../../../

sh ../../scripts/update-ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import_merge()
{
update "" import_merge
move_layout_files S C
move_layout_files T C
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
c1
timeGetOut
0
time
timeGetIn
0

Loading

0 comments on commit 822410e

Please sign in to comment.