-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split Leros into core (Leros) and top that contains the memories
- Loading branch information
Showing
5 changed files
with
79 additions
and
36 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package leros | ||
|
||
import chisel3._ | ||
import chisel3.util._ | ||
import leros.State._ | ||
import leros.shared.Constants._ | ||
|
||
/** | ||
* Leros top level. | ||
* | ||
* Sequential implementation with two states. | ||
*/ | ||
class LerosTop(prog: String, size: Int = 32, memAddrWidth: Int = 8) extends Module { | ||
|
||
val io = IO(new Bundle { | ||
// val dout = Output(UInt(32.W)) | ||
// val sw = Input(UInt(4.W)) | ||
val led = Output(UInt(8.W)) | ||
}) | ||
|
||
val leros = Module(new Leros(prog)) | ||
// Fetch from instruction memory with an address register that is reset to 0 | ||
val instrMem = Module(new InstrMem(memAddrWidth, prog)) | ||
// Data memory, including the register memory | ||
// read in fetch, write in execute | ||
val dataMem = Module(new DataMem((memAddrWidth), false)) | ||
|
||
instrMem.io <> leros.imemIO | ||
dataMem.io <> leros.dmemIO | ||
|
||
// TODO: LED and decoding for it | ||
io.led := leros.io.led | ||
} | ||
|
||
object LerosTop extends App { | ||
emitVerilog(new LerosTop(args(0)), Array("--target-dir", "generated")) | ||
} |