From: Matthijs Kooijman Date: Mon, 22 Jun 2009 13:16:43 +0000 (+0200) Subject: Append the Unique to generated VHDL entity id's. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=363b29906c13537fa612171f8f8855bb12cbc2d9;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Append the Unique to generated VHDL entity id's. --- diff --git a/VHDL.hs b/VHDL.hs index 3c641a0..bc992ef 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -114,7 +114,7 @@ createEntity (fname, expr) = do -- There must be a let at top level let (CoreSyn.Let binds (CoreSyn.Var res)) = letexpr res' <- mkMap res - let vhdl_id = mkVHDLBasicId $ bndrToString fname + let vhdl_id = mkVHDLBasicId $ bndrToString fname ++ "_" ++ varToStringUniq fname let ent_decl' = createEntityAST vhdl_id args' res' let AST.EntityDec entity_id _ = ent_decl' let signature = Entity entity_id args' res' @@ -695,9 +695,11 @@ bndrToVHDLId = mkVHDLExtId . OccName.occNameString . Name.nameOccName . Var.varN bndrToString :: CoreSyn.CoreBndr -> String - bndrToString = OccName.occNameString . Name.nameOccName . Var.varName +-- Get the string version a Var's unique +varToStringUniq = show . Var.varUnique + -- Extracts the string version of the name nameToString :: Name.Name -> String nameToString = OccName.occNameString . Name.nameOccName