From 4f6d8ee5ce17b4b65a964625f75dbbc98213eb2f Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Tue, 27 Aug 2024 16:35:34 +0800 Subject: [PATCH] [rtl] public all modules --- rocketv/src/ALU.scala | 3 ++- rocketv/src/AMOALU.scala | 3 ++- rocketv/src/BTB.scala | 1 + rocketv/src/Breakpoint.scala | 3 ++- rocketv/src/CSR.scala | 1 + rocketv/src/Decoder.scala | 3 ++- rocketv/src/FPU.scala | 1 + rocketv/src/FetchQueue.scala | 1 + rocketv/src/Frontend.scala | 1 + rocketv/src/HellaCache.scala | 1 + rocketv/src/HellaCacheArbiter.scala | 1 + rocketv/src/IBuf.scala | 1 + rocketv/src/ICache.scala | 1 + rocketv/src/MulDiv.scala | 1 + rocketv/src/PMA.scala | 3 ++- rocketv/src/PMP.scala | 3 ++- rocketv/src/PTW.scala | 3 ++- rocketv/src/PipelinedMultiplier.scala | 1 + rocketv/src/RVCExpander.scala | 3 ++- rocketv/src/RocketCore.scala | 3 ++- rocketv/src/RocketTile.scala | 3 ++- rocketv/src/TLB.scala | 1 + rocketv/src/fpu/FPToFP.scala | 1 + rocketv/src/fpu/FPToInt.scala | 1 + rocketv/src/fpu/FPUFMAPipe.scala | 1 + rocketv/src/fpu/IntToFP.scala | 1 + rocketv/src/fpu/MulAddRecFNPipe.scala | 1 + t1/src/T1.scala | 1 + t1rocket/src/T1RocketTile.scala | 3 ++- 29 files changed, 40 insertions(+), 11 deletions(-) diff --git a/rocketv/src/ALU.scala b/rocketv/src/ALU.scala index ecf34d50a..09d119a74 100644 --- a/rocketv/src/ALU.scala +++ b/rocketv/src/ALU.scala @@ -56,7 +56,8 @@ class ALUInterface(parameter: ALUParameter) extends Bundle { @instantiable class ALU(val parameter: ALUParameter) extends FixedIORawModule(new ALUInterface(parameter)) - with SerializableModule[ALUParameter] { + with SerializableModule[ALUParameter] + with Public { // compatibility layer val aluFn = parameter val xLen = parameter.xLen diff --git a/rocketv/src/AMOALU.scala b/rocketv/src/AMOALU.scala index 84e9ec5a8..8e822cda7 100644 --- a/rocketv/src/AMOALU.scala +++ b/rocketv/src/AMOALU.scala @@ -37,7 +37,8 @@ class AMOALUInterface(parameter: AMOALUParameter) extends Bundle { @instantiable class AMOALU(val parameter: AMOALUParameter) extends FixedIORawModule(new AMOALUInterface(parameter)) - with SerializableModule[AMOALUParameter] { + with SerializableModule[AMOALUParameter] + with Public { val M_XA_MAX = parameter.M_XA_MAX val M_XA_MAXU = parameter.M_XA_MAXU val M_XA_MIN = parameter.M_XA_MIN diff --git a/rocketv/src/BTB.scala b/rocketv/src/BTB.scala index 7a7d85f29..44e8320d8 100644 --- a/rocketv/src/BTB.scala +++ b/rocketv/src/BTB.scala @@ -91,6 +91,7 @@ class BTBInterface(parameter: BTBParameter) extends Bundle { class BTB(val parameter: BTBParameter) extends FixedIORawModule(new BTBInterface(parameter)) with SerializableModule[BTBParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/Breakpoint.scala b/rocketv/src/Breakpoint.scala index e55a28d64..f66b93287 100644 --- a/rocketv/src/Breakpoint.scala +++ b/rocketv/src/Breakpoint.scala @@ -32,7 +32,8 @@ class BreakpointUnitInterface(parameter: BreakpointUnitParameter) extends Bundle @instantiable class BreakpointUnit(val parameter: BreakpointUnitParameter) extends FixedIORawModule(new BreakpointUnitInterface(parameter)) - with SerializableModule[BreakpointUnitParameter] { + with SerializableModule[BreakpointUnitParameter] + with Public { io.xcpt_if := false.B io.xcpt_ld := false.B io.xcpt_st := false.B diff --git a/rocketv/src/CSR.scala b/rocketv/src/CSR.scala index e5ed68566..a1248a366 100644 --- a/rocketv/src/CSR.scala +++ b/rocketv/src/CSR.scala @@ -288,6 +288,7 @@ class CSRInterface(parameter: CSRParameter) extends Bundle { class CSR(val parameter: CSRParameter) extends FixedIORawModule(new CSRInterface(parameter)) with SerializableModule[CSRParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/Decoder.scala b/rocketv/src/Decoder.scala index c2fc13a75..52e63c185 100644 --- a/rocketv/src/Decoder.scala +++ b/rocketv/src/Decoder.scala @@ -963,7 +963,8 @@ case class RocketDecodePattern(instruction: Instruction) extends DecodePattern { @instantiable class Decoder(val parameter: DecoderParameter) extends FixedIORawModule(new DecoderInterface(parameter)) - with SerializableModule[DecoderParameter] { + with SerializableModule[DecoderParameter] + with Public { io.output := parameter.table.decode(io.instruction) } diff --git a/rocketv/src/FPU.scala b/rocketv/src/FPU.scala index ab44e80fb..4657245b5 100644 --- a/rocketv/src/FPU.scala +++ b/rocketv/src/FPU.scala @@ -53,6 +53,7 @@ class FPUInterface(parameter: FPUParameter) extends Bundle { class FPU(val parameter: FPUParameter) extends FixedIORawModule(new FPUInterface(parameter)) with SerializableModule[FPUParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/FetchQueue.scala b/rocketv/src/FetchQueue.scala index c1ad35fc1..fac29d4fb 100644 --- a/rocketv/src/FetchQueue.scala +++ b/rocketv/src/FetchQueue.scala @@ -48,6 +48,7 @@ class FetchQueueInterface(parameter: FetchQueueParameter) extends Bundle { class FetchQueue(val parameter: FetchQueueParameter) extends FixedIORawModule(new FetchQueueInterface(parameter)) with SerializableModule[FetchQueueParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/Frontend.scala b/rocketv/src/Frontend.scala index 36a313d84..f83bb7af2 100644 --- a/rocketv/src/Frontend.scala +++ b/rocketv/src/Frontend.scala @@ -233,6 +233,7 @@ class FrontendInterface(parameter: FrontendParameter) extends Bundle { class Frontend(val parameter: FrontendParameter) extends FixedIORawModule(new FrontendInterface(parameter)) with SerializableModule[FrontendParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/HellaCache.scala b/rocketv/src/HellaCache.scala index 73ea2bfc4..5483da453 100644 --- a/rocketv/src/HellaCache.scala +++ b/rocketv/src/HellaCache.scala @@ -317,6 +317,7 @@ class HellaCacheInterface(parameter: HellaCacheParameter) extends Bundle { class HellaCache(val parameter: HellaCacheParameter) extends FixedIORawModule(new HellaCacheInterface(parameter)) with SerializableModule[HellaCacheParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/HellaCacheArbiter.scala b/rocketv/src/HellaCacheArbiter.scala index fb5c32007..2bb3fb914 100644 --- a/rocketv/src/HellaCacheArbiter.scala +++ b/rocketv/src/HellaCacheArbiter.scala @@ -109,6 +109,7 @@ class HellaCacheArbiterInterface(parameter: HellaCacheArbiterParameter) extends class HellaCacheArbiter(val parameter: HellaCacheArbiterParameter) extends FixedIORawModule(new HellaCacheArbiterInterface(parameter)) with SerializableModule[HellaCacheArbiterParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/IBuf.scala b/rocketv/src/IBuf.scala index 781d2a94e..3b90b0558 100644 --- a/rocketv/src/IBuf.scala +++ b/rocketv/src/IBuf.scala @@ -64,6 +64,7 @@ class IBufInterface(parameter: IBufParameter) extends Bundle { class IBuf(val parameter: IBufParameter) extends FixedIORawModule(new IBufInterface(parameter)) with SerializableModule[IBufParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/ICache.scala b/rocketv/src/ICache.scala index ca508f513..066cd537c 100644 --- a/rocketv/src/ICache.scala +++ b/rocketv/src/ICache.scala @@ -128,6 +128,7 @@ class ICacheInterface(parameter: ICacheParameter) extends Bundle { class ICache(val parameter: ICacheParameter) extends FixedIORawModule(new ICacheInterface(parameter)) with SerializableModule[ICacheParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/MulDiv.scala b/rocketv/src/MulDiv.scala index 72b20b75e..b71737041 100644 --- a/rocketv/src/MulDiv.scala +++ b/rocketv/src/MulDiv.scala @@ -49,6 +49,7 @@ class MulDivInterface(parameter: MulDivParameter) extends Bundle { class MulDiv(val parameter: MulDivParameter) extends FixedIORawModule(new MulDivInterface(parameter)) with SerializableModule[MulDivParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/PMA.scala b/rocketv/src/PMA.scala index 7c3ae51f9..0f457e065 100644 --- a/rocketv/src/PMA.scala +++ b/rocketv/src/PMA.scala @@ -40,7 +40,8 @@ class PMACheckerInterface(parameter: PMACheckerParameter) extends Bundle { @instantiable class PMAChecker(val parameter: PMACheckerParameter) extends FixedIORawModule(new PMACheckerInterface(parameter)) - with SerializableModule[PMACheckerParameter] { + with SerializableModule[PMACheckerParameter] + with Public { // check exist a slave can consume this address. val legal_address = parameter.legal.matches(io.paddr) io.resp.cacheable := legal_address && (if(parameter.cacheable.isEmpty) false.B else parameter.cacheable.matches(io.paddr)) diff --git a/rocketv/src/PMP.scala b/rocketv/src/PMP.scala index be454eae4..d9a9a97bb 100644 --- a/rocketv/src/PMP.scala +++ b/rocketv/src/PMP.scala @@ -34,7 +34,8 @@ class PMPCheckerInterface(parameter: PMPCheckerParameter) extends Bundle { @instantiable class PMPChecker(val parameter: PMPCheckerParameter) extends FixedIORawModule(new PMPCheckerInterface(parameter)) - with SerializableModule[PMPCheckerParameter] { + with SerializableModule[PMPCheckerParameter] + with Public { val paddrBits = parameter.paddrBits val pmpGranularity = parameter.pmpGranularity diff --git a/rocketv/src/PTW.scala b/rocketv/src/PTW.scala index 745e4aa66..ad3741648 100644 --- a/rocketv/src/PTW.scala +++ b/rocketv/src/PTW.scala @@ -170,7 +170,8 @@ class PTW(val parameter: PTWParameter) extends FixedIORawModule(new PTWInterface(parameter)) with SerializableModule[PTWParameter] with ImplicitClock - with ImplicitReset { + with ImplicitReset + with Public { override protected def implicitClock: Clock = io.clock override protected def implicitReset: Reset = io.reset diff --git a/rocketv/src/PipelinedMultiplier.scala b/rocketv/src/PipelinedMultiplier.scala index c4e03237b..f2dbfad3c 100644 --- a/rocketv/src/PipelinedMultiplier.scala +++ b/rocketv/src/PipelinedMultiplier.scala @@ -42,6 +42,7 @@ class PipelinedMultiplierInterface(parameter: PipelinedMultiplierParameter) exte class PipelinedMultiplier(val parameter: PipelinedMultiplierParameter) extends FixedIORawModule(new PipelinedMultiplierInterface(parameter)) with SerializableModule[PipelinedMultiplierParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/RVCExpander.scala b/rocketv/src/RVCExpander.scala index b0e5b0795..476f5511d 100644 --- a/rocketv/src/RVCExpander.scala +++ b/rocketv/src/RVCExpander.scala @@ -168,7 +168,8 @@ class RVCExpanderInterface(parameter: RVCExpanderParameter) extends Bundle { @instantiable class RVCExpander(val parameter: RVCExpanderParameter) extends FixedIORawModule(new RVCExpanderInterface(parameter)) - with SerializableModule[RVCExpanderParameter] { + with SerializableModule[RVCExpanderParameter] + with Public { val usingCompressed = parameter.usingCompressed val useAddiForMv = parameter.useAddiForMv val xLen = parameter.xLen diff --git a/rocketv/src/RocketCore.scala b/rocketv/src/RocketCore.scala index bfc489b8d..cd8a468bd 100644 --- a/rocketv/src/RocketCore.scala +++ b/rocketv/src/RocketCore.scala @@ -366,7 +366,8 @@ class Rocket(val parameter: RocketParameter) extends FixedIORawModule(new RocketInterface(parameter)) with SerializableModule[RocketParameter] with ImplicitClock - with ImplicitReset { + with ImplicitReset + with Public { override protected def implicitClock: Clock = io.clock override protected def implicitReset: Reset = io.reset val csr: Instance[CSR] = Instantiate(new CSR(parameter.csrParameter)) diff --git a/rocketv/src/RocketTile.scala b/rocketv/src/RocketTile.scala index d0c784481..38061da13 100644 --- a/rocketv/src/RocketTile.scala +++ b/rocketv/src/RocketTile.scala @@ -401,7 +401,8 @@ class RocketTileInterface(parameter: RocketTileParameter) extends Bundle { class RocketTile(val parameter: RocketTileParameter) extends FixedIORawModule(new RocketTileInterface(parameter)) - with SerializableModule[RocketTileParameter] { + with SerializableModule[RocketTileParameter] + with Public { val rocket: Instance[Rocket] = Instantiate(new Rocket(parameter.rocketParameter)) val frontend: Instance[Frontend] = Instantiate(new Frontend(parameter.frontendParameter)) val hellaCache: Instance[HellaCache] = Instantiate(new HellaCache(parameter.hellaCacheParameter)) diff --git a/rocketv/src/TLB.scala b/rocketv/src/TLB.scala index 3ea02f4f9..2ec45d969 100644 --- a/rocketv/src/TLB.scala +++ b/rocketv/src/TLB.scala @@ -122,6 +122,7 @@ class TLBInterface(parameter: TLBParameter) extends Bundle { class TLB(val parameter: TLBParameter) extends FixedIORawModule(new TLBInterface(parameter)) with SerializableModule[TLBParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/fpu/FPToFP.scala b/rocketv/src/fpu/FPToFP.scala index 1762877d2..3424d0e5d 100644 --- a/rocketv/src/fpu/FPToFP.scala +++ b/rocketv/src/fpu/FPToFP.scala @@ -33,6 +33,7 @@ class FPToFPInterface(parameter: FPToFPParameter) extends Bundle { class FPToFP(val parameter: FPToFPParameter) extends FixedIORawModule(new FPToFPInterface(parameter)) with SerializableModule[FPToFPParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/fpu/FPToInt.scala b/rocketv/src/fpu/FPToInt.scala index 9faa3f3ef..d8c33d83a 100644 --- a/rocketv/src/fpu/FPToInt.scala +++ b/rocketv/src/fpu/FPToInt.scala @@ -30,6 +30,7 @@ class FPToIntInterface(parameter: FPToIntParameter) extends Bundle { class FPToInt(val parameter: FPToIntParameter) extends FixedIORawModule(new FPToIntInterface(parameter)) with SerializableModule[FPToIntParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/fpu/FPUFMAPipe.scala b/rocketv/src/fpu/FPUFMAPipe.scala index 761ffd5a4..3da9c5b74 100644 --- a/rocketv/src/fpu/FPUFMAPipe.scala +++ b/rocketv/src/fpu/FPUFMAPipe.scala @@ -35,6 +35,7 @@ class FPUFMAPipeInterface(parameter: FPUFMAPipeParameter) extends Bundle { class FPUFMAPipe(val parameter: FPUFMAPipeParameter) extends FixedIORawModule(new FPUFMAPipeInterface(parameter)) with SerializableModule[FPUFMAPipeParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/fpu/IntToFP.scala b/rocketv/src/fpu/IntToFP.scala index e2be64c01..82b82906d 100644 --- a/rocketv/src/fpu/IntToFP.scala +++ b/rocketv/src/fpu/IntToFP.scala @@ -33,6 +33,7 @@ class IntToFPInterface(parameter: IntToFPParameter) extends Bundle { class IntToFP(val parameter: IntToFPParameter) extends FixedIORawModule(new IntToFPInterface(parameter)) with SerializableModule[IntToFPParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/rocketv/src/fpu/MulAddRecFNPipe.scala b/rocketv/src/fpu/MulAddRecFNPipe.scala index 48dc9e4b9..72bfd1c1d 100644 --- a/rocketv/src/fpu/MulAddRecFNPipe.scala +++ b/rocketv/src/fpu/MulAddRecFNPipe.scala @@ -41,6 +41,7 @@ class MulAddRecFNPipeInterface(parameter: MulAddRecFNPipeParameter) extends Bund class MulAddRecFNPipe(val parameter: MulAddRecFNPipeParameter) extends FixedIORawModule(new MulAddRecFNPipeInterface(parameter)) with SerializableModule[MulAddRecFNPipeParameter] + with Public with ImplicitClock with ImplicitReset { override protected def implicitClock: Clock = io.clock diff --git a/t1/src/T1.scala b/t1/src/T1.scala index 3fa4ceb7e..6303ae2ce 100644 --- a/t1/src/T1.scala +++ b/t1/src/T1.scala @@ -344,6 +344,7 @@ class T1Interface(parameter: T1Parameter) extends Record { class T1(val parameter: T1Parameter) extends FixedIORawModule(new T1Interface(parameter)) with SerializableModule[T1Parameter] + with Public with ImplicitClock with ImplicitReset { def implicitClock: Clock = io.clock diff --git a/t1rocket/src/T1RocketTile.scala b/t1rocket/src/T1RocketTile.scala index d0b61be83..c2dece7b4 100644 --- a/t1rocket/src/T1RocketTile.scala +++ b/t1rocket/src/T1RocketTile.scala @@ -470,7 +470,8 @@ class T1RocketTileInterface(parameter: T1RocketTileParameter) extends Bundle { class T1RocketTile(val parameter: T1RocketTileParameter) extends FixedIORawModule(new T1RocketTileInterface(parameter)) - with SerializableModule[T1RocketTileParameter] { + with SerializableModule[T1RocketTileParameter] + with Public { val rocket: Instance[Rocket] = Instantiate(new Rocket(parameter.rocketParameter)) val frontend: Instance[Frontend] = Instantiate(new Frontend(parameter.frontendParameter)) val hellaCache: Instance[HellaCache] = Instantiate(new HellaCache(parameter.hellaCacheParameter))