2019-03-05 00:25:14 +01:00
|
|
|
{- sv2v
|
|
|
|
|
- Author: Zachary Snow <zach@zachjs.com>
|
|
|
|
|
-
|
2019-12-02 05:25:33 +01:00
|
|
|
- Conversion for `unique`, `unique0`, and `priority` (verification checks)
|
2019-03-05 00:25:14 +01:00
|
|
|
-
|
2024-01-29 05:24:23 +01:00
|
|
|
- This conversion adds full_case and parallel_case synthesis attributes
|
|
|
|
|
- for priority and unique respectively.
|
2019-03-05 00:25:14 +01:00
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
module Convert.Unique (convert) where
|
|
|
|
|
|
|
|
|
|
import Convert.Traverse
|
|
|
|
|
import Language.SystemVerilog.AST
|
|
|
|
|
|
2019-04-24 00:44:45 +02:00
|
|
|
convert :: [AST] -> [AST]
|
|
|
|
|
convert =
|
2021-07-16 00:05:47 +02:00
|
|
|
map $ traverseDescriptions $ traverseModuleItems $ traverseStmts $
|
|
|
|
|
traverseNestedStmts convertStmt
|
2019-03-05 00:25:14 +01:00
|
|
|
|
|
|
|
|
convertStmt :: Stmt -> Stmt
|
2019-12-02 05:25:33 +01:00
|
|
|
convertStmt (If _ cc s1 s2) =
|
|
|
|
|
If NoCheck cc s1 s2
|
2024-01-23 03:47:35 +01:00
|
|
|
convertStmt (Case Priority kw expr cases) =
|
|
|
|
|
StmtAttr caseAttr caseStmt
|
|
|
|
|
where
|
|
|
|
|
caseAttr = Attr [("synthesis", Nil), ("full_case", Nil)]
|
|
|
|
|
caseStmt = Case NoCheck kw expr cases
|
|
|
|
|
convertStmt (Case Unique kw expr cases) =
|
|
|
|
|
StmtAttr caseAttr caseStmt
|
|
|
|
|
where
|
|
|
|
|
caseAttr = Attr [("synthesis", Nil), ("parallel_case", Nil)]
|
|
|
|
|
caseStmt = Case NoCheck kw expr cases
|
|
|
|
|
convertStmt (Case Unique0 kw expr cases) =
|
|
|
|
|
convertStmt (Case Unique kw expr cases)
|
2019-03-05 00:25:14 +01:00
|
|
|
convertStmt other = other
|