diff --git a/Earthfile b/Earthfile index 03535ea9..14055ec9 100644 --- a/Earthfile +++ b/Earthfile @@ -141,21 +141,21 @@ test-case-studies: BUILD +build-scala-all --targets=${targets} --jdk_base=${jdk_base} BUILD +build-rust-linux-host --targets=${targets} FROM debian:latest - WORKDIR /testing RUN apt-get update RUN apt-get install -y curl bash wget python3 python3-pip python3-venv - RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | JABBA_COMMAND="install ${jabba_jdk} -o /jdk" bash + RUN curl -sL https://github.com/Jabba-Team/jabba/raw/main/install.sh | JABBA_COMMAND="install ${jabba_jdk} -o /jdk" bash ENV JAVA_HOME /jdk ENV PATH $JAVA_HOME/bin:$PATH ENV TEST_SLOW=${test_slow} RUN python3 -m venv robotenv - RUN robotenv/bin/python -m pip install robotframework + RUN /robotenv/bin/python -m pip install robotframework FOR target IN ${targets} - COPY --dir +build-scala-all/${target}/* /testing/${target}/ - COPY --dir +build-rust-linux-host/${target}/* /testing/${target}/ - COPY --dir examples_and_benchmarks /testing/${target}/ - COPY *.py /testing/${target}/ - COPY *.robot /testing/${target}/ - RUN cd /testing/${target} && ../robotenv/bin/python -m robot TestsBenchmark.robot - SAVE ARTIFACT /testing/${target}/report.html AS LOCAL test_report.html + WORKDIR /${target} + COPY --dir +build-scala-all/${target}/* . + COPY --dir +build-rust-linux-host/${target}/* . + COPY --dir examples_and_benchmarks . + COPY *.py . + COPY *.robot . + RUN /robotenv/bin/python -m robot TestsBenchmark.robot + SAVE ARTIFACT report.html AS LOCAL test_report.html END \ No newline at end of file diff --git a/build.sbt b/build.sbt index 4e15f916..f68ed535 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,9 @@ ThisBuild / versionScheme := Some("early-semver") ThisBuild / publishMavenStyle := true ThisBuild / publishTo := Some(Opts.resolver.sonatypeStaging) -lazy val forsydeIoVersion = "0.7.3" +ThisBuild / resolvers += Resolver.mavenLocal + +lazy val forsydeIoVersion = "0.7.3-2-gacc6639.dirty" lazy val jgraphtVersion = "1.5.1" lazy val scribeVersion = "3.10.2" lazy val scalaGraphVersion = "1.13.5" diff --git a/examples_and_benchmarks/CODES_ISSS_2023/RaJp/bus_small_with_hwacc.fiodl b/examples_and_benchmarks/CODES_ISSS_2023/RaJp/bus_small_with_hwacc.fiodl index bf19c574..9b1a656f 100644 --- a/examples_and_benchmarks/CODES_ISSS_2023/RaJp/bus_small_with_hwacc.fiodl +++ b/examples_and_benchmarks/CODES_ISSS_2023/RaJp/bus_small_with_hwacc.fiodl @@ -333,408 +333,6 @@ systemgraph { [decision::Allocated, platform::runtime::StaticCyclicScheduler] (allocationHosts) {} - vertex "frontEnd" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p1_0, p2_0, p3_0) - { - "production": { - "p2_0": 1_i, - "p1_0": 1_i, - "p0_0": 1_i, - "p3_0": 1_i - }, - "consumption": { - - }, - "sizeInBits": 2_l, - "operationRequirements": { - "proc": { - "all": 141_l - } - } - } - vertex "rasta" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p1_0, p2_0, p3_0) - { - "production": { - "p2_0": 1_i, - "p3_0": 1_i - }, - "consumption": { - "p1_0": 1_i, - "p0_0": 1_i - }, - "sizeInBits": 4_l, - "operationRequirements": { - "proc": { - "all": 31_l - } - } - } - vertex "powspec" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p1_0, p2_0, p3_0) - { - "production": { - "p2_0": 1_i, - "p3_0": 1_i - }, - "consumption": { - "p1_0": 1_i, - "p0_0": 1_i - }, - "sizeInBits": 6_l, - "operationRequirements": { - "proc": { - "all": 235_l - } - } - } - vertex "audspec" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p1_0, p2_0, p3_0, p4_0) - { - "production": { - "p2_0": 1_i, - "p4_0": 1_i, - "p3_0": 1_i - }, - "consumption": { - "p1_0": 1_i, - "p0_0": 1_i - }, - "sizeInBits": 5_l, - "operationRequirements": { - "proc": { - "all": 108_l - } - } - } - vertex "compJah" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p1_0, p2_0, p3_0, p4_0, p5_0) - { - "production": { - "p5_0": 1_i, - "p4_0": 1_i, - "p3_0": 1_i - }, - "consumption": { - "p2_0": 1_i, - "p1_0": 1_i, - "p0_0": 1_i - }, - "sizeInBits": 4_l, - "operationRequirements": { - "proc": { - "all": 170_l - } - } - } - vertex "rastaFilter" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p1_0, p2_0, p3_0, p4_0) - { - "production": { - "p4_0": 1_i - }, - "consumption": { - "p2_0": 1_i, - "p1_0": 1_i, - "p0_0": 1_i, - "p3_0": 1_i - }, - "sizeInBits": 7_l, - "operationRequirements": { - "proc": { - "all": 194_l - } - } - } - vertex "backEnd" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0, p0_1) - { - "production": { - - }, - "consumption": { - "p0_1": 1_i, - "p0_0": 1_i - }, - "sizeInBits": 5_l, - "operationRequirements": { - "proc": { - "all": 133_l - } - } - } - vertex "chRa0_0" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_1" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_2" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_3" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_4" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_5" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_6" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_7" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_8" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_9" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_10" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_11" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_12" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_13" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chRa0_14" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "getImage_0" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0_0) - { - "production": { - "p0_0_0": 1_i - }, - "consumption": { - - }, - "sizeInBits": 8_l, - "operationRequirements": { - "proc": { - "all": 413_l - } - } - } - vertex "CC_0" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0_0, p0_1_0) - { - "production": { - "p0_1_0": 6_i - }, - "consumption": { - "p0_0_0": 1_i - }, - "sizeInBits": 4_l, - "operationRequirements": { - "proc": { - "all": 1101_l - } - } - } - vertex "DCT_0" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0_0, p0_1_0) - { - "production": { - "p0_1_0": 1_i - }, - "consumption": { - "p0_0_0": 1_i - }, - "sizeInBits": 6_l, - "operationRequirements": { - "proc": { - "all": 252_l - } - } - } - vertex "Huffman_0" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0_0, p0_1_0) - { - "production": { - "p0_1_0": 1_i - }, - "consumption": { - "p0_0_0": 1_i - }, - "sizeInBits": 5_l, - "operationRequirements": { - "proc": { - "all": 340_l - } - } - } - vertex "CS_0" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0_0, p0_1_0) - { - "production": { - "p0_1_0": 1_i - }, - "consumption": { - "p0_0_0": 6_i - }, - "sizeInBits": 4_l, - "operationRequirements": { - "proc": { - "all": 2524_l - }, - "hwacc": { - "CS": 1388_l - } - } - } - vertex "writeImage_0" - [impl::InstrumentedExecutable, moc::sdf::SDFActor, visualization::Visualizable] - (combFunctions, p0_0_0) - { - "production": { - - }, - "consumption": { - "p0_0_0": 1_i - }, - "sizeInBits": 5_l, - "operationRequirements": { - "proc": { - "all": 132_l - } - } - } - vertex "chJ0_0_0" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chJ0_1_0" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chJ0_2_0" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chJ0_3_0" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } - vertex "chJ0_4_0" - [impl::TokenizableDataBlock, moc::sdf::SDFChannel, visualization::Visualizable] - (consumer, initialTokenValues, producer) - { - "numOfInitialTokens": 0_i, - "maxSizeInBits": 0_l, - "tokenSizeInBits": 128_l - } edge [] from "tile_0" port "submodules" to "micro_blaze_0" edge [visualization::VisualContainment] from "tile_0" port "contained" to "micro_blaze_0" edge [] from "tile_0" port "submodules" to "micro_blaze_mem0" @@ -872,44 +470,4 @@ systemgraph { edge [platform::PhysicalConnection,visualization::VisualConnection] from "TDMBus" port "ni_6" to "micro_blaze_ni6" port "bus" edge [platform::PhysicalConnection,visualization::VisualConnection] from "micro_blaze_ni7" port "bus" to "TDMBus" port "ni_7" edge [platform::PhysicalConnection,visualization::VisualConnection] from "TDMBus" port "ni_7" to "micro_blaze_ni7" port "bus" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "frontEnd" port "p0_0" to "chRa0_0" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_0" port "consumer" to "rasta" port "p0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "frontEnd" port "p1_0" to "chRa0_1" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_1" port "consumer" to "rasta" port "p1_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "rasta" port "p2_0" to "chRa0_2" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_2" port "consumer" to "powspec" port "p0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "rasta" port "p3_0" to "chRa0_3" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_3" port "consumer" to "powspec" port "p1_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "powspec" port "p2_0" to "chRa0_4" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_4" port "consumer" to "audspec" port "p0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "powspec" port "p3_0" to "chRa0_5" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_5" port "consumer" to "audspec" port "p1_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "audspec" port "p2_0" to "chRa0_6" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_6" port "consumer" to "rastaFilter" port "p0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "audspec" port "p3_0" to "chRa0_7" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_7" port "consumer" to "compJah" port "p0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "audspec" port "p4_0" to "chRa0_8" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_8" port "consumer" to "compJah" port "p1_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "compJah" port "p3_0" to "chRa0_9" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_9" port "consumer" to "rastaFilter" port "p1_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "compJah" port "p4_0" to "chRa0_10" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_10" port "consumer" to "rastaFilter" port "p2_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "compJah" port "p5_0" to "chRa0_11" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_11" port "consumer" to "rastaFilter" port "p3_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "rastaFilter" port "p4_0" to "chRa0_12" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_12" port "consumer" to "backEnd" port "p0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "frontEnd" port "p2_0" to "chRa0_13" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_13" port "consumer" to "compJah" port "p2_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "frontEnd" port "p3_0" to "chRa0_14" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chRa0_14" port "consumer" to "backEnd" port "p0_1" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "getImage_0" port "p0_0_0" to "chJ0_0_0" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chJ0_0_0" port "consumer" to "CC_0" port "p0_0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "CC_0" port "p0_1_0" to "chJ0_1_0" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chJ0_1_0" port "consumer" to "DCT_0" port "p0_0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "DCT_0" port "p0_1_0" to "chJ0_2_0" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chJ0_2_0" port "consumer" to "Huffman_0" port "p0_0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "Huffman_0" port "p0_1_0" to "chJ0_3_0" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chJ0_3_0" port "consumer" to "CS_0" port "p0_0_0" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "CS_0" port "p0_1_0" to "chJ0_4_0" port "producer" - edge [moc::sdf::SDFDataEdge,visualization::VisualConnection] from "chJ0_4_0" port "consumer" to "writeImage_0" port "p0_0_0" } \ No newline at end of file diff --git a/scala-bridge-forsyde-io/src/main/scala/idesyde/forsydeio/ForSyDeIdentificationModule.scala b/scala-bridge-forsyde-io/src/main/scala/idesyde/forsydeio/ForSyDeIdentificationModule.scala index 04ac1d4f..9a330dff 100644 --- a/scala-bridge-forsyde-io/src/main/scala/idesyde/forsydeio/ForSyDeIdentificationModule.scala +++ b/scala-bridge-forsyde-io/src/main/scala/idesyde/forsydeio/ForSyDeIdentificationModule.scala @@ -44,7 +44,6 @@ object ForSyDeIdentificationModule val modelHandler = ModelHandler() .registerDriver(SDF3Driver()) .registerTraitHierarchy(ForSyDeHierarchy()) - .registerSystemGraphMigrator(TraitNamesFrom0_6To0_7()) // .registerDriver(new ForSyDeAmaltheaDriver()) val identificationRules = Set( diff --git a/scala-bridge-forsyde-io/src/main/scala/idesyde/identification/forsyde/rules/sdf/SDFRules.scala b/scala-bridge-forsyde-io/src/main/scala/idesyde/identification/forsyde/rules/sdf/SDFRules.scala index 06280bbd..5a13b6f0 100644 --- a/scala-bridge-forsyde-io/src/main/scala/idesyde/identification/forsyde/rules/sdf/SDFRules.scala +++ b/scala-bridge-forsyde-io/src/main/scala/idesyde/identification/forsyde/rules/sdf/SDFRules.scala @@ -32,13 +32,16 @@ trait SDFRules { val model = modelOpt.get var sdfActors = Buffer.empty[SDFActor] var sdfChannels = Buffer.empty[SDFChannel] - model.vertexSet.stream + // println(model) + model + .vertexSet() .forEach(v => { if (ForSyDeHierarchy.SDFActor.tryView(model, v).isPresent()) sdfActors += ForSyDeHierarchy.SDFActor.tryView(model, v).get() //else if (SDFDelay.conforms(v)) sdfDelays = SDFDelay.enforce(v) - else if (ForSyDeHierarchy.SDFChannel.tryView(model, v).isPresent()) + if (ForSyDeHierarchy.SDFChannel.tryView(model, v).isPresent()) { sdfChannels += ForSyDeHierarchy.SDFChannel.tryView(model, v).get() + } }) val channelsConnectActors = sdfChannels.forall(c => @@ -88,14 +91,14 @@ trait SDFRules { .map((a, i) => ForSyDeHierarchy.InstrumentedBehaviour .tryView(a) - .map(_.maxSizeInBits().asInstanceOf[Long]) + .map(_.maxSizeInBits().values().asScala.max) .orElse(0L) + a.combFunctions() .stream() .mapToLong(fs => ForSyDeHierarchy.InstrumentedBehaviour .tryView(fs) - .map(_.maxSizeInBits().asInstanceOf[Long]) + .map(_.maxSizeInBits().values().asScala.max) .orElse(0L) ) .sum