Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VTA] [Chisel] fix tensor issue/commit in gemm #3637

Merged
merged 2 commits into from
Jul 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions vta/hardware/chisel/src/main/scala/core/TensorGemm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class MAC(aBits: Int = 8, bBits: Int = 8, cBits: Int = 16) extends Module {
val rA = RegNext(io.a)
val rB = RegNext(io.b)
val rC = RegNext(io.c)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These edits will add noise to the github history of the file. Can we fix all of the spacing issues in a separate PR for the Chisel codebase until we have lint tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I just realized - the edit was adding a tab; the spacing issues were already fixed before. That said a lint test would have caught that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let me try to do that.

Btw, all the ASF headers for the entire codebase has the same issue.


mult := rA * rB
add := rC +& mult

io.y := add
}

Expand Down Expand Up @@ -226,9 +226,9 @@ class TensorGemm(debug: Boolean = false)(implicit p: Parameters) extends Module
when (state === sIdle) {
inflight := 0.U
} .elsewhen (!dec.reset) {
when (state === sExe && inflight =/= ((1 << pBits) - 1).asUInt) { // overflow check
when (state === sReadTensor) { // issue a tensor
inflight := inflight + 1.U
} .elsewhen (mvc.io.acc_o.data.valid && inflight =/= 0.U) { // underflow check
} .elsewhen (mvc.io.acc_o.data.valid) { // commit a tensor
inflight := inflight - 1.U
}
}
Expand Down
2 changes: 1 addition & 1 deletion vta/hardware/chisel/src/main/scala/core/TensorStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import vta.shell._
*
* Store 1D and 2D tensors from out-scratchpad (SRAM) to main memory (DRAM).
*/
class TensorStore(tensorType: String = "true", debug: Boolean = false)
class TensorStore(tensorType: String = "none", debug: Boolean = false)
(implicit p: Parameters) extends Module {
val tp = new TensorParams(tensorType)
val mp = p(ShellKey).memParams
Expand Down
4 changes: 2 additions & 2 deletions vta/tests/hardware/metal_test/metal_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down