Commit 55afc58f by Zachary Snow

simplify interface parameter override logic

parent b1f1b822
...@@ -606,18 +606,15 @@ inlineInstance global ranges modportBindings items partName ...@@ -606,18 +606,15 @@ inlineInstance global ranges modportBindings items partName
overrideParam :: Decl -> Decl overrideParam :: Decl -> Decl
overrideParam (Param Parameter t x e) = overrideParam (Param Parameter t x e) =
Param Localparam t x $
case lookup x instanceParams of case lookup x instanceParams of
Nothing -> Param Localparam t x e Nothing -> e
Just (Right _) -> Param Localparam t x (Ident $ paramTmp ++ x) Just _ -> Ident $ paramTmp ++ x
Just (Left t') -> error $ inlineKind ++ " param " ++ x
++ " expected expr, found type: " ++ show t'
overrideParam (ParamType Parameter x t) = overrideParam (ParamType Parameter x t) =
ParamType Localparam x $
case lookup x instanceParams of case lookup x instanceParams of
Nothing -> ParamType Localparam x t Nothing -> t
Just (Left _) -> Just _ -> Alias (paramTmp ++ x) []
ParamType Localparam x $ Alias (paramTmp ++ x) []
Just (Right e') -> error $ inlineKind ++ " param " ++ x
++ " expected type, found expr: " ++ show e'
overrideParam other = other overrideParam other = other
portBindingItem :: PortBinding -> ModuleItem portBindingItem :: PortBinding -> ModuleItem
......
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