(error $ "Function " ++ name ++ "is unknown? This should not happen!")
(lookup name fs)
+-- Makes the given name unique by appending a unique number.
+-- This does not do any checking against existing names, so it only guarantees
+-- uniqueness with other names generated by uniqueName.
+uniqueName :: String -> VHDLState String
+uniqueName name = do
+ count <- State.gets nameCount -- Get the funcs element from the session
+ State.modify (\s -> s {nameCount = count + 1})
+ return $ name ++ "-" ++ (show count)
+
builtin_funcs =
[
("hwxor", HWFunction [Port "a", Port "b"] (Port "o")),