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
7ab0344b
Commit
7ab0344b
authored
May 15, 2017
by
Jens Korinth
Browse files
Implement re-usable job examples to generate Json
parent
9e99bc51
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/scala/tapasco/jobs/JobExamples.scala
0 → 100644
View file @
7ab0344b
package
de.tu_darmstadt.cs.esa.tapasco.jobs
import
de.tu_darmstadt.cs.esa.tapasco.Common
import
de.tu_darmstadt.cs.esa.tapasco.base._
import
de.tu_darmstadt.cs.esa.tapasco.dse._
import
json._
import
play.api.libs.json._
import
java.io.FileWriter
import
java.nio.file._
/** Contains an example for each kind of Tapasco job.
* Can generate examples for their Json syntax in $TAPASCO_HOME/json-examples/jobs
* via the [[dump]] method.
*/
object
JobExamples
{
val
bulkImportJob
=
BulkImportJob
(
Paths
.
get
(
"some.csv"
))
val
composition
=
Composition
(
Paths
.
get
(
"N/A"
),
Some
(
"An optional description."
),
Seq
[
Composition.Entry
](
Composition
.
Entry
(
"counter"
,
42
),
Composition
.
Entry
(
"k2"
,
42
)))
val
composeJob
=
ComposeJob
(
composition
,
123.0
,
"Vivado"
,
Some
(
Seq
(
"baseline"
)),
Some
(
Seq
(
"pynq"
,
"zedboard"
)),
None
,
// FIXME Features missing
Some
(
"r"
))
val
coreStatisticsJob
=
CoreStatisticsJob
(
Some
(
"somePrefix_"
),
Some
(
Seq
(
"baseline"
)),
Some
(
Seq
(
"vc709"
,
"zc706"
)))
val
dseJob
=
DesignSpaceExplorationJob
(
composition
,
123.0
,
DesignSpace
.
Dimensions
(
true
,
true
,
false
),
Heuristics
.
ThroughputHeuristic
,
16
,
Some
(
Paths
.
get
(
"nonstandard/base/path"
)),
Some
(
Seq
(
"baseline"
)),
Some
(
Seq
(
"pynq"
,
"vc709"
)),
None
,
// FIXME Features missing
Some
(
"r"
))
val
hlsJob
=
HighLevelSynthesisJob
(
"VivadoHLS"
,
Some
(
Seq
(
"baseline"
)),
Some
(
Seq
(
"zedboard"
,
"zc706"
)),
Some
(
Seq
(
"counter"
,
"arraysum"
)))
val
importJob
=
ImportJob
(
Paths
.
get
(
"path/to/ipxact-archive.zip"
),
42
,
Some
(
"Optional description of the core."
),
Some
(
13124425
),
Some
(
Seq
(
"baseline"
)),
Some
(
Seq
(
"zedboard"
,
"zc706"
)))
val
jobs
:
Seq
[
Job
]
=
Seq
(
bulkImportJob
,
composeJob
,
coreStatisticsJob
,
dseJob
,
hlsJob
,
importJob
)
/** Dumps examples into separate files in json-examples/jobs. */
def
dump
{
val
fn
=
Common
.
homeDir
.
resolve
(
"json-examples"
).
resolve
(
"jobs"
).
resolve
(
"Jobs.json"
)
Files
.
createDirectories
(
fn
.
getParent
)
val
fw
=
new
FileWriter
(
fn
.
toString
)
fw
.
append
(
Json
.
prettyPrint
(
Json
.
toJson
(
jobs
)))
fw
.
close
()
jobs
foreach
{
j
=>
val
jfn
=
fn
.
resolveSibling
(
"%s.json"
.
format
(
j
.
getClass
.
getSimpleName
))
val
fw
=
new
FileWriter
(
jfn
.
toString
)
fw
.
append
(
Json
.
prettyPrint
(
Json
.
toJson
(
j
)))
fw
.
close
()
}
}
}
Jens Korinth
@jk
mentioned in commit
a831b501
·
Jul 14, 2017
mentioned in commit
a831b501
mentioned in commit a831b5015df6bd8f8d23ddd334a3b1159392de92
Toggle commit list
Write
Preview
Supports
Markdown
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