Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
28b71a00
Commit
28b71a00
authored
Jul 12, 2016
by
Jens Korinth
Browse files
Move individual test outputs to own subdir
* each suite now has a subdir * each test has subdir within suite dir
parent
6fc06386
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/test/scala/DataWidthConverterSuite.scala
View file @
28b71a00
...
...
@@ -3,6 +3,7 @@ import org.scalatest.junit.JUnitSuite
import
org.junit.Test
import
org.junit.Assert._
import
scala.math._
import
java.nio.file.Paths
/**
* DataWidthConverterHarness: Attaches data source to DWC.
...
...
@@ -114,7 +115,11 @@ class DataWidthConverterSuite extends JUnitSuite {
def
resize
(
inWidth
:
Int
,
outWidth
:
Int
,
littleEndian
:
Boolean
=
true
)
=
{
println
(
"testing conversion of %d bit to %d bit, %s ..."
.
format
(
inWidth
,
outWidth
,
if
(
littleEndian
)
"little-endian"
else
"big-endian"
))
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test"
,
"--compile"
,
"--test"
),
val
dir
=
Paths
.
get
(
"test"
)
.
resolve
(
"DataWidthConverterSuite"
)
.
resolve
(
"%dto%d%s"
.
format
(
inWidth
,
outWidth
,
if
(
littleEndian
)
"le"
else
"be"
))
.
toString
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
dir
,
"--compile"
,
"--test"
),
()
=>
Module
(
new
DataWidthConverterHarness
(
inWidth
,
outWidth
,
littleEndian
)))
{
m
=>
new
DataWidthConverter_OutputCheck
(
m
)
}
}
...
...
src/test/scala/DecoupledDataSourceSuite.scala
View file @
28b71a00
...
...
@@ -44,7 +44,7 @@ class DecoupledDataSourceSuite extends JUnitSuite {
val
width
=
Seq
(
1
,
(
scala
.
math
.
random
*
64
).
toInt
).
max
val
repeat
=
scala
.
math
.
random
>
0.5
println
(
"testing cnt = %d, width = %d, repeat = %b ..."
.
format
(
cnt
,
width
,
repeat
))
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test"
,
"--compile"
,
"--test"
),
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test
/DecoupledDataSourceSuite/checkRandomOutputs
"
,
"--compile"
,
"--test"
),
()
=>
Module
(
new
DecoupledDataSource
(
UInt
(
width
=
width
),
cnt
,
i
=>
UInt
((
scala
.
math
.
random
*
scala
.
math
.
pow
(
2
,
width
)).
toInt
),
repeat
)))
{
m
=>
new
DecoupledDataSource_OutputCheck
(
m
)
}
}
...
...
@@ -52,14 +52,14 @@ class DecoupledDataSourceSuite extends JUnitSuite {
/** Performs test for 8bit wide sequential data with repeat. **/
@Test
def
checkSequentialOutputsWithRepeat
{
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test"
,
"--compile"
,
"--test"
),
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test
/DecoupledDataSourceSuite/checkSequentialOutputsWithRepeat
"
,
"--compile"
,
"--test"
),
()
=>
Module
(
new
DecoupledDataSource
(
UInt
(
width
=
8
),
256
,
i
=>
UInt
(
i
),
true
)))
{
m
=>
new
DecoupledDataSource_OutputCheck
(
m
)
}
}
/** Performs test for 8bit wide sequential data without repeat. **/
@Test
def
checkSequentialOutputsWithoutRepeat
{
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test"
,
"--compile"
,
"--test"
),
chiselMainTest
(
Array
(
"--genHarness"
,
"--backend"
,
"c"
,
"--vcd"
,
"--targetDir"
,
"test
/DecoupledDataSourceSuite/checkSequentialOutputWithoutRepeat
"
,
"--compile"
,
"--test"
),
()
=>
Module
(
new
DecoupledDataSource
(
UInt
(
width
=
8
),
256
,
i
=>
UInt
(
i
),
false
)))
{
m
=>
new
DecoupledDataSource_OutputCheck
(
m
)
}
}
...
...
Jens Korinth
@jk
mentioned in commit
17f0d672
·
Mar 05, 2018
mentioned in commit
17f0d672
mentioned in commit 17f0d67240ebf5d7e1d0be9162d272b04256c47d
Toggle commit list
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