mirror of https://github.com/zachjs/sv2v.git
simplify interface parameter override logic
This commit is contained in:
parent
b1f1b822e9
commit
55afc58f73
|
|
@ -606,18 +606,15 @@ inlineInstance global ranges modportBindings items partName
|
|||
|
||||
overrideParam :: Decl -> Decl
|
||||
overrideParam (Param Parameter t x e) =
|
||||
Param Localparam t x $
|
||||
case lookup x instanceParams of
|
||||
Nothing -> Param Localparam t x e
|
||||
Just (Right _) -> Param Localparam t x (Ident $ paramTmp ++ x)
|
||||
Just (Left t') -> error $ inlineKind ++ " param " ++ x
|
||||
++ " expected expr, found type: " ++ show t'
|
||||
Nothing -> e
|
||||
Just _ -> Ident $ paramTmp ++ x
|
||||
overrideParam (ParamType Parameter x t) =
|
||||
ParamType Localparam x $
|
||||
case lookup x instanceParams of
|
||||
Nothing -> ParamType Localparam x t
|
||||
Just (Left _) ->
|
||||
ParamType Localparam x $ Alias (paramTmp ++ x) []
|
||||
Just (Right e') -> error $ inlineKind ++ " param " ++ x
|
||||
++ " expected type, found expr: " ++ show e'
|
||||
Nothing -> t
|
||||
Just _ -> Alias (paramTmp ++ x) []
|
||||
overrideParam other = other
|
||||
|
||||
portBindingItem :: PortBinding -> ModuleItem
|
||||
|
|
|
|||
Loading…
Reference in New Issue