mirror of https://github.com/zachjs/sv2v.git
fix Struct and Interface conversion for expressions within LHSs
This commit is contained in:
parent
c53b39319d
commit
f13275bfa1
|
|
@ -147,6 +147,10 @@ convertDescription interfaces modules (Part extern Module lifetime name ports it
|
|||
if Map.member x modports || Map.member x instances
|
||||
then LHSIdent (x ++ "_" ++ y)
|
||||
else orig
|
||||
convertLHS (LHSBit l e) =
|
||||
LHSBit l (traverseNestedExprs convertExpr e)
|
||||
convertLHS (LHSRange l (e1, e2)) =
|
||||
LHSRange l (traverseNestedExprs convertExpr e1, traverseNestedExprs convertExpr e2)
|
||||
convertLHS other = other
|
||||
convertPort :: Identifier -> [Identifier]
|
||||
convertPort ident =
|
||||
|
|
|
|||
|
|
@ -142,12 +142,13 @@ convertAsgn structs types (lhs, expr) =
|
|||
Just t -> (t, LHSIdent x)
|
||||
convertLHS (LHSBit l e) =
|
||||
if null rs
|
||||
then (Implicit Unspecified [], LHSBit l' e)
|
||||
else (tf $ tail rs, LHSBit l' e)
|
||||
then (Implicit Unspecified [], LHSBit l' e')
|
||||
else (tf $ tail rs, LHSBit l' e')
|
||||
where
|
||||
(t, l') = convertLHS l
|
||||
(tf, rs) = typeRanges t
|
||||
convertLHS (LHSRange l (rOuter @ (hiO, loO))) =
|
||||
e' = snd $ convertSubExpr e
|
||||
convertLHS (LHSRange l rOuterOrig) =
|
||||
case l' of
|
||||
LHSRange lInner (_, loI) ->
|
||||
(t, LHSRange lInner (simplify hi, simplify lo))
|
||||
|
|
@ -160,6 +161,9 @@ convertAsgn structs types (lhs, expr) =
|
|||
where
|
||||
(t, l') = convertLHS l
|
||||
(tf, rs) = typeRanges t
|
||||
hiO = snd $ convertSubExpr $ fst rOuterOrig
|
||||
loO = snd $ convertSubExpr $ snd rOuterOrig
|
||||
rOuter = (hiO, loO)
|
||||
rs' = rOuter : tail rs
|
||||
convertLHS (LHSDot l x ) =
|
||||
case t of
|
||||
|
|
|
|||
Loading…
Reference in New Issue