Really revert all of the recent rotating changes.
[matthijs/master-project/cλash.git] / clash / CLasH / VHDL / Generate.hs
index df0991c39a25698fc656d6aa12dffa8f5a87d7fe..c56bdbe462e1e085354b9042e9d0f48fd83a3300 100644 (file)
@@ -301,7 +301,7 @@ mkConcSm (bndr, expr@(CoreSyn.Case (CoreSyn.Var scrut) _ _ alts)) = do
       let enums = [AST.PrimLit "'1'", AST.PrimLit "'0'"]
       return (enums, scrut_expr)
     (BuiltinType "Bool") -> do
-      let enums = [AST.PrimLit "true", AST.PrimLit "false"]
+      let enums = [AST.PrimLit "false", AST.PrimLit "true"]
       return (enums, scrut_expr)
     _ -> error $ "\nSelector case on weird scrutinee: " ++ pprString scrut ++ " scrutinee type: " ++ pprString (Id.idType scrut)
   -- Omit first condition, which is the default. Look up each altcon in
@@ -311,11 +311,7 @@ mkConcSm (bndr, expr@(CoreSyn.Case (CoreSyn.Var scrut) _ _ alts)) = do
   -- alternatives.
   let cond_exprs = map (\x -> cmp AST.:=: x) altcons
   -- Rotate expressions to the left, so that the expression related to the default case is the last
-  let alts' = case alts of
-                ((CoreSyn.DEFAULT,_,_):_) -> ((tail alts) ++ [head alts])
-                otherwise         -> alts
-  
-  exprs <- MonadState.lift tsType $ mapM (varToVHDLExpr . (\(_,_,CoreSyn.Var expr) -> expr)) alts' --((tail alts) ++ [head alts])
+  exprs <- MonadState.lift tsType $ mapM (varToVHDLExpr . (\(_,_,CoreSyn.Var expr) -> expr)) ((tail alts) ++ [head alts])
   return ([mkAltsAssign (Left bndr) cond_exprs exprs], [])
 
 mkConcSm (_, CoreSyn.Case _ _ _ _) = error "\nVHDL.mkConcSm: Not in normal form: Case statement does not have a simple variable as scrutinee"