From 1ab50542fe76ef626bd981a01c1a6e6403cb7335 Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Mon, 6 May 2024 12:29:45 +0200 Subject: [PATCH 1/5] Separate testing dependencies and tools. This should help prevent dependency conflicts. --- build.sbt | 2 +- .../examples/pipeline/PipelineExample.scala | 3 --- .../pipeline/PipelineExamplePlus.scala | 5 ----- .../examples/rgb/RgbMultiProcessing.scala | 6 ------ .../TimestampedMessage.scala | 3 --- .../tydi_chisel/ReverseTranspileTest.scala | 19 +++++++++++++++++++ .../nl/tudelft/tydi_chisel/TydiTesting.scala | 0 7 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala rename src/{main => test}/scala/nl/tudelft/tydi_chisel/TydiTesting.scala (100%) diff --git a/build.sbt b/build.sbt index 66e8567..9636c8c 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")) name := "Tydi-Chisel", description := "Tydi-Chisel is an implementation of Tydi concepts in the Chisel HDL.", libraryDependencies += "org.chipsalliance" %% "chisel" % chiselVersion, - libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "5.0.2", + libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "5.0.2" % Test, scalacOptions ++= Seq( "-language:reflectiveCalls", "-deprecation", diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala b/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala index f6450b5..70a442c 100644 --- a/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala +++ b/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala @@ -3,7 +3,6 @@ package nl.tudelft.tydi_chisel.examples.pipeline import chisel3._ import chisel3.internal.firrtl.Width import chisel3.util.Counter -import chiseltest.RawTester.test import circt.stage.ChiselStage.{emitCHIRRTL, emitSystemVerilog} import nl.tudelft.tydi_chisel._ @@ -117,8 +116,6 @@ class PipelineExampleModule extends SimpleProcessorBase(new NumberGroup, new Sta object PipelineExample extends App { println("Test123") - test(new PipelineExampleModule()) { c => println(c.tydiCode) } - // println(emitCHIRRTL(new NonNegativeFilter())) // println(emitSystemVerilog(new NonNegativeFilter(), firtoolOpts = firNormalOpts)) diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala b/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala index 794dd89..6c28489 100644 --- a/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala +++ b/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala @@ -4,7 +4,6 @@ import chisel3._ import chisel3.experimental.hierarchy.Definition import chisel3.internal.firrtl.Width import chisel3.util.Counter -import chiseltest.RawTester.test import circt.stage.ChiselStage.{emitCHIRRTL, emitSystemVerilog} import nl.tudelft.tydi_chisel._ @@ -114,10 +113,6 @@ class PipelinePlusStart object PipelineExamplePlus extends App { println("Test123") -// test(new PipelinePlusModule()) { c => -// println(c.tydiCode) -// } - // println(emitCHIRRTL(new MultiNonNegativeFilter())) // println(emitSystemVerilog(new NonNegativeFilter(), firtoolOpts = firNormalOpts)) diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala b/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala index edd1794..254bcfd 100644 --- a/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala +++ b/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala @@ -25,12 +25,6 @@ class SubProcessor extends SubProcessorBase(new RgbBundle, new RgbBundle) { class MainProcessor extends MultiProcessorGeneral(Definition(new SubProcessor), 6, new RgbBundle, new RgbBundle) object RgbMultiProcessing extends App { - import chiseltest.RawTester.test - - test(new MainProcessor()) { c => - val str = c.tydiCode - println(str) - } println(emitCHIRRTL(new MainProcessor())) private val noOptimizationVerilog: String = diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala b/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala index a52b039..172fbd9 100644 --- a/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala +++ b/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala @@ -2,7 +2,6 @@ package nl.tudelft.tydi_chisel.examples.timestamped_message import chisel3._ import chisel3.internal.firrtl.Width -import chiseltest.RawTester.test import circt.stage.ChiselStage.{emitCHIRRTL, emitSystemVerilog} import nl.tudelft.tydi_chisel._ @@ -97,8 +96,6 @@ object TimestampedMessage extends App { Array("-disable-opt", "-O=debug", "-disable-all-randomization", "-strip-debug-info" /*, "-preserve-values=all"*/ ) println("Test123") - test(new TopLevelModule()) { c => println(c.tydiCode) } - println((new NestedBundle).createEnum) println(emitCHIRRTL(new TimestampedMessageModuleOut())) diff --git a/src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala b/src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala new file mode 100644 index 0000000..a2d490b --- /dev/null +++ b/src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala @@ -0,0 +1,19 @@ +package nl.tudelft.tydi_chisel + +import chiseltest._ +import nl.tudelft.tydi_chisel.examples.pipeline.{PipelineExampleModule, PipelinePlusModule} +import nl.tudelft.tydi_chisel.examples.rgb.MainProcessor +import nl.tudelft.tydi_chisel.examples.timestamped_message.TopLevelModule +import org.scalatest.flatspec.AnyFlatSpec + +class ReverseTranspileTest extends AnyFlatSpec with ChiselScalatestTester { + behavior of "reverse transpilation" + + it should "reverse transpile" in { + // Test reverse transpilation of Chisel to Tydi-Lang code for various modules. + test(new PipelineExampleModule()) { c => println(c.tydiCode) } + test(new PipelinePlusModule()) { c => println(c.tydiCode) } + test(new MainProcessor()) { c => println(c.tydiCode) } + test(new TopLevelModule()) { c => println(c.tydiCode) } + } +} diff --git a/src/main/scala/nl/tudelft/tydi_chisel/TydiTesting.scala b/src/test/scala/nl/tudelft/tydi_chisel/TydiTesting.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/TydiTesting.scala rename to src/test/scala/nl/tudelft/tydi_chisel/TydiTesting.scala From 4ef2b5d3427819057c729ae3cb37fd88a6ffd488 Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Mon, 6 May 2024 15:09:36 +0200 Subject: [PATCH 2/5] Set-up a multi project structure. The testing tools depend on the library and on the chiseltest. --- build.sbt | 65 ++++++++++++------- .../tydi_chisel_test}/TydiTesting.scala | 2 +- 2 files changed, 41 insertions(+), 26 deletions(-) rename {src/test/scala/nl/tudelft/tydi_chisel => testing/src/main/scala/nl/tudelft/tydi_chisel_test}/TydiTesting.scala (99%) diff --git a/build.sbt b/build.sbt index 9636c8c..16bc86d 100644 --- a/build.sbt +++ b/build.sbt @@ -1,36 +1,51 @@ -ThisBuild / homepage := Some(url("https://github.com/abs-tudelft/tydi-chisel")) -ThisBuild / organizationHomepage := Some(url("https://github.com/abs-tudelft/")) -ThisBuild / licenses := List(License.Apache2) -ThisBuild / version := "0.1.0" -ThisBuild / organization := "nl.tudelft" -ThisBuild / organizationName := "ABS Group, Delft University of Technology" -ThisBuild / startYear := Some(2023) - -ThisBuild / scalaVersion := "2.13.12" - val chiselVersion = "5.1.0" -lazy val root = (project in file(".")) - .settings( - name := "Tydi-Chisel", - description := "Tydi-Chisel is an implementation of Tydi concepts in the Chisel HDL.", - libraryDependencies += "org.chipsalliance" %% "chisel" % chiselVersion, - libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "5.0.2" % Test, - scalacOptions ++= Seq( - "-language:reflectiveCalls", - "-deprecation", - "-feature", - "-Xcheckinit", - "-Ymacro-annotations" - ), - addCompilerPlugin("org.chipsalliance" % "chisel-plugin" % chiselVersion cross CrossVersion.full) - ) +ThisBuild / scalaVersion := "2.13.12" // Settings required for scalafix ThisBuild / semanticdbEnabled := true ThisBuild / semanticdbVersion := scalafixSemanticdb.revision ThisBuild / scalafixScalaBinaryVersion := scalaBinaryVersion.value +lazy val commonSettings = Seq( + homepage := Some(url("https://github.com/abs-tudelft/tydi-chisel")), + organizationHomepage := Some(url("https://github.com/abs-tudelft/")), + licenses := List(License.Apache2), + version := "0.1.0", + organization := "nl.tudelft", + organizationName := "ABS Group, Delft University of Technology", + startYear := Some(2023), + libraryDependencies += "org.chipsalliance" %% "chisel" % chiselVersion, + scalacOptions ++= Seq("-language:reflectiveCalls", "-deprecation", "-feature", "-Xcheckinit", "-Ymacro-annotations"), + addCompilerPlugin("org.chipsalliance" % "chisel-plugin" % chiselVersion cross CrossVersion.full) +) + +lazy val library: Project = (project in file(".")) + .settings( + commonSettings, + name := "Tydi-Chisel", + description := "Tydi-Chisel is an implementation of Tydi concepts in the Chisel HDL.", + libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "5.0.2" % Test + ) +// .dependsOn(testingTools % "test->test") + +lazy val testingTools: Project = (project in file("testing")) + .settings( + commonSettings, + name := "Tydi-Chisel-Test", + description := "This package contains the testing tools for Tydi-Chisel", + libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "5.0.2" + ) + .dependsOn(library % "compile->compile") // Make testingTools project depend on the library project + +// Aggregate projects to build them together +lazy val root = (project in file(".")) + .aggregate(library, testingTools) + .settings( + publish := {}, // Disable publishing for the root project + publishLocal := {} + ) + val CICommands = Seq("clean", "compile", "test", "scalafmtCheckAll", "scalafmtSbtCheck", "scalafixAll --check").mkString(";") diff --git a/src/test/scala/nl/tudelft/tydi_chisel/TydiTesting.scala b/testing/src/main/scala/nl/tudelft/tydi_chisel_test/TydiTesting.scala similarity index 99% rename from src/test/scala/nl/tudelft/tydi_chisel/TydiTesting.scala rename to testing/src/main/scala/nl/tudelft/tydi_chisel_test/TydiTesting.scala index 96e2006..acb99fa 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/TydiTesting.scala +++ b/testing/src/main/scala/nl/tudelft/tydi_chisel_test/TydiTesting.scala @@ -1,4 +1,4 @@ -package nl.tudelft.tydi_chisel +package nl.tudelft.tydi_chisel_test import scala.language.implicitConversions From 88869a80974fe0217b9fd7d93600ec43c140f665 Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Mon, 6 May 2024 15:16:22 +0200 Subject: [PATCH 3/5] Move tests over to testing project. --- .../scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala | 0 .../scala/nl/tudelft/tydi_chisel/TydiComplianceTest.scala | 0 .../scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala | 2 +- .../nl/tudelft/tydi_chisel/chisel/BundleLiteralsSpec.scala | 0 .../scala/nl/tudelft/tydi_chisel/chisel/ChiselQueueTest.scala | 0 .../tydi_chisel}/pipeline/PipelineExamplePlusTest.scala | 2 +- .../tudelft/tydi_chisel}/pipeline/PipelineExampleTest.scala | 2 +- .../tudelft/tydi_chisel/utils/ComplexityConverterTest.scala | 4 ++-- .../nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala | 2 +- .../nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala | 2 +- 10 files changed, 7 insertions(+), 7 deletions(-) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala (100%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/TydiComplianceTest.scala (100%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala (97%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/chisel/BundleLiteralsSpec.scala (100%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/chisel/ChiselQueueTest.scala (100%) rename {src/test/scala/nl/tudelft/tydi_chisel/examples => testing/src/test/scala/nl/tudelft/tydi_chisel}/pipeline/PipelineExamplePlusTest.scala (99%) rename {src/test/scala/nl/tudelft/tydi_chisel/examples => testing/src/test/scala/nl/tudelft/tydi_chisel}/pipeline/PipelineExampleTest.scala (99%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala (99%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala (93%) rename {src => testing/src}/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala (95%) diff --git a/src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala similarity index 100% rename from src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/ReverseTranspileTest.scala diff --git a/src/test/scala/nl/tudelft/tydi_chisel/TydiComplianceTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/TydiComplianceTest.scala similarity index 100% rename from src/test/scala/nl/tudelft/tydi_chisel/TydiComplianceTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/TydiComplianceTest.scala diff --git a/src/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala similarity index 97% rename from src/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala index b977cae..f1d9a45 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/TydiStreamDriverTest.scala @@ -3,7 +3,7 @@ package nl.tudelft.tydi_chisel import chisel3._ import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor import chiseltest._ -import nl.tudelft.tydi_chisel.Conversions._ +import nl.tudelft.tydi_chisel_test.Conversions._ import org.scalatest.flatspec.AnyFlatSpec class TydiStreamDriverTest extends AnyFlatSpec with ChiselScalatestTester { diff --git a/src/test/scala/nl/tudelft/tydi_chisel/chisel/BundleLiteralsSpec.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/chisel/BundleLiteralsSpec.scala similarity index 100% rename from src/test/scala/nl/tudelft/tydi_chisel/chisel/BundleLiteralsSpec.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/chisel/BundleLiteralsSpec.scala diff --git a/src/test/scala/nl/tudelft/tydi_chisel/chisel/ChiselQueueTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/chisel/ChiselQueueTest.scala similarity index 100% rename from src/test/scala/nl/tudelft/tydi_chisel/chisel/ChiselQueueTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/chisel/ChiselQueueTest.scala diff --git a/src/test/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlusTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala similarity index 99% rename from src/test/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlusTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala index 98efaf5..0240e07 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlusTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala @@ -4,7 +4,7 @@ import chisel3._ import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor import chisel3.experimental.VecLiterals.{AddObjectLiteralConstructor, AddVecLiteralConstructor} import chiseltest._ -import nl.tudelft.tydi_chisel.Conversions._ +import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel.{TydiProcessorTestWrapper, TydiTestWrapper} import org.scalatest.flatspec.AnyFlatSpec diff --git a/src/test/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExampleTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala similarity index 99% rename from src/test/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExampleTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala index 44d7b95..8bce904 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExampleTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala @@ -2,7 +2,7 @@ package nl.tudelft.tydi_chisel.examples.pipeline import chisel3._ import chiseltest._ -import nl.tudelft.tydi_chisel.Conversions._ +import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel.{TydiProcessorTestWrapper, TydiTestWrapper} import org.scalatest.flatspec.AnyFlatSpec diff --git a/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala similarity index 99% rename from src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala index 19885e2..b84b55a 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala @@ -5,9 +5,9 @@ import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor import chisel3.experimental.VecLiterals.{AddObjectLiteralConstructor, AddVecLiteralConstructor} import chiseltest._ import chiseltest.experimental.expose -import nl.tudelft.tydi_chisel.Conversions._ +import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel._ -import nl.tudelft.tydi_chisel.printUtils._ +import nl.tudelft.tydi_chisel_test.printUtils._ import org.scalatest.flatspec.AnyFlatSpec class ComplexityConverterTest extends AnyFlatSpec with ChiselScalatestTester { diff --git a/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala similarity index 93% rename from src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala index 9a3cafc..2bbd624 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqLengthTest.scala @@ -3,7 +3,7 @@ package nl.tudelft.tydi_chisel.utils import chisel3._ import chisel3.experimental.VecLiterals.AddObjectLiteralConstructor import chiseltest._ -import nl.tudelft.tydi_chisel.printUtils.binaryFromUint +import nl.tudelft.tydi_chisel_test.printUtils.binaryFromUint import org.scalatest.flatspec.AnyFlatSpec class LastSeqLengthTest extends AnyFlatSpec with ChiselScalatestTester { diff --git a/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala similarity index 95% rename from src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala rename to testing/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala index 1e977a9..2f5ae8d 100644 --- a/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessorTest.scala @@ -3,7 +3,7 @@ package nl.tudelft.tydi_chisel.utils import chisel3._ import chisel3.experimental.VecLiterals.AddObjectLiteralConstructor import chiseltest._ -import nl.tudelft.tydi_chisel.printUtils._ +import nl.tudelft.tydi_chisel_test.printUtils._ import org.scalatest.flatspec.AnyFlatSpec class LastSeqProcessorTest extends AnyFlatSpec with ChiselScalatestTester { From 98d21c6ecf26cc7477fe5c4cb32638d8db9a1ddf Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Mon, 6 May 2024 15:35:19 +0200 Subject: [PATCH 4/5] Move library code to subdirectory to have functional aggregation. --- .gitignore | 2 +- build.sbt | 2 +- {src => library/src}/main/scala/Main.scala | 0 .../src}/main/scala/gcd/DecoupledGCD.scala | 0 {src => library/src}/main/scala/gcd/GCD.scala | 0 .../nl/tudelft/tydi_chisel/ReverseTranspiler.scala | 0 .../main/scala/nl/tudelft/tydi_chisel/TydiLib.scala | 0 .../scala/nl/tudelft/tydi_chisel/TydiUtils.scala | 0 .../tydi_chisel/examples/chisel/AxiDataViewTest.sc | 0 .../tudelft/tydi_chisel/examples/chisel/Blink.scala | 0 .../tydi_chisel/examples/chisel/OopExample.sc | 0 .../tudelft/tydi_chisel/examples/chisel/example.sc | 0 .../examples/hello_world/HelloWorld.scala | 0 .../examples/pipeline/PipelineExample.scala | 0 .../examples/pipeline/PipelineExamplePlus.scala | 0 .../nl/tudelft/tydi_chisel/examples/rgb/Rgb.scala | 0 .../tydi_chisel/examples/rgb/RgbDataview.scala | 0 .../examples/rgb/RgbMultiProcessing.scala | 0 .../timestamped_message/TimestampedMessage.scala | 0 .../main/scala/nl/tudelft/tydi_chisel/package.scala | 0 .../tydi_chisel/utils/ComplexityConverter.scala | 0 .../tudelft/tydi_chisel/utils/LastSeqLength.scala | 0 .../tydi_chisel/utils/LastSeqProcessor.scala | 0 {src => library/src}/test/scala/gcd/GCDSpec.scala | 0 {src => library/src}/tydi/hello-world/main.td | 0 .../src}/tydi/number-pipeline/pipeline-example.td | 0 {src => library/src}/tydi/random-access/main.td | 0 {src => library/src}/tydi/rgb/main.td | 0 {src => library/src}/tydi/til-demo.exe | Bin .../timestamped-message/timestamped_message.til | 0 {src => library/src}/tydi/tydi_compiler.exe | Bin 31 files changed, 2 insertions(+), 2 deletions(-) rename {src => library/src}/main/scala/Main.scala (100%) rename {src => library/src}/main/scala/gcd/DecoupledGCD.scala (100%) rename {src => library/src}/main/scala/gcd/GCD.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/ReverseTranspiler.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/TydiUtils.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/chisel/AxiDataViewTest.sc (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/chisel/Blink.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/chisel/OopExample.sc (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/chisel/example.sc (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/hello_world/HelloWorld.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/rgb/Rgb.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbDataview.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/package.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverter.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqLength.scala (100%) rename {src => library/src}/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessor.scala (100%) rename {src => library/src}/test/scala/gcd/GCDSpec.scala (100%) rename {src => library/src}/tydi/hello-world/main.td (100%) rename {src => library/src}/tydi/number-pipeline/pipeline-example.td (100%) rename {src => library/src}/tydi/random-access/main.td (100%) rename {src => library/src}/tydi/rgb/main.td (100%) rename {src => library/src}/tydi/til-demo.exe (100%) rename {src => library/src}/tydi/timestamped-message/timestamped_message.til (100%) rename {src => library/src}/tydi/tydi_compiler.exe (100%) diff --git a/.gitignore b/.gitignore index 21bd0ec..5198e5a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ target/ test_run_dir/ build/ -src/tydi/*/*.scala +library/src/tydi/*/*.scala diff --git a/build.sbt b/build.sbt index 16bc86d..a5889c7 100644 --- a/build.sbt +++ b/build.sbt @@ -20,7 +20,7 @@ lazy val commonSettings = Seq( addCompilerPlugin("org.chipsalliance" % "chisel-plugin" % chiselVersion cross CrossVersion.full) ) -lazy val library: Project = (project in file(".")) +lazy val library: Project = (project in file("library")) .settings( commonSettings, name := "Tydi-Chisel", diff --git a/src/main/scala/Main.scala b/library/src/main/scala/Main.scala similarity index 100% rename from src/main/scala/Main.scala rename to library/src/main/scala/Main.scala diff --git a/src/main/scala/gcd/DecoupledGCD.scala b/library/src/main/scala/gcd/DecoupledGCD.scala similarity index 100% rename from src/main/scala/gcd/DecoupledGCD.scala rename to library/src/main/scala/gcd/DecoupledGCD.scala diff --git a/src/main/scala/gcd/GCD.scala b/library/src/main/scala/gcd/GCD.scala similarity index 100% rename from src/main/scala/gcd/GCD.scala rename to library/src/main/scala/gcd/GCD.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/ReverseTranspiler.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/ReverseTranspiler.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/ReverseTranspiler.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/ReverseTranspiler.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/TydiUtils.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/TydiUtils.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/TydiUtils.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/TydiUtils.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/AxiDataViewTest.sc b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/AxiDataViewTest.sc similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/AxiDataViewTest.sc rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/AxiDataViewTest.sc diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/Blink.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/Blink.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/Blink.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/Blink.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/OopExample.sc b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/OopExample.sc similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/OopExample.sc rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/OopExample.sc diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/example.sc b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/example.sc similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/example.sc rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/chisel/example.sc diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/hello_world/HelloWorld.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/hello_world/HelloWorld.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/hello_world/HelloWorld.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/hello_world/HelloWorld.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExample.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/pipeline/PipelineExamplePlus.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/Rgb.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/Rgb.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/Rgb.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/Rgb.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbDataview.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbDataview.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbDataview.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbDataview.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/rgb/RgbMultiProcessing.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/package.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/package.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/package.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/package.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverter.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverter.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverter.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverter.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqLength.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqLength.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqLength.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqLength.scala diff --git a/src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessor.scala b/library/src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessor.scala similarity index 100% rename from src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessor.scala rename to library/src/main/scala/nl/tudelft/tydi_chisel/utils/LastSeqProcessor.scala diff --git a/src/test/scala/gcd/GCDSpec.scala b/library/src/test/scala/gcd/GCDSpec.scala similarity index 100% rename from src/test/scala/gcd/GCDSpec.scala rename to library/src/test/scala/gcd/GCDSpec.scala diff --git a/src/tydi/hello-world/main.td b/library/src/tydi/hello-world/main.td similarity index 100% rename from src/tydi/hello-world/main.td rename to library/src/tydi/hello-world/main.td diff --git a/src/tydi/number-pipeline/pipeline-example.td b/library/src/tydi/number-pipeline/pipeline-example.td similarity index 100% rename from src/tydi/number-pipeline/pipeline-example.td rename to library/src/tydi/number-pipeline/pipeline-example.td diff --git a/src/tydi/random-access/main.td b/library/src/tydi/random-access/main.td similarity index 100% rename from src/tydi/random-access/main.td rename to library/src/tydi/random-access/main.td diff --git a/src/tydi/rgb/main.td b/library/src/tydi/rgb/main.td similarity index 100% rename from src/tydi/rgb/main.td rename to library/src/tydi/rgb/main.td diff --git a/src/tydi/til-demo.exe b/library/src/tydi/til-demo.exe similarity index 100% rename from src/tydi/til-demo.exe rename to library/src/tydi/til-demo.exe diff --git a/src/tydi/timestamped-message/timestamped_message.til b/library/src/tydi/timestamped-message/timestamped_message.til similarity index 100% rename from src/tydi/timestamped-message/timestamped_message.til rename to library/src/tydi/timestamped-message/timestamped_message.til diff --git a/src/tydi/tydi_compiler.exe b/library/src/tydi/tydi_compiler.exe similarity index 100% rename from src/tydi/tydi_compiler.exe rename to library/src/tydi/tydi_compiler.exe From 3430cb03b7aaa9c1b3c2e4cb6f675d289337b31f Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Mon, 6 May 2024 15:35:26 +0200 Subject: [PATCH 5/5] PreCI. --- .../tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala | 2 +- .../nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala | 2 +- .../nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala index 0240e07..5eed5c7 100644 --- a/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExamplePlusTest.scala @@ -4,8 +4,8 @@ import chisel3._ import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor import chisel3.experimental.VecLiterals.{AddObjectLiteralConstructor, AddVecLiteralConstructor} import chiseltest._ -import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel.{TydiProcessorTestWrapper, TydiTestWrapper} +import nl.tudelft.tydi_chisel_test.Conversions._ import org.scalatest.flatspec.AnyFlatSpec class PipelineExamplePlusTest extends AnyFlatSpec with ChiselScalatestTester { diff --git a/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala index 8bce904..bc6d84c 100644 --- a/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/pipeline/PipelineExampleTest.scala @@ -2,8 +2,8 @@ package nl.tudelft.tydi_chisel.examples.pipeline import chisel3._ import chiseltest._ -import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel.{TydiProcessorTestWrapper, TydiTestWrapper} +import nl.tudelft.tydi_chisel_test.Conversions._ import org.scalatest.flatspec.AnyFlatSpec class PipelineExampleTest extends AnyFlatSpec with ChiselScalatestTester { diff --git a/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala index b84b55a..57c9cc6 100644 --- a/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala +++ b/testing/src/test/scala/nl/tudelft/tydi_chisel/utils/ComplexityConverterTest.scala @@ -5,8 +5,8 @@ import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor import chisel3.experimental.VecLiterals.{AddObjectLiteralConstructor, AddVecLiteralConstructor} import chiseltest._ import chiseltest.experimental.expose -import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel._ +import nl.tudelft.tydi_chisel_test.Conversions._ import nl.tudelft.tydi_chisel_test.printUtils._ import org.scalatest.flatspec.AnyFlatSpec