提交 52fcd981 编写于 作者: Z Zihao Yu

memory: add memory package

上级 824ec125
......@@ -3,7 +3,7 @@ package gpu
import chisel3._
import chisel3.util._
import noop.MemIO
import memory.MemIO
class PixelBundle extends Bundle {
val a = UInt(8.W)
......
package memory
import chisel3._
import chisel3.util._
class MemAddrBundle extends Bundle {
val addr = Output(UInt(32.W))
val size = Output(UInt(3.W))
}
class MemDataBundle(val dataBits: Int) extends Bundle {
val data = Output(UInt(dataBits.W))
}
class MemMaskDataBundle(dataBits: Int) extends MemDataBundle(dataBits) {
val mask = Output(UInt((dataBits / 8).W))
}
class MemIO(val dataBits: Int = 32) extends Bundle {
val a = Valid(new MemAddrBundle)
val r = Flipped(Valid(new MemDataBundle(dataBits)))
val w = Valid(new MemMaskDataBundle(dataBits))
}
package top
import noop.MemIO
package memory
import chisel3._
import chisel3.util._
......
......@@ -44,22 +44,3 @@ class BranchIO extends Bundle {
val isTaken = Output(Bool())
val target = Output(UInt(32.W))
}
class MemAddrBundle extends Bundle {
val addr = Output(UInt(32.W))
val size = Output(UInt(3.W))
}
class MemDataBundle(val dataBits: Int) extends Bundle {
val data = Output(UInt(dataBits.W))
}
class MemMaskDataBundle(dataBits: Int) extends MemDataBundle(dataBits) {
val mask = Output(UInt((dataBits / 8).W))
}
class MemIO(val dataBits: Int = 32) extends Bundle {
val a = Valid(new MemAddrBundle)
val r = Flipped(Valid(new MemDataBundle(dataBits)))
val w = Valid(new MemMaskDataBundle(dataBits))
}
......@@ -3,6 +3,8 @@ package noop
import chisel3._
import chisel3.util._
import memory.MemIO
object LookupTree {
private val useMuxTree = true
......
......@@ -3,6 +3,8 @@ package noop
import chisel3._
import chisel3.util._
import memory.MemIO
trait HasResetVector {
val resetVector = 0x80100000L
}
......
......@@ -3,6 +3,7 @@ package noop
import chisel3._
import chisel3.util._
import memory.MemIO
import gpu.GPU
trait NOOPConfig {
......
......@@ -3,6 +3,8 @@ package noop
import chisel3._
import chisel3.util._
import memory.MemIO
trait HasLSUOpType {
val LsuOpTypeNum = 10
......
......@@ -5,6 +5,8 @@ import noop._
import chisel3._
import chisel3.util._
import memory.DistributedMem
class NOOPSimTop(memInitFile: String = "") extends Module {
val io = IO(new Bundle{
val trap = Output(UInt((3 + 1 + 4 + 32 + 32 + 2).W))
......
package top
import noop.MemIO
import chisel3._
import chisel3.util._
import memory.MemIO
class SimMMIO extends Module {
val io = IO(new Bundle {
val rw = Flipped(new MemIO)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册