Skip to content

Commit

Permalink
More Parameters cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hcook committed Aug 23, 2014
1 parent e1860e4 commit 00d2469
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ import ChiselError._
import Module._

object Module {
def apply[T<:Module](c: =>T,fun:PartialFunction[Any,Any])(implicit _p:Option[Parameters] = None):T = {
val q = _p.getOrElse(params).alterPartial(fun)
def apply[T<:Module](c: =>T, f: PartialFunction[Any,Any]): T = {
val q = params.alterPartial(f)
Driver.modStackPushed = true
Driver.parStack.push(q)
val res = init(c)
Driver.parStack.pop
res
}
def apply[T<:Module](c: =>T)(implicit _p:Option[Parameters] = None):T = {
def apply[T<:Module](c: =>T)(implicit _p:Option[Parameters] = None): T = {
Driver.modStackPushed = true
_p match {
case Some(q: Parameters) => {
Expand Down
5 changes: 0 additions & 5 deletions src/main/scala/Parameters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,6 @@ object Parameters {

class Field[T]

trait PF extends PartialFunction[Any,Any]
object Alter {
def apply(p:PartialFunction[Any,Any]) = p
}

final class Parameters(
private val _world: World,
private val _look: _Lookup
Expand Down

0 comments on commit 00d2469

Please sign in to comment.