X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=blobdiff_plain;f=clash%2FCLasH%2FVHDL%2FGenerate.hs;fp=clash%2FCLasH%2FVHDL%2FGenerate.hs;h=c56bdbe462e1e085354b9042e9d0f48fd83a3300;hp=b6aa8c63a1a39d3bc58cdf47d7b00ac1c9f8eb9b;hb=82245ee4c9b5e653738fbeb168d245a6f3a5b91b;hpb=70654a9d134697f4d3703ff4a8747a1e078afd7b diff --git a/clash/CLasH/VHDL/Generate.hs b/clash/CLasH/VHDL/Generate.hs index b6aa8c6..c56bdbe 100644 --- a/clash/CLasH/VHDL/Generate.hs +++ b/clash/CLasH/VHDL/Generate.hs @@ -310,9 +310,8 @@ mkConcSm (bndr, expr@(CoreSyn.Case (CoreSyn.Var scrut) _ _ alts)) = do -- Compare the (constructor field of the) scrutinee with each of the -- alternatives. let cond_exprs = map (\x -> cmp AST.:=: x) altcons - -- Rotate expressions to the leftso that the expression related to the default case is the last - let alts' = (tail alts) ++ [head alts] - exprs <- MonadState.lift tsType $ mapM (varToVHDLExpr . (\(_,_,CoreSyn.Var expr) -> expr)) alts' --((tail alts) ++ [head alts]) + -- Rotate expressions to the left, so that the expression related to the default case is the last + 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"