Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
CXXRTLOptions: take platform instances, not types.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed May 26, 2024
1 parent dae81fd commit 1ecfc72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/main/scala/ee/hrzn/chryse/ChryseApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ abstract class ChryseApp {
object cxxsim extends Subcommand("cxxsim") {
banner("Run the C++ simulator tests.")

val platformChoices: Seq[_ <: CXXRTLPlatform] = cxxrtlOptions
.map(_.platforms.map(_.getConstructor().newInstance()))
.getOrElse(Seq())
val platformChoices = cxxrtlOptions.map(_.platforms).getOrElse(Seq())

val platform =
if (platformChoices.length > 1)
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/ee/hrzn/chryse/ExampleApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ object ExampleApp extends ChryseApp {
override def genTop()(implicit platform: Platform) = new Top
override val targetPlatforms = Seq(IceBreakerPlatform())
override val cxxrtlOptions = Some(
CXXRTLOptions(platforms = Seq(classOf[ExampleCXXRTLPlatform])),
CXXRTLOptions(platforms =
Seq(new CXXRTLPlatform(id = "ex", clockHz = 3_000_000) {}),
),
)
}

class ExampleCXXRTLPlatform
extends CXXRTLPlatform(id = "ex", clockHz = 3_000_000)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chisel3.BlackBox
import scala.sys.process._

final case class CXXRTLOptions(
platforms: Seq[Class[_ <: CXXRTLPlatform]],
platforms: Seq[CXXRTLPlatform],
blackboxes: Seq[Class[_ <: BlackBox]] = Seq(),
cxxFlags: Seq[String] = Seq(),
ldFlags: Seq[String] = Seq(),
Expand Down

0 comments on commit 1ecfc72

Please sign in to comment.