-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] refactor and add all attributes
- Loading branch information
Showing
56 changed files
with
4,802 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2022 Jiuyang Liu <[email protected]> | ||
|
||
package org.chipsalliance.t1.rtl.decoder.attribute | ||
|
||
import org.chipsalliance.t1.rtl.decoder.T1DecodePattern | ||
|
||
object isAdder { | ||
def apply(t1DecodePattern: T1DecodePattern): isAdder = | ||
Seq( | ||
y _ -> Y, | ||
n _ -> N, | ||
dc _ -> DC | ||
).collectFirst { | ||
case (fn, tri) if fn(t1DecodePattern) => isAdder(tri) | ||
}.get | ||
|
||
def y(t1DecodePattern: T1DecodePattern): Boolean = { | ||
val allMatched = Seq( | ||
"vaadd.vv", | ||
"vaadd.vx", | ||
"vaaddu.vv", | ||
"vaaddu.vx", | ||
"vadc.vim", | ||
"vadc.vvm", | ||
"vadc.vxm", | ||
"vadd.vi", | ||
"vadd.vv", | ||
"vadd.vx", | ||
"vasub.vv", | ||
"vasub.vx", | ||
"vasubu.vv", | ||
"vasubu.vx", | ||
"vmadc.vi", | ||
"vmadc.vim", | ||
"vmadc.vv", | ||
"vmadc.vvm", | ||
"vmadc.vx", | ||
"vmadc.vxm", | ||
"vmax.vv", | ||
"vmax.vx", | ||
"vmaxu.vv", | ||
"vmaxu.vx", | ||
"vmin.vv", | ||
"vmin.vx", | ||
"vminu.vv", | ||
"vminu.vx", | ||
"vmsbc.vv", | ||
"vmsbc.vvm", | ||
"vmsbc.vx", | ||
"vmsbc.vxm", | ||
"vmseq.vi", | ||
"vmseq.vv", | ||
"vmseq.vx", | ||
"vmsgt.vi", | ||
"vmsgt.vx", | ||
"vmsgtu.vi", | ||
"vmsgtu.vx", | ||
"vmsle.vi", | ||
"vmsle.vv", | ||
"vmsle.vx", | ||
"vmsleu.vi", | ||
"vmsleu.vv", | ||
"vmsleu.vx", | ||
"vmslt.vv", | ||
"vmslt.vx", | ||
"vmsltu.vv", | ||
"vmsltu.vx", | ||
"vmsne.vi", | ||
"vmsne.vv", | ||
"vmsne.vx", | ||
"vredmax.vs", | ||
"vredmaxu.vs", | ||
"vredmin.vs", | ||
"vredminu.vs", | ||
"vredsum.vs", | ||
"vrsub.vi", | ||
"vrsub.vx", | ||
"vsadd.vi", | ||
"vsadd.vv", | ||
"vsadd.vx", | ||
"vsaddu.vi", | ||
"vsaddu.vv", | ||
"vsaddu.vx", | ||
"vsbc.vvm", | ||
"vsbc.vxm", | ||
"vssub.vv", | ||
"vssub.vx", | ||
"vssubu.vv", | ||
"vssubu.vx", | ||
"vsub.vv", | ||
"vsub.vx", | ||
"vwadd.vv", | ||
"vwadd.vx", | ||
"vwadd.wv", | ||
"vwadd.wx", | ||
"vwaddu.vv", | ||
"vwaddu.vx", | ||
"vwaddu.wv", | ||
"vwaddu.wx", | ||
"vwredsum.vs", | ||
"vwredsumu.vs", | ||
"vwsub.vv", | ||
"vwsub.vx", | ||
"vwsub.wv", | ||
"vwsub.wx", | ||
"vwsubu.vv", | ||
"vwsubu.vx", | ||
"vwsubu.wv", | ||
"vwsubu.wx", | ||
) | ||
allMatched.contains(t1DecodePattern.instruction) | ||
} | ||
def n(t1DecodePattern: T1DecodePattern): Boolean = { | ||
val allMatched = t1DecodePattern.t1Parameter.allInstuctions.filter( i => | ||
!(y(t1DecodePattern) || dc(t1DecodePattern)) | ||
) | ||
allMatched.contains(t1DecodePattern.instruction) | ||
} | ||
|
||
def dc(t1DecodePattern: T1DecodePattern): Boolean = false | ||
} | ||
|
||
case class isAdder(value: TriState) extends BooleanDecodeAttribute { | ||
override val description: String = "goes to [[org.chipsalliance.t1.rtl.LaneAdder]]." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2022 Jiuyang Liu <[email protected]> | ||
|
||
package org.chipsalliance.t1.rtl.decoder.attribute | ||
|
||
import org.chipsalliance.t1.rtl.decoder.T1DecodePattern | ||
|
||
object isAverage { | ||
def apply(t1DecodePattern: T1DecodePattern): isAverage = | ||
Seq( | ||
y _ -> Y, | ||
n _ -> N, | ||
dc _ -> DC | ||
).collectFirst { | ||
case (fn, tri) if fn(t1DecodePattern) => isAverage(tri) | ||
}.get | ||
|
||
def y(t1DecodePattern: T1DecodePattern): Boolean = { | ||
val allMatched = Seq( | ||
"vaadd.vv", | ||
"vaadd.vx", | ||
"vaaddu.vv", | ||
"vaaddu.vx", | ||
"vasub.vv", | ||
"vasub.vx", | ||
"vasubu.vv", | ||
"vasubu.vx", | ||
) | ||
allMatched.contains(t1DecodePattern.instruction) | ||
} | ||
def n(t1DecodePattern: T1DecodePattern): Boolean = { | ||
val allMatched = t1DecodePattern.t1Parameter.allInstuctions.filter( i => | ||
!(y(t1DecodePattern) || dc(t1DecodePattern)) | ||
) | ||
allMatched.contains(t1DecodePattern.instruction) | ||
} | ||
|
||
def dc(t1DecodePattern: T1DecodePattern): Boolean = false | ||
} | ||
|
||
case class isAverage(value: TriState) extends BooleanDecodeAttribute { | ||
override val description: String = "For adder, does it need to take care of saturate. TODO: add to uop " | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2022 Jiuyang Liu <[email protected]> | ||
|
||
package org.chipsalliance.t1.rtl.decoder.attribute | ||
|
||
import org.chipsalliance.t1.rtl.decoder.T1DecodePattern | ||
|
||
object isCompress { | ||
def apply(t1DecodePattern: T1DecodePattern): isCompress = | ||
Seq( | ||
y _ -> Y, | ||
n _ -> N, | ||
dc _ -> DC | ||
).collectFirst { | ||
case (fn, tri) if fn(t1DecodePattern) => isCompress(tri) | ||
}.get | ||
|
||
def y(t1DecodePattern: T1DecodePattern): Boolean = { | ||
val allMatched = Seq( | ||
"vcompress.vm", | ||
) | ||
allMatched.contains(t1DecodePattern.instruction) | ||
} | ||
def n(t1DecodePattern: T1DecodePattern): Boolean = { | ||
val allMatched = t1DecodePattern.t1Parameter.allInstuctions.filter( i => | ||
!(y(t1DecodePattern) || dc(t1DecodePattern)) | ||
) | ||
allMatched.contains(t1DecodePattern.instruction) | ||
} | ||
|
||
def dc(t1DecodePattern: T1DecodePattern): Boolean = false | ||
} | ||
|
||
case class isCompress(value: TriState) extends BooleanDecodeAttribute { | ||
override val description: String = "lane will read data from vs2, send to Sequencer. then Sequencer will read vs1 for mask. use mask to compress data in vs2. and write to vd at last. " | ||
} |
Oops, something went wrong.