sv2v/src/Convert/Assertion.hs

27 lines
759 B
Haskell
Raw Normal View History

{- sv2v
- Author: Zachary Snow <zach@zachjs.com>
-
2019-04-23 06:23:32 +02:00
- Conversion for removing assertions. Assertions items are "commented out."
-}
module Convert.Assertion (convert) where
import Convert.Traverse
import Language.SystemVerilog.AST
convert :: [AST] -> [AST]
convert = map $ traverseDescriptions $ traverseModuleItems convertModuleItem
convertModuleItem :: ModuleItem -> ModuleItem
2019-04-23 06:23:32 +02:00
convertModuleItem (AssertionItem item) =
Generate $
map (GenModuleItem . MIPackageItem . Decl . CommentDecl) $
2019-04-23 06:23:32 +02:00
"removed an assertion item" :
(lines $ show $ AssertionItem item)
convertModuleItem other =
traverseStmts (traverseNestedStmts convertStmt) other
convertStmt :: Stmt -> Stmt
convertStmt (Assertion _) = Null
convertStmt other = other