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

Commit

Permalink
hz from Int to BigInt. good lord.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Jun 2, 2024
1 parent 353c7f1 commit 8f7a15a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/ee/hrzn/chryse/platform/Platform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ package ee.hrzn.chryse.platform

trait Platform {
val id: String
val clockHz: Int
val clockHz: BigInt
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ICE40Top[Top <: Module](
clk_gb.PACKAGE_PIN := clki
private val clk = clk_gb.GLOBAL_BUFFER_OUTPUT

private val timerLimit = (15e-6 * platform.clockHz).toInt
private val timerLimit = (15 * platform.clockHz / 1_000_000).toInt
private val resetTimerReg =
withClock(clk)(Reg(UInt(unsignedBitLength(timerLimit).W)))
private val reset = Wire(Bool())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ package ee.hrzn.chryse.platform.resource

import chisel3._

case class ClockSource(hz: Int) extends ResourceData(Input(Clock())) {}
case class ClockSource(hz: BigInt) extends ResourceData(Input(Clock())) {}

object ClockSource {
def apply(hz: Int) = new ClockSource(hz)
def apply(hz: BigInt) = new ClockSource(hz)
}

0 comments on commit 8f7a15a

Please sign in to comment.