Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqiz01 committed Jul 3, 2018
1 parent d4f1d65 commit 36a033f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/network/DynamicGridNetwork.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ case class DynamicGridNetwork[B<:PinType](
import param._
import top._

def connectTerminalWithSwitch(terminal:BundleGroup) = {
def connectTerminalWithRouter(terminal:BundleGroup) = {
val (x,y) = terminal.coord.get
val rt = rtArray(x)(y)
connect(terminal, rt)
}

def connectTerminalArrayWithSwitch(array:List[List[BundleGroup]]) = {
def connectTerminalArrayWithRouter(array:List[List[BundleGroup]]) = {
array.foreach { col =>
col.foreach { terminal => connectTerminalWithSwitch(terminal) }
col.foreach { terminal => connectTerminalWithRouter(terminal) }
}
}

/** ----- Central Array Connection ----- **/
connectTerminalArrayWithSwitch(cuArray)
connectTerminalArrayWithRouter(cuArray)
/* ----- CU to CU Connection ----- */
for (y <- 0 until numRows) {
for (x <- 0 until numCols) {
Expand All @@ -50,14 +50,14 @@ case class DynamicGridNetwork[B<:PinType](

/** ----- Fringe Connection ----- **/
dagArray.map { dagArray =>
connectTerminalArrayWithSwitch(dagArray)
connectTerminalArrayWithRouter(dagArray)
dagArray.zipWithIndex.foreach { case (col, i) =>
col.zipWithIndex.foreach { case (dag, j) =>
val mc = mcArray(i)(j)
connect(mc, dag)
}
}
}
connectTerminalArrayWithSwitch(mcArray)
connectTerminalArrayWithRouter(mcArray)

}

0 comments on commit 36a033f

Please sign in to comment.