remove tabs (#3603)
authorLuis Vega <vegaluisjose@users.noreply.github.com>
Tue, 23 Jul 2019 17:23:10 +0000 (10:23 -0700)
committerThierry Moreau <moreau@uw.edu>
Tue, 23 Jul 2019 17:23:10 +0000 (10:23 -0700)
vta/hardware/chisel/src/main/scala/core/Compute.scala
vta/hardware/chisel/src/main/scala/core/Fetch.scala
vta/hardware/chisel/src/main/scala/core/Load.scala
vta/hardware/chisel/src/main/scala/core/LoadUop.scala
vta/hardware/chisel/src/main/scala/core/Store.scala
vta/hardware/chisel/src/main/scala/core/TensorAlu.scala
vta/hardware/chisel/src/main/scala/core/TensorGemm.scala
vta/hardware/chisel/src/main/scala/core/TensorLoad.scala
vta/hardware/chisel/src/main/scala/core/TensorStore.scala
vta/hardware/chisel/src/main/scala/core/TensorUtil.scala

index ef56c3d4224eb9992b9f596b0a2c7f3e9ebc7f21..01fa9d65c60d7530fd0fa647638e1eef41b708cf 100644 (file)
@@ -64,9 +64,9 @@ class Compute(debug: Boolean = false)(implicit p: Parameters) extends Module {
 
   val inst_type = Cat(dec.io.isFinish,
                       dec.io.isAlu,
-                     dec.io.isGemm,
-                     dec.io.isLoadAcc,
-                     dec.io.isLoadUop).asUInt
+                      dec.io.isGemm,
+                      dec.io.isLoadAcc,
+                      dec.io.isLoadUop).asUInt
 
   val sprev = inst_q.io.deq.valid & Mux(dec.io.pop_prev, s(0).io.sready, true.B)
   val snext = inst_q.io.deq.valid & Mux(dec.io.pop_next, s(1).io.sready, true.B)
@@ -87,11 +87,11 @@ class Compute(debug: Boolean = false)(implicit p: Parameters) extends Module {
   switch (state) {
     is (sIdle) {
       when (start) {
-       when (dec.io.isSync) {
+        when (dec.io.isSync) {
           state := sSync
-       } .elsewhen (inst_type.orR) {
+        } .elsewhen (inst_type.orR) {
           state := sExe
-       }
+        }
       }
     }
     is (sSync) {
index bcc164a8f623cc27f13db45ce027d34bef811aef..49a66a8938865e2341664fe2b26b702802cef39d 100644 (file)
@@ -77,15 +77,15 @@ class Fetch(debug: Boolean = false)(implicit p: Parameters) extends Module {
     is (sIdle) {
       when (pulse) {
         state := sReadCmd
-       when (xsize < xmax) {
+        when (xsize < xmax) {
           rlen := xsize
-         ilen := xsize >> 1.U
+          ilen := xsize >> 1.U
           xrem := 0.U
-       } .otherwise {
+        } .otherwise {
           rlen := xmax - 1.U
-         ilen := (xmax >> 1.U) - 1.U
+          ilen := (xmax >> 1.U) - 1.U
           xrem := xsize - xmax
-       }
+        }
       }
     }
     is (sReadCmd) {
@@ -104,7 +104,7 @@ class Fetch(debug: Boolean = false)(implicit p: Parameters) extends Module {
           state := sDrain
         } .otherwise {
           state := sReadLSB
-       }
+        }
       }
     }
     is (sDrain) {
@@ -114,12 +114,12 @@ class Fetch(debug: Boolean = false)(implicit p: Parameters) extends Module {
         } .elsewhen (xrem < xmax) {
           state := sReadCmd
           rlen := xrem
-         ilen := xrem >> 1.U
+          ilen := xrem >> 1.U
           xrem := 0.U
         } .otherwise {
           state := sReadCmd
           rlen := xmax - 1.U
-         ilen := (xmax >> 1.U) - 1.U
+          ilen := (xmax >> 1.U) - 1.U
           xrem := xrem - xmax
         }
       }
index 64795139aa4eaaa4bd188908befe4ac3ccc1e21c..bbc6600a8fdd95476b6249da0a817eb5eebb9292 100644 (file)
@@ -65,9 +65,9 @@ class Load(debug: Boolean = false)(implicit p: Parameters) extends Module {
       when (start) {
         when (dec.io.isSync) {
           state := sSync
-       } .elsewhen (dec.io.isInput || dec.io.isWeight) {
+        } .elsewhen (dec.io.isInput || dec.io.isWeight) {
           state := sExe
-       }
+        }
       }
     }
     is (sSync) {
@@ -121,10 +121,10 @@ class Load(debug: Boolean = false)(implicit p: Parameters) extends Module {
     when (state === sExe) {
       when (done) {
         when (dec.io.isInput) {
-         printf("[Load] done input\n")
-       } .elsewhen (dec.io.isWeight) {
-         printf("[Load] done weight\n")
-       }
+          printf("[Load] done input\n")
+        } .elsewhen (dec.io.isWeight) {
+          printf("[Load] done weight\n")
+        }
       }
     }
   }
index 07296523b254a49dec46ed46774451ad96a0d615..3d939815d12933c63502633c25dbfd754ffcef52 100644 (file)
@@ -91,13 +91,13 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module {
     is (sIdle) {
       when (io.start) {
         state := sReadCmd
-       when (xsize < xmax) {
+        when (xsize < xmax) {
           xlen := xsize
           xrem := 0.U
-       } .otherwise {
+        } .otherwise {
           xlen := xmax - 1.U
           xrem := xsize - xmax
-       }
+        }
       }
     }
     is (sReadCmd) {
index 5d89871e65bedb3677f47426181ac1967ff06390..71d92085668a04b7e828008f8df76d5052c9f1cd 100644 (file)
@@ -60,9 +60,9 @@ class Store(debug: Boolean = false)(implicit p: Parameters) extends Module {
       when (start) {
         when (dec.io.isSync) {
           state := sSync
-       } .elsewhen (dec.io.isStore) {
+        } .elsewhen (dec.io.isStore) {
           state := sExe
-       }
+        }
       }
     }
     is (sSync) {
@@ -107,7 +107,7 @@ class Store(debug: Boolean = false)(implicit p: Parameters) extends Module {
     }
     when (state === sExe) {
       when (done) {
-       printf("[Store] done\n")
+        printf("[Store] done\n")
       }
     }
   }
index 7f429be7249f7494c2e0ae378004718cd9d69087..fdab9610343b13f9d0fbbe5b9bfc65a93fd74d4e 100644 (file)
@@ -43,7 +43,7 @@ class Alu(implicit p: Parameters) extends Module {
                 Mux(io.a < io.b, io.b, io.a),
                 io.a + io.b,
                 io.a >> n,
-               io.a << m)
+                io.a << m)
 
   val opmux = Seq.tabulate(ALU_OP_NUM)(i => ALU_OP(i) -> fop(i))
   io.y := MuxLookup(io.opcode, io.a, opmux)
@@ -157,8 +157,8 @@ class TensorAlu(debug: Boolean = false)(implicit p: Parameters) extends Module {
     is (sExe) {
       when (alu.io.out.data.valid) {
         when ((cnt_o === dec.lp_0 - 1.U) &&
-             (cnt_i === dec.lp_1 - 1.U) &&
-             (uop_idx === uop_end - 1.U)) {
+              (cnt_i === dec.lp_1 - 1.U) &&
+              (uop_idx === uop_end - 1.U)) {
           state := sIdle
         } .otherwise {
           state := sReadUop
@@ -169,8 +169,8 @@ class TensorAlu(debug: Boolean = false)(implicit p: Parameters) extends Module {
 
   when (state === sIdle ||
          (state === sExe &&
-         alu.io.out.data.valid &&
-         uop_idx === uop_end - 1.U)) {
+          alu.io.out.data.valid &&
+          uop_idx === uop_end - 1.U)) {
     uop_idx := dec.uop_begin
   } .elsewhen (state === sExe && alu.io.out.data.valid) {
     uop_idx := uop_idx + 1.U
@@ -183,7 +183,7 @@ class TensorAlu(debug: Boolean = false)(implicit p: Parameters) extends Module {
   } .elsewhen (state === sExe &&
                alu.io.out.data.valid &&
                uop_idx === uop_end - 1.U &&
-              cnt_i === dec.lp_1 - 1.U) {
+               cnt_i === dec.lp_1 - 1.U) {
     cnt_o := cnt_o + 1.U
     dst_o := dst_o + dec.dst_0
     src_o := src_o + dec.src_0
@@ -199,7 +199,7 @@ class TensorAlu(debug: Boolean = false)(implicit p: Parameters) extends Module {
     src_i := src_o
   } .elsewhen (state === sExe &&
                alu.io.out.data.valid &&
-              uop_idx === uop_end - 1.U) {
+               uop_idx === uop_end - 1.U) {
     cnt_i := cnt_i + 1.U
     dst_i := dst_i + dec.dst_1
     src_i := src_i + dec.src_1
index 2dd8c33aea33e281a8f9c7364e20d07de58abf6d..a910864ee2acf2e7ea1d4e4a979d46f8d66a1a55 100644 (file)
@@ -180,10 +180,10 @@ class TensorGemm(debug: Boolean = false)(implicit p: Parameters) extends Module
   val done = inflight === 0.U &
              ((state === sExe &
               cnt_o === dec.lp_0 - 1.U &
-             cnt_i === dec.lp_1 - 1.U &
-             uop_idx === uop_end - 1.U &
-             inflight === 0.U) |
-            state === sWait)
+              cnt_i === dec.lp_1 - 1.U &
+              uop_idx === uop_end - 1.U &
+              inflight === 0.U) |
+             state === sWait)
 
   switch (state) {
     is (sIdle) {
@@ -204,11 +204,11 @@ class TensorGemm(debug: Boolean = false)(implicit p: Parameters) extends Module
       when ((cnt_o === dec.lp_0 - 1.U) &&
             (cnt_i === dec.lp_1 - 1.U) &&
             (uop_idx === uop_end - 1.U)) {
-       when (inflight =/= 0.U) {
+        when (inflight =/= 0.U) {
           state := sWait
-       } .otherwise {
+        } .otherwise {
           state := sIdle
-       }
+        }
       } .otherwise {
         state := sReadUop
       }
@@ -232,7 +232,7 @@ class TensorGemm(debug: Boolean = false)(implicit p: Parameters) extends Module
 
   when (state === sIdle ||
          (state === sExe &&
-         uop_idx === uop_end - 1.U)) {
+          uop_idx === uop_end - 1.U)) {
     uop_idx := dec.uop_begin
   } .elsewhen (state === sExe) {
     uop_idx := uop_idx + 1.U
@@ -244,8 +244,8 @@ class TensorGemm(debug: Boolean = false)(implicit p: Parameters) extends Module
     inp_o := 0.U
     wgt_o := 0.U
   } .elsewhen (state === sExe &&
-              uop_idx === uop_end - 1.U &&
-              cnt_i === dec.lp_1 - 1.U) {
+               uop_idx === uop_end - 1.U &&
+               cnt_i === dec.lp_1 - 1.U) {
     cnt_o := cnt_o + 1.U
     acc_o := acc_o + dec.acc_0
     inp_o := inp_o + dec.inp_0
@@ -263,7 +263,7 @@ class TensorGemm(debug: Boolean = false)(implicit p: Parameters) extends Module
     inp_i := inp_o
     wgt_i := wgt_o
   } .elsewhen (state === sExe &&
-              uop_idx === uop_end - 1.U) {
+               uop_idx === uop_end - 1.U) {
     cnt_i := cnt_i + 1.U
     acc_i := acc_i + dec.acc_1
     inp_i := inp_i + dec.inp_1
index d96a681e7d69bca73f6571940d064dfff6c5de1c..7f06f9750ebb8439d117822336f0eb95e4a2d327 100644 (file)
@@ -67,20 +67,20 @@ class TensorLoad(tensorType: String = "none", debug: Boolean = false)
       when (io.start) {
         when (dec.ypad_0 =/= 0.U) {
           state := sYPad0
-       } .elsewhen (dec.xpad_0 =/= 0.U) {
+        } .elsewhen (dec.xpad_0 =/= 0.U) {
           state := sXPad0
-       } .otherwise {
+        } .otherwise {
           state := sReadCmd
-       }
+        }
       }
     }
     is (sYPad0) {
       when (yPadCtrl0.io.done) {
         when (dec.xpad_0 =/= 0.U) {
           state := sXPad0
-       } .otherwise {
+        } .otherwise {
           state := sReadCmd
-       }
+        }
       }
     }
     is (sXPad0) {
@@ -96,22 +96,22 @@ class TensorLoad(tensorType: String = "none", debug: Boolean = false)
     is (sReadData) {
       when (io.vme_rd.data.valid) {
         when (dataCtrl.io.done) {
-         when (dec.xpad_1 =/= 0.U) {
-           state := sXPad1
-         } .elsewhen (dec.ypad_1 =/= 0.U) {
-           state := sYPad1
-         } .otherwise  {
-           state := sIdle
-         }
-       } .elsewhen (dataCtrl.io.stride || dataCtrl.io.split) {
           when (dec.xpad_1 =/= 0.U) {
-           state := sXPad1
-         } .elsewhen (dec.xpad_0 =/= 0.U) {
+            state := sXPad1
+          } .elsewhen (dec.ypad_1 =/= 0.U) {
+            state := sYPad1
+          } .otherwise  {
+            state := sIdle
+          }
+        } .elsewhen (dataCtrl.io.stride || dataCtrl.io.split) {
+          when (dec.xpad_1 =/= 0.U) {
+            state := sXPad1
+          } .elsewhen (dec.xpad_0 =/= 0.U) {
             state := sXPad0
-         } .otherwise {
+          } .otherwise {
               state := sReadCmd
-         }
-       }
+          }
+        }
       }
     }
     is (sXPad1) {
@@ -161,9 +161,9 @@ class TensorLoad(tensorType: String = "none", debug: Boolean = false)
 
   xPadCtrl0.io.start := dec.xpad_0 =/= 0.U &
                           ((state === sIdle & io.start) |
-                         (state === sYPad0 & yPadCtrl0.io.done) |
+                          (state === sYPad0 & yPadCtrl0.io.done) |
                           (io.vme_rd.data.fire() & ~dataCtrlDone & (dataCtrl.io.stride | dataCtrl.io.split) & dec.xpad_1 === 0.U) |
-                         (state === sXPad1 & xPadCtrl1.io.done & ~dataCtrlDone))
+                          (state === sXPad1 & xPadCtrl1.io.done & ~dataCtrlDone))
 
   xPadCtrl1.io.start := dec.xpad_1 =/= 0.U & io.vme_rd.data.fire() &
                           ((dataCtrl.io.done) |
@@ -184,8 +184,8 @@ class TensorLoad(tensorType: String = "none", debug: Boolean = false)
   // write-to-sram
   val isZeroPad = state === sYPad0 |
                   state === sXPad0 |
-                 state === sXPad1 |
-                 state === sYPad1
+                  state === sXPad1 |
+                  state === sYPad1
 
   when (state === sIdle || state === sReadCmd || tag === (tp.numMemBlock - 1).U) {
     tag := 0.U
index 0012e4771c0eb96ecdaf828a2aedb2ba17cc0f45..1c6be03ba03716d3662b22383a199a86ed873df3 100644 (file)
@@ -69,13 +69,13 @@ class TensorStore(tensorType: String = "true", debug: Boolean = false)
     is (sIdle) {
       when (io.start) {
         state := sWriteCmd
-       when (xsize < xmax) {
+        when (xsize < xmax) {
           xlen := xsize
           xrem := 0.U
-       } .otherwise {
+        } .otherwise {
           xlen := xmax - 1.U
           xrem := xsize - xmax
-       }
+        }
       }
     }
     is (sWriteCmd) {
@@ -89,7 +89,7 @@ class TensorStore(tensorType: String = "true", debug: Boolean = false)
           state := sWriteAck
         } .elsewhen (tag === (numMemBlock - 1).U) {
           state := sReadMem
-       }
+        }
       }
     }
     is (sReadMem) {
@@ -98,27 +98,27 @@ class TensorStore(tensorType: String = "true", debug: Boolean = false)
     is (sWriteAck) {
       when (io.vme_wr.ack) {
         when (xrem === 0.U) {
-         when (ycnt === ysize - 1.U) {
+          when (ycnt === ysize - 1.U) {
             state := sIdle
-         } .otherwise {
+          } .otherwise {
             state := sWriteCmd
-           when (xsize < xmax) {
+            when (xsize < xmax) {
               xlen := xsize
               xrem := 0.U
-           } .otherwise {
+            } .otherwise {
               xlen := xmax - 1.U
               xrem := xsize - xmax
-           }
-         }
-       } .elsewhen (xrem < xmax) {
+            }
+          }
+        } .elsewhen (xrem < xmax) {
           state := sWriteCmd
           xlen := xrem
           xrem := 0.U
-       } .otherwise {
+        } .otherwise {
           state := sWriteCmd
           xlen := xmax - 1.U
           xrem := xrem - xmax
-       }
+        }
       }
     }
   }
@@ -142,8 +142,8 @@ class TensorStore(tensorType: String = "true", debug: Boolean = false)
   val stride = state === sWriteAck &
               io.vme_wr.ack &
               xcnt === xlen + 1.U &
-             xrem === 0.U &
-             ycnt =/= ysize - 1.U
+              xrem === 0.U &
+              ycnt =/= ysize - 1.U
 
   when (state === sIdle) {
     ycnt := 0.U
index e41a2c5b18e95d9509d2a74d815549e25b4f1d27..9b7934c221e5dff99d33fad6a0343692cb6622e5 100644 (file)
@@ -246,8 +246,8 @@ class TensorDataCtrl(sizeFactor: Int = 1, strideFactor: Int = 1)(implicit p: Par
   val ycnt = Reg(chiselTypeOf(dec.ysize))
 
   val stride = xcnt === len &
-              xrem === 0.U &
-              ycnt =/= dec.ysize - 1.U
+               xrem === 0.U &
+               ycnt =/= dec.ysize - 1.U
 
   val split = xcnt === len & xrem =/= 0.U
 
@@ -299,6 +299,6 @@ class TensorDataCtrl(sizeFactor: Int = 1, strideFactor: Int = 1)(implicit p: Par
   io.addr := caddr
   io.len := len
   io.done := xcnt === len &
-            xrem === 0.U &
-            ycnt === dec.ysize - 1.U
+             xrem === 0.U &
+             ycnt === dec.ysize - 1.U
 }