-
Notifications
You must be signed in to change notification settings - Fork 5
Migrate TLB to rocket #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: split
Are you sure you want to change the base?
Conversation
|
In current approach, module class TLB(
instruction: Boolean,
lgMaxSize: Int,
cfg: TLBConfig,
edge: TLEdgeOut,
pmpGranularity: Int,
pgLevels: Int,
minPgLevels: Int,
pgLevelBits: Int,
pgIdxBits: Int,
vpnBits: Int,
ppnBits: Int,
vaddrBits: Int,
vaddrBitsExtended: Int,
paddrBits: Int,
hypervisorExtraAddrBits: Int,
asIdBits: Int,
xLen: Int,
cacheBlockBytes: Int,
usingHypervisor: Boolean,
usingVM: Boolean,
usingAtomics: Boolean,
usingAtomicsInCache: Boolean,
usingAtomicsOnlyForIO: Boolean,
usingDataScratchpad: Boolean) extends Module with MemoryOpConstants {Is this a potential problem or it is acceptable? |
|
What has not been done in this PR:
The former two tasks may be suitable for other new PRs. And I cannot figure out a decent solution for the last task. |
rocket/src/TLB.scala
Outdated
| instruction: Boolean, | ||
| lgMaxSize: Int, | ||
| cfg: TLBConfig, | ||
| edge: TLEdgeOut, // TODO: Decoupled from Tilelink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract this
| @@ -0,0 +1,136 @@ | |||
| // See LICENSE.SiFive for license details. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move it to utils and deprecate it with BitSet
| class TLB( | ||
| instruction: Boolean, | ||
| lgMaxSize: Int, | ||
| cfg: TLBConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually parameter below are all TLBConfig, but OK for now.
rocket/src/TLB.scala
Outdated
| val mpu_physaddr = Cat(mpu_ppn, io.req.bits.vaddr(pgIdxBits-1, 0)) | ||
| val mpu_priv = Mux[UInt](usingVM.B && (do_refill || io.req.bits.passthrough /* PTW */), PRV.S.U, Cat(io.ptw.status.debug, priv)) | ||
| val pmp = Module(new PMPChecker(lgMaxSize)) | ||
| val pmp = Module(new PMPChecker(lgMaxSize)) // TODO: Dependent on PMP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand comments here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it work, it requires refactor on PMP. So it won't pass compilation until PMP is migrated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this PR depends on PMP refactor now.
rocket/src/TLBPermissions.scala
Outdated
| require (!m.supportsLogical || m.supportsLogical .contains(amoSizes), s"Memory region '${m.name}' at ${m.address} only supports ${m.supportsLogical} Logical, but must support ${amoSizes}") | ||
| require (!m.supportsArithmetic || m.supportsArithmetic.contains(amoSizes), s"Memory region '${m.name}' at ${m.address} only supports ${m.supportsArithmetic} Arithmetic, but must support ${amoSizes}") | ||
| require (!(m.supportsAcquireB && m.supportsPutFull && !m.supportsAcquireT), s"Memory region '${m.name}' supports AcquireB (cached read) and PutFull (un-cached write) but not AcquireT (cached write)") | ||
| val permissions = memParameters.foreach { p => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically it should be decouple from TileLink, but OK for now...
|
Is it necessary to move refactor of files like |
rocket/src/TLB.scala
Outdated
| val mpu_physaddr = Cat(mpu_ppn, io.req.bits.vaddr(pgIdxBits-1, 0)) | ||
| val mpu_priv = Mux[UInt](usingVM.B && (do_refill || io.req.bits.passthrough /* PTW */), PRV.S.U, Cat(io.ptw.status.debug, priv)) | ||
| val pmp = Module(new PMPChecker(lgMaxSize)) | ||
| val pmp = Module(new PMPChecker(lgMaxSize)) // TODO: Dependent on PMP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this PR depends on PMP refactor now.
OK~ |
No description provided.