Skip to content
Snippets Groups Projects
Verified Commit 6b278e2c authored by Minyong Li's avatar Minyong Li :speech_balloon:
Browse files

core.DataMemory: change ports from 2r1w to 1r1w

parent 0520abf8
No related branches found
No related tags found
No related merge requests found
...@@ -10,15 +10,10 @@ import uk.ac.soton.ecs.can.config.CanCoreConfiguration ...@@ -10,15 +10,10 @@ import uk.ac.soton.ecs.can.config.CanCoreConfiguration
class DataMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule { class DataMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule {
private val addrWidth = log2Ceil(cfg.dataMemoryWords) private val addrWidth = log2Ceil(cfg.dataMemoryWords)
val read = IO( val read = IO(new Bundle {
Vec( val addr = Input(UInt(addrWidth.W))
2, val data = Output(UInt(512.W))
new Bundle { })
val addr = Input(UInt(addrWidth.W))
val data = Output(UInt(512.W))
}
)
)
val write = IO(new Bundle { val write = IO(new Bundle {
val en = Input(Bool()) val en = Input(Bool())
val addr = Input(UInt(addrWidth.W)) val addr = Input(UInt(addrWidth.W))
...@@ -31,7 +26,7 @@ class DataMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule { ...@@ -31,7 +26,7 @@ class DataMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule {
else else
Mem(cfg.dataMemoryWords, UInt(512.W)) Mem(cfg.dataMemoryWords, UInt(512.W))
read.foreach(p => p.data := mem(p.addr)) read.data := mem(read.addr)
when(write.en) { when(write.en) {
mem(write.addr) := write.data mem(write.addr) := write.data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment