Skip to content

Commit

Permalink
code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
albertchen-sifive committed Oct 26, 2020
1 parent cad41fe commit b35c2f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/src/diplomacy/select_tutorial.md
Expand Up @@ -120,7 +120,7 @@ Select.filterCollectDeep(top) {
`LazyModule`s have a `getNodes` method that return all the nodes instantiated
within that module. This can be combined with the `Select.collectInwardEdges`
to select `LazyModule`s based on their connectivity.
`Select.collectInwardEdges` takes a `BaseNode` and a parital function. It
`Select.collectInwardEdges` takes a `BaseNode` and a partial function. It
applies the function to all the `InwardEdge`s of the node. There is also a
`Select.collectOutwardEdges` that does the same for outward edges. The example
below uses `Select.filterCollectDeep`, `LazyModule.getNodes`, and
Expand All @@ -133,6 +133,7 @@ Select.filterCollectDeep (top) {
case _ => true
} {
case a: A =>
// Function.unlift used to convert `InwardEdge => Option[String]` to `PartialFunction[InwardEdge, String]
a.getNodes.flatMap(Select.collectInwardEdges(_)(Function.unlift { edge =>
edge.node.lazyModule match {
case l: Leaf => Some(l.pathName)
Expand Down
3 changes: 1 addition & 2 deletions src/main/scala/aop/Select.scala
Expand Up @@ -2,8 +2,7 @@

package freechips.rocketchip.aop

import chisel3.{Data, RawModule}
import chisel3.experimental.BaseModule
import chisel3.Data
import freechips.rocketchip.config.Parameters
import freechips.rocketchip.diplomacy.{
AnyMixedNode,
Expand Down

0 comments on commit b35c2f4

Please sign in to comment.