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] Change Scala Linter scalafmt => scalastyle #4998

Merged
merged 4 commits into from
Mar 7, 2020

Conversation

liangfu
Copy link
Member

@liangfu liangfu commented Mar 6, 2020

As scalafmt changes the code even with --test argument in the latest version, this PR switches scala linter for Chisel VTA from scalafmt to scalastyle.

@tmoreau89 @vegaluisjose Please review.

Change-Id: Ifc590e7cb63585f35dfdc9efcf3c6287b1afb1dd
Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Thank you for doing this @liangfu ! LGTM

Copy link
Member

@vegaluisjose vegaluisjose left a comment

Choose a reason for hiding this comment

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

Great!

Change-Id: I8aff2632dadda05d2896e28bdaf6f780a160a15a
Copy link
Member

@vegaluisjose vegaluisjose left a comment

Choose a reason for hiding this comment

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

LGTM

@tmoreau89
Copy link
Contributor

Thanks @liangfu ; let us know when it's ready for a merge.

@liangfu
Copy link
Member Author

liangfu commented Mar 6, 2020

@tmoreau89 @vegaluisjose Thanks for the review. I think this is now ready for a merge, and let's wait for the CI testing results.

Change-Id: Ibeb00c11a5718ea47322ea2b82e757828af8af91
@liangfu
Copy link
Member Author

liangfu commented Mar 6, 2020

In addition, based on the suggestions in the linter, I made some final changes in fixing indentation errors, here is a typical example:

diff --git a/vta/hardware/chisel/src/main/scala/core/Load.scala b/vta/hardware/chisel/src/main/scala/core/Load.scala
index 7c79498bd..50c26bb8e 100644
--- a/vta/hardware/chisel/src/main/scala/core/Load.scala
+++ b/vta/hardware/chisel/src/main/scala/core/Load.scala
@@ -25,12 +25,12 @@ import vta.util.config._
 import vta.shell._
 
 /** Load.
-  *
-  * Load inputs and weights from memory (DRAM) into scratchpads (SRAMs).
-  * This module instantiate the TensorLoad unit which is in charge of
-  * loading 1D and 2D tensors to scratchpads, so it can be used by
-  * other modules such as Compute.
-  */
+ *
+ * Load inputs and weights from memory (DRAM) into scratchpads (SRAMs).
+ * This module instantiate the TensorLoad unit which is in charge of
+ * loading 1D and 2D tensors to scratchpads, so it can be used by
+ * other modules such as Compute.
+ */
 class Load(debug: Boolean = false)(implicit p: Parameters) extends Module {
   val mp = p(ShellKey).memParams
   val io = IO(new Bundle {
@@ -110,11 +110,10 @@ class Load(debug: Boolean = false)(implicit p: Parameters) extends Module {
       when(dec.io.isSync) {
         printf("[Load] start sync\n")
       }.elsewhen(dec.io.isInput) {
-          printf("[Load] start input\n")
-        }
-        .elsewhen(dec.io.isWeight) {
-          printf("[Load] start weight\n")
-        }
+        printf("[Load] start input\n")
+      }.elsewhen(dec.io.isWeight) {
+        printf("[Load] start weight\n")
+      }
     }
     // done
     when(state === sSync) {

Please take another look.

@tmoreau89
Copy link
Contributor

Thanks for the diff @liangfu ; this looks great.

@tmoreau89
Copy link
Contributor

Looks like CI failed on one of the unit tests

@liangfu
Copy link
Member Author

liangfu commented Mar 7, 2020

I think it might related to #4901 , let me trigger the testing pipeline again.

@tmoreau89 tmoreau89 merged commit 6a36fb4 into apache:master Mar 7, 2020
@tmoreau89
Copy link
Contributor

Thanks @liangfu, @vegaluisjose the PR has been merged!

tqchen pushed a commit to tqchen/tvm that referenced this pull request Mar 29, 2020
* scalafmt => scalastyle

Change-Id: Ifc590e7cb63585f35dfdc9efcf3c6287b1afb1dd

* scalafmt => scalastyle

Change-Id: I8aff2632dadda05d2896e28bdaf6f780a160a15a

* add indentation constraint

Change-Id: Ibeb00c11a5718ea47322ea2b82e757828af8af91

* trigger ci again
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Apr 16, 2020
* scalafmt => scalastyle

Change-Id: Ifc590e7cb63585f35dfdc9efcf3c6287b1afb1dd

* scalafmt => scalastyle

Change-Id: I8aff2632dadda05d2896e28bdaf6f780a160a15a

* add indentation constraint

Change-Id: Ibeb00c11a5718ea47322ea2b82e757828af8af91

* trigger ci again
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Apr 17, 2020
* scalafmt => scalastyle

Change-Id: Ifc590e7cb63585f35dfdc9efcf3c6287b1afb1dd

* scalafmt => scalastyle

Change-Id: I8aff2632dadda05d2896e28bdaf6f780a160a15a

* add indentation constraint

Change-Id: Ibeb00c11a5718ea47322ea2b82e757828af8af91

* trigger ci again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants