better error messaging for missing interfaces

This commit is contained in:
Zachary Snow 2019-10-20 14:53:37 -04:00
parent 3597f4a6be
commit 5843ef3879
1 changed files with 4 additions and 1 deletions

View File

@ -145,7 +145,10 @@ convertDescription interfaces modules (Part attrs extern Module lifetime name po
expandPortBinding _ other = [other]
lookupModport :: Maybe Identifier -> Identifier -> Identifier -> Maybe [ModportDecl]
lookupModport instanceName interfaceName = (Map.!?) modportMap
lookupModport instanceName interfaceName =
if Map.member interfaceName interfaces
then (Map.!?) modportMap
else error $ "could not find interface " ++ show interfaceName
where
prefix = maybe "" (++ "_") instanceName
interfaceItems =