This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f980052
commit d3db52a
Showing
6 changed files
with
99 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
version = "3.5.9" | ||
runner.dialect = scala213 |
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,8 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.formatOnSaveMode": "file", | ||
"metals.scalafmtConfigPath": ".scalafmt.conf", | ||
"files.watcherExclude": { | ||
"**/target": true | ||
} | ||
} |
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,3 @@ | ||
[ZoneTransfer] | ||
ZoneId=3 | ||
HostUrl=https://raw.githubusercontent.com/cslab-chosun/online-fuzzy-chisel/main/.scalafmt.conf |
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,38 @@ | ||
package hwdbg.libs.mem | ||
|
||
import chisel3._ | ||
import chisel3.util.experimental.loadMemoryFromFileInline | ||
|
||
class InitMemInline( | ||
debug: Boolean = DebuggerConfigurations.ENABLE_DEBUG, | ||
memoryFile: String = "", | ||
addrWidth: Int = DebuggerConfigurations.BLOCK_RAM_ADDR_WIDTH, | ||
width: Int = DebuggerConfigurations.BLOCK_RAM_DATA_WIDTH, | ||
size: Int = GeneralConfigurations.DEFAULT_CONFIGURATION_INITIALIZED_MEMORY_SIZE | ||
) extends Module { | ||
|
||
val io = IO(new Bundle { | ||
val enable = Input(Bool()) | ||
val write = Input(Bool()) | ||
val addr = Input(UInt(10.W)) | ||
val dataIn = Input(UInt(width.W)) | ||
val dataOut = Output(UInt(width.W)) | ||
}) | ||
|
||
val mem = SyncReadMem(size / width, UInt(width.W)) | ||
|
||
// | ||
// Initialize memory | ||
// | ||
if (memoryFile.trim().nonEmpty) { | ||
loadMemoryFromFileInline(mem, memoryFile) | ||
} | ||
|
||
io.dataOut := DontCare | ||
|
||
when(io.enable) { | ||
val rdwrPort = mem(io.addr) | ||
when (io.write) { rdwrPort := io.dataIn } | ||
.otherwise { io.dataOut := rdwrPort } | ||
} | ||
} |
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