Skip to content

Commit

Permalink
[BACKPORT-0.6][VTA] End-to-end Inference with Chisel VTA (#5896)
Browse files Browse the repository at this point in the history
* [BACKPORT-0.6][VTA][Chisel] End-to-end Inference with Chisel VTA (#4574)

* [BACKPORT-0.6][VTA] Added declare of aluBits for TensorAlu (#4624)

Co-authored-by: Kevin Yuan <kevinyuan@users.noreply.github.com>

* retrigger ci

* retrigger ci

Co-authored-by: Kevin Yuan <kevinyuan@users.noreply.github.com>
  • Loading branch information
liangfu and kevinyuan committed Jun 25, 2020
1 parent c03d97c commit 26807ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vta/hardware/chisel/src/main/scala/core/TensorAlu.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class AluVector(implicit p: Parameters) extends Module {
* acc-scratchpad.
*/
class TensorAlu(debug: Boolean = false)(implicit p: Parameters) extends Module {
val aluBits = p(CoreKey).accBits
val io = IO(new Bundle {
val start = Input(Bool())
val done = Output(Bool())
Expand Down Expand Up @@ -230,7 +231,8 @@ class TensorAlu(debug: Boolean = false)(implicit p: Parameters) extends Module {
tensorImm.data.valid := state === sReadTensorB
tensorImm.data.bits.foreach { b =>
b.foreach { c =>
c := dec.alu_imm
c := Mux(dec.alu_imm(C_ALU_IMM_BITS - 1),
Cat(-1.S((aluBits - C_ALU_IMM_BITS).W), dec.alu_imm), dec.alu_imm)
}
}

Expand Down

0 comments on commit 26807ba

Please sign in to comment.