Commit 88c401e8 by Zachary Snow

additional interface conversion error messages

parent eed5444d
...@@ -80,7 +80,10 @@ convertDescription interfaces modules (Part attrs extern Module lifetime name po ...@@ -80,7 +80,10 @@ convertDescription interfaces modules (Part attrs extern Module lifetime name po
Nothing -> orig Nothing -> orig
where where
InterfaceT interfaceName (Just _) [] = t InterfaceT interfaceName (Just _) [] = t
interfaceItems = snd $ interfaces Map.! interfaceName interfaceItems =
case Map.lookup interfaceName interfaces of
Just res -> snd res
Nothing -> error $ "could not find interface " ++ show interfaceName
mapper (dir, port, expr) = mapper (dir, port, expr) =
Variable dir mpt (ident ++ "_" ++ port) mprs Nothing Variable dir mpt (ident ++ "_" ++ port) mprs Nothing
where (mpt, mprs) = lookupType interfaceItems (fromJust expr) where (mpt, mprs) = lookupType interfaceItems (fromJust expr)
...@@ -133,7 +136,11 @@ convertDescription interfaces modules (Part attrs extern Module lifetime name po ...@@ -133,7 +136,11 @@ convertDescription interfaces modules (Part attrs extern Module lifetime name po
expandPortBinding moduleName (portName, Just newExpr) expandPortBinding moduleName (portName, Just newExpr)
where where
InterfaceT _ (Just modportName) [] = InterfaceT _ (Just modportName) [] =
modules Map.! (moduleName, portName) case Map.lookup (moduleName, portName) modules of
Just t -> t
Nothing -> error $ "could not find port "
++ show portName ++ " in module "
++ show moduleName
newExpr = Dot (Ident ident) modportName newExpr = Dot (Ident ident) modportName
(_, Just decls) -> (_, Just decls) ->
-- modport directly bound to a modport -- modport directly bound to a modport
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment