hunk ./examples/ALUSymII.hs 66 --- The clever multiplier things to note: --- --- * the sizeTest works on Exprs - this builds up symbolic --- expressions representing the control logic +-- This is the clever multiplier. It takes an argument of type Expr +-- -> Expr that estimates the cost of the small multiplier, in +-- terms of the size of the inputs hunk ./examples/ALUSymII.hs 70 -mult :: (Expr -> Expr) -> (Expr -> Expr) -> TSignal (Expr, Expr) -> TSignal Expr -mult cheapCost dearCost xys = +mult :: (Expr -> Expr) -> TSignal (Expr, Expr) -> TSignal Expr +mult cheapCost xys = hunk ./examples/ALUSymII.hs 79 - dearMul bs = payIf bs (dearCost threshold) (uncurry (*) <$> xys) + dearMul bs = payIf bs dearCost (uncurry (*) <$> xys) hunk ./examples/ALUSymII.hs 84 +dearCost = Var "dearCost" hunk ./examples/ALUSymII.hs 90 -test cheap dear = +test cheap = hunk ./examples/ALUSymII.hs 92 - (unT (mult cheap dear (TSignal $ delay (pure (Var "x1", Var "x2")) undefined))) + (unT (mult cheap (TSignal $ delay (pure (Var "x1", Var "x2")) undefined)))