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

Commit

Permalink
ice40: optionally allow inferring spram.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Jun 6, 2024
1 parent c1a1ed2 commit 08de64a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ trait Ice40Platform { this: PlatformBoard[_ <: PlatformBoardResources] =>
type TopPlatform[Top <: Module] = Ice40Top[Top]
type BuildResult = String

val ice40Args: Seq[String] = Seq()
val ice40Variant: Ice40Variant
val ice40Package: String

Expand All @@ -36,7 +37,10 @@ trait Ice40Platform { this: PlatformBoard[_ <: PlatformBoardResources] =>
new Ice40Top(this, genTop)
}

def yosysSynthCommand(top: String) = s"synth_ice40 -top $top"
def yosysSynthCommand(top: String) =
s"synth_ice40 -top $top" + (if (ice40Args.nonEmpty)
s" ${ice40Args.mkString(" ")}"
else "")

def build(
chryse: ChryseApp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ import ee.hrzn.chryse.platform.resource.Uart

case class IceBreakerPlatform(
ubtnReset: Boolean = false,
inferSpram: Boolean = false,
) extends PlatformBoard[IceBreakerPlatformResources]
with Ice40Platform {
val id = "icebreaker"
val clockHz = 12_000_000

override val ice40Args = if (inferSpram) Seq("-spram") else Seq()
override val ice40Variant = UP5K
val ice40Package = "sg48"

Expand Down

0 comments on commit 08de64a

Please sign in to comment.