Commit dd951740 by Zachary Snow

remove some dead code

parent d6d3938d
...@@ -21,6 +21,5 @@ convertFunction (MIPackageItem (Function ml t f decls stmts)) = ...@@ -21,6 +21,5 @@ convertFunction (MIPackageItem (Function ml t f decls stmts)) =
where where
t' = case t of t' = case t of
IntegerVector TReg sg rs -> Implicit sg rs IntegerVector TReg sg rs -> Implicit sg rs
IntegerVector TLogic sg rs -> Implicit sg rs
_ -> t _ -> t
convertFunction other = other convertFunction other = other
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
module Convert.TFBlock (convert) where module Convert.TFBlock (convert) where
import Data.List (intersect, isPrefixOf) import Data.List (intersect)
import Convert.Traverse import Convert.Traverse
import Language.SystemVerilog.AST import Language.SystemVerilog.AST
...@@ -53,7 +53,7 @@ flattenOuterBlocks (Block Seq "" declsA (Block Seq name declsB stmtsA : stmtsB)) ...@@ -53,7 +53,7 @@ flattenOuterBlocks (Block Seq "" declsA (Block Seq name declsB stmtsA : stmtsB))
Block Seq name (declsA ++ declsB) (stmtsA ++ stmtsB) Block Seq name (declsA ++ declsB) (stmtsA ++ stmtsB)
else (declsA, Block Seq name declsB stmtsA : stmtsB) else (declsA, Block Seq name declsB stmtsA : stmtsB)
flattenOuterBlocks (Block Seq name decls stmts) flattenOuterBlocks (Block Seq name decls stmts)
| notscope name = (decls, stmts) | null name = (decls, stmts)
| otherwise = ([], [Block Seq name decls stmts]) | otherwise = ([], [Block Seq name decls stmts])
flattenOuterBlocks stmt = ([], [stmt]) flattenOuterBlocks stmt = ([], [stmt])
...@@ -72,7 +72,3 @@ declName (Net _ _ _ _ x _ _) = x ...@@ -72,7 +72,3 @@ declName (Net _ _ _ _ x _ _) = x
declName (Param _ _ x _) = x declName (Param _ _ x _) = x
declName (ParamType _ x _) = x declName (ParamType _ x _) = x
declName CommentDecl{} = "" declName CommentDecl{} = ""
notscope :: Identifier -> Bool
notscope "" = True
notscope name = "sv2v_autoblock_" `isPrefixOf` name
...@@ -37,10 +37,7 @@ instance Show Decl where ...@@ -37,10 +37,7 @@ instance Show Decl where
where tStr = if t == UnknownType then "" else " = " ++ show t where tStr = if t == UnknownType then "" else " = " ++ show t
show (Variable d t x a e) = printf "%s%s%s%s%s;" (showPad d) (showPad t) x (showRanges a) (showAssignment e) show (Variable d t x a e) = printf "%s%s%s%s%s;" (showPad d) (showPad t) x (showRanges a) (showAssignment e)
show (Net d n s t x a e) = printf "%s%s%s %s%s%s%s;" (showPad d) (show n) (showPadBefore s) (showPad t) x (showRanges a) (showAssignment e) show (Net d n s t x a e) = printf "%s%s%s %s%s%s%s;" (showPad d) (show n) (showPadBefore s) (showPad t) x (showRanges a) (showAssignment e)
show (CommentDecl c) = show (CommentDecl c) = "// " ++ c
if elem '\n' c
then "// " ++ show c
else "// " ++ c
data Direction data Direction
= Input = Input
......
...@@ -199,6 +199,5 @@ showParams :: [ParamBinding] -> String ...@@ -199,6 +199,5 @@ showParams :: [ParamBinding] -> String
showParams params = indentedParenList $ map showParam params showParams params = indentedParenList $ map showParam params
showParam :: ParamBinding -> String showParam :: ParamBinding -> String
showParam ("*", Right Nil) = ".*"
showParam ("", arg) = showEither arg showParam ("", arg) = showEither arg
showParam (i, arg) = printf ".%s(%s)" i (showEither arg) showParam (i, arg) = printf ".%s(%s)" i (showEither arg)
...@@ -42,7 +42,7 @@ instance Show GenItem where ...@@ -42,7 +42,7 @@ instance Show GenItem where
x1 (show e1) x1 (show e1)
(show c) (show c)
x2 (show o2) (show e2) x2 (show o2) (show e2)
(if s == GenNull then "begin end" else showBareBlock s) (showBareBlock s)
show (GenNull) = ";" show (GenNull) = ";"
show (GenModuleItem item) = show item show (GenModuleItem item) = show item
...@@ -54,18 +54,8 @@ showBareBlock (GenBlock x i) = ...@@ -54,18 +54,8 @@ showBareBlock (GenBlock x i) =
showBareBlock item = show item showBareBlock item = show item
showBlockedBranch :: GenItem -> String showBlockedBranch :: GenItem -> String
showBlockedBranch genItem = showBlockedBranch genItem@GenBlock{} = showBareBlock genItem
showBareBlock $ showBlockedBranch genItem = showBareBlock $ GenBlock "" [genItem]
if isControl genItem
then GenBlock "" [genItem]
else genItem
where
isControl :: GenItem -> Bool
isControl GenIf{} = True
isControl GenFor{} = True
isControl GenCase{} = True
isControl GenModuleItem{} = True
isControl _ = False
type GenCase = ([Expr], GenItem) type GenCase = ([Expr], GenItem)
......
...@@ -98,10 +98,7 @@ instance Show Stmt where ...@@ -98,10 +98,7 @@ instance Show Stmt where
show (Continue ) = "continue;" show (Continue ) = "continue;"
show (Break ) = "break;" show (Break ) = "break;"
show (Null ) = ";" show (Null ) = ";"
show (CommentStmt c) = show (CommentStmt c) = "// " ++ c
if elem '\n' c
then "// " ++ show c
else "// " ++ c
showAssign :: (LHS, AsgnOp, Expr) -> String showAssign :: (LHS, AsgnOp, Expr) -> String
showAssign (l, op, e) = (showPad l) ++ (showPad op) ++ (show e) showAssign (l, op, e) = (showPad l) ++ (showPad op) ++ (show e)
......
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