Skip to content

Commit

Permalink
Use new location for Calyx primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitnigam committed Feb 6, 2024
1 parent bc2aadb commit 01ed58b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/scala/backends/calyx/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,13 @@ private class CalyxBackendHelper {
)
)

val donePortName =
val donePortName =
if (rhsInfo.isDefined) "write_done" else "read_done"

// The value is generated on `read_data` and written on `write_data`.
val portName =
if (rhsInfo.isDefined) "write_data" else "read_data"


// The array ports change if the array is a function parameter. We want to access the
// component ports, e.g. `x_read_data`, rather than the memory ports, `x.read_data`.
Expand Down Expand Up @@ -683,14 +683,14 @@ private class CalyxBackendHelper {
con :: result.structure ++ structs
}
})

val readEnPort = if (isParam) {
ThisPort(CompVar(s"${id}_read_en"))
} else {
arr.port("read_en")
}

// always assign 1 to read_en port if we want to read from seq mem
// always assign 1 to read_en port if we want to read from seq mem
val readEnStruct = if (rhsInfo.isDefined) List() else List(Assign(ConstantPort(1,1), readEnPort))

val writeEnStruct =
Expand All @@ -700,10 +700,10 @@ private class CalyxBackendHelper {
}

val delay = (rhsInfo) match {
case (None) => Some(1)
case (None) => Some(1)
case (Some((_, delay))) => delay.map(_ + 1)
}

EmitOutput(
accessPort,
Some(donePort),
Expand Down Expand Up @@ -874,7 +874,7 @@ private class CalyxBackendHelper {
lhs,
Some((rOut.done.getOrElse(ConstantPort(1, 1)), rOut.delay))
)(store)
val groupName = genName("upd")
val groupName = genName("upd")

assertOrThrow(
lOut.done.isDefined,
Expand All @@ -890,7 +890,7 @@ private class CalyxBackendHelper {
HolePort(groupName, "done")
)
// can assign guard as true for lOut.port = rOut.port since the write_en
// signal is what actually determines what is written into
// signal is what actually determines what is written into
val struct =
lOut.structure ++ rOut.structure ++ List(
Assign(
Expand Down Expand Up @@ -1093,7 +1093,7 @@ private class CalyxBackendHelper {

val imports =
Import("primitives/core.futil") ::
Import("primitives/memories.futil") ::
Import("primitives/memories/seq.futil") ::
Import("primitives/binary_operators.futil") ::
p.includes.flatMap(_.backends.get(C.Calyx)).map(i => Import(i)).toList

Expand Down

0 comments on commit 01ed58b

Please sign in to comment.