Commit f13275bf by Zachary Snow

fix Struct and Interface conversion for expressions within LHSs

parent c53b3931
......@@ -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
......
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