Skip to content

Commit

Permalink
[doc] prepare T1CustomInstruction
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Jun 21, 2024
1 parent 8be78ef commit e51570b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions configgen/generated/blastoise.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"extensions": [
"Zve32f"
],
"t1customInstructions": [],
"lsuBankParameters": [
{
"name": "scalar",
Expand Down
1 change: 1 addition & 0 deletions configgen/generated/machamp.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"extensions": [
"Zve32x"
],
"t1customInstructions": [],
"lsuBankParameters": [
{
"name": "scalar",
Expand Down
1 change: 1 addition & 0 deletions configgen/generated/sandslash.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"extensions": [
"Zve32x"
],
"t1customInstructions": [],
"lsuBankParameters": [
{
"name": "scalar",
Expand Down
5 changes: 5 additions & 0 deletions configgen/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import chisel3.util.{BitPat, log2Ceil}
import chisel3.util.experimental.BitSet
import mainargs._
import org.chipsalliance.t1.rtl._
import org.chipsalliance.t1.rtl.decoder.T1CustomInstruction
import org.chipsalliance.t1.rtl.lsu.LSUInstantiateParameter
import org.chipsalliance.t1.rtl.vrf.RamType

import java.util.LinkedHashMap

object Main {
Expand Down Expand Up @@ -67,6 +69,7 @@ object Main {
vLen,
dLen,
extensions = Seq("Zve32f"),
t1customInstructions = Nil,
lsuBankParameters =
// scalar bank 0-1G
Seq(
Expand Down Expand Up @@ -138,6 +141,7 @@ object Main {
vLen,
dLen,
extensions = Seq("Zve32x"),
t1customInstructions = Nil,
// banks=8 dLen=512 beatbyte16
lsuBankParameters =
// scalar bank 0-1G
Expand Down Expand Up @@ -215,6 +219,7 @@ object Main {
vLen,
dLen,
extensions = Seq("Zve32x"),
t1customInstructions = Nil,
lsuBankParameters =
// scalar bank 0-1G
Seq(
Expand Down
7 changes: 6 additions & 1 deletion t1/src/T1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import tilelink.{TLBundle, TLBundleParameter, TLChannelAParameter, TLChannelDPar
import chisel3.probe.{Probe, ProbeValue, define, force}
import chisel3.properties.{AnyClassType, Class, ClassType, Property}
import chisel3.util.experimental.BitSet
import org.chipsalliance.t1.rtl.decoder.Decoder
import org.chipsalliance.rvdecoderdb.Instruction
import org.chipsalliance.t1.rtl.decoder.{Decoder, T1CustomInstruction}
import org.chipsalliance.t1.rtl.lsu.{LSU, LSUParameter, LSUProbe}
import org.chipsalliance.t1.rtl.vrf.{RamType, VRFParam, VRFProbe}

Expand Down Expand Up @@ -84,6 +85,7 @@ case class T1Parameter(
vLen: Int,
dLen: Int,
extensions: Seq[String],
t1customInstructions: Seq[T1CustomInstruction],
// LSU
lsuBankParameters: Seq[LSUBankParameter],
// Lane
Expand Down Expand Up @@ -111,6 +113,9 @@ case class T1Parameter(
|""".stripMargin}}
|""".stripMargin

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

require(extensions.forall(Seq("Zve32x", "Zve32f").contains), "unsupported extension.")
// TODO: require bank not overlap
/** xLen of T1, we currently only support 32. */
Expand Down
14 changes: 14 additions & 0 deletions t1/src/decoder/T1CustomInstruction.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 Jiuyang Liu <[email protected]>

package org.chipsalliance.t1.rtl.decoder

import org.chipsalliance.rvdecoderdb.Instruction

object T1CustomInstruction {
implicit def rw: upickle.default.ReadWriter[T1CustomInstruction] = upickle.default.macroRW[T1CustomInstruction]
}

// TODO: other field will be fill in the future, e.g. something that user can config, e.g.
// readRS1, readRD?
case class T1CustomInstruction(instruction: Instruction)

0 comments on commit e51570b

Please sign in to comment.