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