From: Matthijs Kooijman Date: Wed, 12 Aug 2009 15:17:51 +0000 (+0200) Subject: Revert "Don't generate VHDL for state packing." X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=78cf1d7edd55f14548761a01352361e25995f7db;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Revert "Don't generate VHDL for state packing." This is now handled by the previous commit, which ensures mkConcSm (and thus genApplication) don't even see state (un)packing bindings. This reverts commit fda239f0ae8fc6a2250e6719c3f564c9b2390c4a. --- diff --git "a/c\316\273ash/CLasH/VHDL/Generate.hs" "b/c\316\273ash/CLasH/VHDL/Generate.hs" index ae4769b..0e5186f 100644 --- "a/c\316\273ash/CLasH/VHDL/Generate.hs" +++ "b/c\316\273ash/CLasH/VHDL/Generate.hs" @@ -842,7 +842,7 @@ genApplication dst f args = do -- assignment here. f' <- MonadState.lift tsType $ varToVHDLExpr f return $ ([mkUncondAssign dst f'], []) - True | not stateful -> + True -> case Var.idDetails f of IdInfo.DataConWorkId dc -> case dst of -- It's a datacon. Create a record from its arguments. @@ -914,16 +914,6 @@ genApplication dst f args = do error $ "\nGenerate.genApplication(ClassOpId): Incorrect number of arguments to builtin function: " ++ pprString f ++ " Args: " ++ show args Nothing -> error $ "\nGenerate.genApplication(ClassOpId): Using function from another module that is not a known builtin: " ++ pprString f details -> error $ "\nGenerate.genApplication: Calling unsupported function " ++ pprString f ++ " with GlobalIdDetails " ++ pprString details - -- If we can't generate a component instantiation, and the destination is - -- a state type, don't generate anything. - _ -> return ([], []) - where - -- Is our destination a state value? - stateful = case dst of - -- When our destination is a VHDL name, it won't have had a state type - Right _ -> False - -- Otherwise check its type - Left bndr -> hasStateType bndr ----------------------------------------------------------------------------- -- Functions to generate functions dealing with vectors.