Skip to content

Commit

Permalink
[doc] refactor and add all attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-Wye committed May 26, 2024
1 parent a877927 commit de6c45d
Show file tree
Hide file tree
Showing 56 changed files with 23,771 additions and 10 deletions.
19 changes: 10 additions & 9 deletions t1/src/decoder/Decoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -187,34 +187,35 @@ object Decoder {
Op(tpe, funct6, tpeOp2, funct3, insn.name, special, notLSU=true, vd, opcode)
}
// case of LSU instructions: `opcodeLoadF` and `opcodeStoreF`
++ Seq("1", "0").map(fun6End =>
++ instructions.filter(_.encoding.toString.substring(32-6-1, 32-0) == opcodeLoadF).map{ insn =>
val funct6 = insn.encoding.toString.substring(32-31-1, 32-26)
Op(
"I", // tpe
"?????" + fun6End,
funct6,
"?", // tpeOp2
"???", // funct3
"lsu",
insn.name,
None,
notLSU = false,
"?????", // vd
opcodeLoadF
)
)
++ Seq("1", "0").map(fun6End =>
}
++ instructions.filter(_.encoding.toString.substring(32-6-1, 32-0) == opcodeStoreF).map{ insn =>
val funct6 = insn.encoding.toString.substring(32-31-1, 32-26)
Op(
"I", // tpe
"?????" + fun6End,
funct6,
"?", // tpeOp2
"???", // funct3
"lsu",
insn.name,
None,
notLSU = false,
"?????", // vd
opcodeStoreF
)
)
}
).toArray

expandedOps.filter(_.tpe != "F" || fpuEnable)
}

Expand Down
110 changes: 109 additions & 1 deletion t1/src/decoder/T1DecodePattern.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import chisel3.util.BitPat
import chisel3.util.experimental.decode.DecodePattern
import org.chipsalliance.rvdecoderdb.Instruction
import org.chipsalliance.t1.rtl.T1Parameter
import org.chipsalliance.t1.rtl.decoder.attribute.isVector
import org.chipsalliance.t1.rtl.decoder.attribute._

@instantiable
class T1DecodeAttributeOM extends Class {
Expand Down Expand Up @@ -57,6 +57,60 @@ case class T1DecodePattern(instruction: Instruction, t1Parameter: T1Parameter) e

// use the attribute w/ [[isVector.value]]
def isVector: isVector = attribute.isVector(this)
def isAdder: isAdder = attribute.isAdder(this)
def isAverage: isAverage = attribute.isAverage(this)
def isCompress: isCompress = attribute.isCompress(this)
def isCrossread: isCrossread = attribute.isCrossread(this)
def isCrosswrite: isCrosswrite = attribute.isCrosswrite(this)
def isDivider: isDivider = attribute.isDivider(this)
def isDontneedexecuteinlane: isDontneedexecuteinlane = attribute.isDontneedexecuteinlane(this)
def isExtend: isExtend = attribute.isExtend(this)
def isFcompare: isFcompare = attribute.isFcompare(this)
def isFfo: isFfo = attribute.isFfo(this)
def isFirstwiden: isFirstwiden = attribute.isFirstwiden(this)
def isFloatmul: isFloatmul = attribute.isFloatmul(this)
def isFloat: isFloat = attribute.isFloat(this)
def isFloattype: isFloattype = attribute.isFloattype(this)
def isFma: isFma = attribute.isFma(this)
def isFother: isFother = attribute.isFother(this)
def isGather16: isGather16 = attribute.isGather16(this)
def isGather: isGather = attribute.isGather(this)
def isId: isId = attribute.isId(this)
def isIndextype: isIndextype = attribute.isIndextype(this)
def isIota: isIota = attribute.isIota(this)
def isItype: isItype = attribute.isItype(this)
def isLogic: isLogic = attribute.isLogic(this)
def isMa: isMa = attribute.isMa(this)
def isMaskdestination: isMaskdestination = attribute.isMaskdestination(this)
def isMasklogic: isMasklogic = attribute.isMasklogic(this)
def isMasksource: isMasksource = attribute.isMasksource(this)
def isMaskunit: isMaskunit = attribute.isMaskunit(this)
def isMulticycle: isMulticycle = attribute.isMulticycle(this)
def isMultiplier: isMultiplier = attribute.isMultiplier(this)
def isMv: isMv = attribute.isMv(this)
def isNarrow: isNarrow = attribute.isNarrow(this)
def isNr: isNr = attribute.isNr(this)
def isOrderreduce: isOrderreduce = attribute.isOrderreduce(this)
def isOther: isOther = attribute.isOther(this)
def isPopcount: isPopcount = attribute.isPopcount(this)
def isReadonly: isReadonly = attribute.isReadonly(this)
def isRed: isRed = attribute.isRed(this)
def isReverse: isReverse = attribute.isReverse(this)
def isSaturate: isSaturate = attribute.isSaturate(this)
def isScheduler: isScheduler = attribute.isScheduler(this)
def isShift: isShift = attribute.isShift(this)
def isSlid: isSlid = attribute.isSlid(this)
def isSpecial: isSpecial = attribute.isSpecial(this)
def isSpecialslot: isSpecialslot = attribute.isSpecialslot(this)
def isSreadvd: isSreadvd = attribute.isSreadvd(this)
def isSwrite: isSwrite = attribute.isSwrite(this)
def isTargetrd: isTargetrd = attribute.isTargetrd(this)
def isUnorderwrite: isUnorderwrite = attribute.isUnorderwrite(this)
def isUnsigned0: isUnsigned0 = attribute.isUnsigned0(this)
def isUnsigned1: isUnsigned1 = attribute.isUnsigned1(this)
def isVtype: isVtype = attribute.isVtype(this)
def isVwmacc: isVwmacc = attribute.isVwmacc(this)
def isWidenreduce: isWidenreduce = attribute.isWidenreduce(this)

private def documentation: String = InstructionDocumentation(instruction, t1Parameter).toString

Expand All @@ -74,6 +128,60 @@ case class T1DecodePattern(instruction: Instruction, t1Parameter: T1Parameter) e
obj.attributesIn :#= Property(
Seq(
isVector,
isAdder,
isAverage,
isCompress,
isCrossread,
isCrosswrite,
isDivider,
isDontneedexecuteinlane,
isExtend,
isFcompare,
isFfo,
isFirstwiden,
isFloatmul,
isFloat,
isFloattype,
isFma,
isFother,
isGather16,
isGather,
isId,
isIndextype,
isIota,
isItype,
isLogic,
isMa,
isMaskdestination,
isMasklogic,
isMasksource,
isMaskunit,
isMulticycle,
isMultiplier,
isMv,
isNarrow,
isNr,
isOrderreduce,
isOther,
isPopcount,
isReadonly,
isRed,
isReverse,
isSaturate,
isScheduler,
isShift,
isSlid,
isSpecial,
isSpecialslot,
isSreadvd,
isSwrite,
isTargetrd,
isUnorderwrite,
isUnsigned0,
isUnsigned1,
isVtype,
isVwmacc,
isWidenreduce,
).map(_.om.as(attributeClassTpe))
)
obj.getPropertyReference
Expand Down
Loading

0 comments on commit de6c45d

Please sign in to comment.