Skip to content

Commit

Permalink
[rtl] Handling compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed Jun 14, 2024
1 parent 4e7483f commit b39ce9f
Show file tree
Hide file tree
Showing 74 changed files with 409 additions and 1,388 deletions.
6 changes: 3 additions & 3 deletions t1/src/Bundles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ExtendInstructionType extends Bundle {
class LaneRequest(param: LaneParameter) extends Bundle {
val instructionIndex: UInt = UInt(param.instructionIndexBits.W)
// decode
val decodeResult: DecodeBundle = Decoder.bundle(param.fpuEnable)
val decodeResult: DecodeBundle = Decoder.bundle(param.decoderParam)
val loadStore: Bool = Bool()
val issueInst: Bool = Bool()
val store: Bool = Bool()
Expand Down Expand Up @@ -629,7 +629,7 @@ class LaneExecuteStage(parameter: LaneParameter)(isLastSlot: Boolean) extends Bu
val sSendResponse: Option[Bool] = Option.when(isLastSlot)(Bool())

// pipe state for stage3
val decodeResult: DecodeBundle = Decoder.bundle(parameter.fpuEnable)
val decodeResult: DecodeBundle = Decoder.bundle(parameter.decoderParam)
val instructionIndex: UInt = UInt(parameter.instructionIndexBits.W)
val loadStore: Bool = Bool()
val vd: UInt = UInt(5.W)
Expand All @@ -653,7 +653,7 @@ class ExecutionUnitRecord(parameter: LaneParameter)(isLastSlot: Boolean) extends
val maskType: Bool = Bool()
val laneIndex: UInt = UInt(parameter.laneNumberBits.W)
// pipe state
val decodeResult: DecodeBundle = Decoder.bundle(parameter.fpuEnable)
val decodeResult: DecodeBundle = Decoder.bundle(parameter.decoderParam)
}

class SlotRequestToVFU(parameter: LaneParameter) extends Bundle {
Expand Down
3 changes: 2 additions & 1 deletion t1/src/Lane.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import chisel3.probe.{Probe, ProbeValue, define}
import chisel3.properties.{AnyClassType, Class, ClassType, Path, Property}
import chisel3.util._
import chisel3.util.experimental.decode.DecodeBundle
import org.chipsalliance.t1.rtl.decoder.Decoder
import org.chipsalliance.t1.rtl.decoder.{Decoder, DecoderParam}
import org.chipsalliance.t1.rtl.lane._
import org.chipsalliance.t1.rtl.vrf.{RamType, VRF, VRFParam, VRFProbe}

Expand Down Expand Up @@ -72,6 +72,7 @@ case class LaneParameter(
fpuEnable: Boolean,
portFactor: Int,
vrfRamType: RamType,
decoderParam: DecoderParam,
vfuInstantiateParameter: VFUInstantiateParameter)
extends SerializableModuleParameter {

Expand Down
9 changes: 6 additions & 3 deletions t1/src/T1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import chisel3.probe.{Probe, ProbeValue, define, force}
import chisel3.properties.{AnyClassType, Class, ClassType, Property}
import chisel3.util.experimental.BitSet
import org.chipsalliance.rvdecoderdb.Instruction
import org.chipsalliance.t1.rtl.decoder.{Decoder, T1CustomInstruction}
import org.chipsalliance.t1.rtl.decoder.{Decoder, DecoderParam, T1CustomInstruction}
import org.chipsalliance.t1.rtl.lsu.{LSU, LSUParameter, LSUProbe}
import org.chipsalliance.t1.rtl.vrf.{RamType, VRFParam, VRFProbe}

Expand Down Expand Up @@ -114,7 +114,7 @@ case class T1Parameter(
|""".stripMargin

// FIXME
def allInstuctions: Set[Instruction] = Set.empty
val allInstructions: Set[Instruction] = Set.empty

require(extensions.forall(Seq("Zve32x", "Zve32f").contains), "unsupported extension.")
// TODO: require bank not overlap
Expand Down Expand Up @@ -213,6 +213,8 @@ case class T1Parameter(
// and the values are their respective delays.
val crossLaneConnectCycles: Seq[Seq[Int]] = Seq.tabulate(laneNumber)(_ => Seq(1, 1))

val decoderParam: DecoderParam = DecoderParam(fpuEnable, allInstructions)

/** parameter for TileLink. */
val tlParam: TLBundleParameter = TLBundleParameter(
a = TLChannelAParameter(physicalAddressWidth, sourceWidth, memoryDataWidthBytes * 8, sizeWidth, maskWidth),
Expand All @@ -233,6 +235,7 @@ case class T1Parameter(
fpuEnable = fpuEnable,
portFactor = vrfBankSize,
vrfRamType = vrfRamType,
decoderParam = decoderParam,
vfuInstantiateParameter = vfuInstantiateParameter
)
/** Parameter for each LSU. */
Expand Down Expand Up @@ -313,7 +316,7 @@ class T1(val parameter: T1Parameter) extends Module with SerializableModule[T1Pa
/** the LSU Module */

val lsu: Instance[LSU] = Instantiate(new LSU(parameter.lsuParameters))
val decode: Instance[VectorDecoder] = Instantiate(new VectorDecoder(parameter.fpuEnable))
val decode: Instance[VectorDecoder] = Instantiate(new VectorDecoder(parameter.decoderParam))

// TODO: cover overflow
// TODO: uarch doc about the order of instructions
Expand Down
8 changes: 4 additions & 4 deletions t1/src/VectorDecoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ package org.chipsalliance.t1.rtl
import chisel3._
import chisel3.experimental.hierarchy.{instantiable, public}
import chisel3.util.experimental.decode._
import org.chipsalliance.t1.rtl.decoder.Decoder
import org.chipsalliance.t1.rtl.decoder.{Decoder, DecoderParam}

@instantiable
class VectorDecoder(decoder: Decoder) extends Module {
class VectorDecoder(param: DecoderParam) extends Module {
@public
val decodeInput: UInt = IO(Input(UInt(32.W)))
@public
val decodeResult: DecodeBundle = IO(Output(new DecodeBundle(decoder.all)))
val decodeResult: DecodeBundle = IO(Output(new DecodeBundle(Decoder.allFields(param))))

decodeResult := Decoder.decode(fpuEnable)(decodeInput)
decodeResult := Decoder.decode(param)(decodeInput)
}
Loading

0 comments on commit b39ce9f

Please sign in to comment.