This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from chryse-hdl/hfosc
SB_HFOSC support.
- Loading branch information
Showing
4 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/scala/ee/hrzn/chryse/platform/ice40/inst/SB_HFOSC.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Copyright © 2024 Asherah Connor. | ||
* | ||
* This file is part of Chryse. | ||
* | ||
* Chryse is free software: you can redistribute it and/or modify it under the | ||
* terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) any | ||
* later version. | ||
* | ||
* Chryse is distributed in the hope that it will be useful, but WITHOUT ANY | ||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Chryse. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package ee.hrzn.chryse.platform.ice40.inst | ||
|
||
import chisel3._ | ||
import chisel3.experimental.ExtModule | ||
|
||
class SB_HFOSC(div: Int) | ||
extends ExtModule( | ||
Map("CLKHF_DIV" -> f"0b${div.toBinaryString.toInt}%02d"), // kill me | ||
) { | ||
val CLKHFEN = IO(Input(Bool())) | ||
val CLKHFPU = IO(Input(Bool())) | ||
val CLKHF = IO(Output(Clock())) | ||
} |