diff options
| author | Jack Koenig | 2018-10-31 14:59:40 -0700 |
|---|---|---|
| committer | Jack Koenig | 2018-10-31 15:22:26 -0700 |
| commit | 9bc2e6daaf3a3a08aefe485aa924c820689de981 (patch) | |
| tree | 5626a130bc1607e6a4c68eec864b7944f3a322e8 /src/main/scala/firrtl/passes/Passes.scala | |
| parent | 8d599182114306f77d098ba7effa836328b1e802 (diff) | |
Remove all uses of get_flip and deprecate
It is O(n) and every use is in an O(n) iteration resulting in O(n^2).
Same information can be extracted from create_exps which happens to also
be called at every use of get_flip.
Diffstat (limited to 'src/main/scala/firrtl/passes/Passes.scala')
| -rw-r--r-- | src/main/scala/firrtl/passes/Passes.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/passes/Passes.scala b/src/main/scala/firrtl/passes/Passes.scala index 45413348..bb65201b 100644 --- a/src/main/scala/firrtl/passes/Passes.scala +++ b/src/main/scala/firrtl/passes/Passes.scala @@ -140,8 +140,8 @@ object ExpandConnects extends Pass { case sx: Connect => val locs = create_exps(sx.loc) val exps = create_exps(sx.expr) - Block((locs zip exps).zipWithIndex map {case ((locx, expx), i) => - get_flip(sx.loc.tpe, i, Default) match { + Block(locs.zip(exps).map { case (locx, expx) => + to_flip(gender(locx)) match { case Default => Connect(sx.info, locx, expx) case Flip => Connect(sx.info, expx, locx) } @@ -154,7 +154,7 @@ object ExpandConnects extends Pass { locs(x).tpe match { case AnalogType(_) => Attach(sx.info, Seq(locs(x), exps(y))) case _ => - get_flip(sx.loc.tpe, x, Default) match { + to_flip(gender(locs(x))) match { case Default => Connect(sx.info, locs(x), exps(y)) case Flip => Connect(sx.info, exps(y), locs(x)) } |
