2019-03-05 00:25:14 +01:00
|
|
|
{- sv2v
|
|
|
|
|
- Author: Zachary Snow <zach@zachjs.com>
|
|
|
|
|
-
|
2019-03-30 05:47:37 +01:00
|
|
|
- Conversion for `unique`, `unique0`, and `priority`
|
2019-03-05 00:25:14 +01:00
|
|
|
-
|
2019-05-15 15:55:15 +02:00
|
|
|
- This conversion simply drops the keywords, as it is used only for
|
|
|
|
|
- optimization. There is no way to force toolchains which don't support
|
|
|
|
|
- the keyword to perform such optimization.
|
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 =
|
|
|
|
|
map $ traverseDescriptions $ traverseModuleItems $ traverseStmts convertStmt
|
2019-03-05 00:25:14 +01:00
|
|
|
|
|
|
|
|
convertStmt :: Stmt -> Stmt
|
2019-03-30 05:47:37 +01:00
|
|
|
convertStmt (If (Just _) cc s1 s2) =
|
|
|
|
|
If Nothing cc s1 s2
|
|
|
|
|
convertStmt (Case (Just _) kw expr cases def) =
|
|
|
|
|
Case Nothing kw expr cases def
|
2019-03-05 00:25:14 +01:00
|
|
|
convertStmt other = other
|