Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sifferman committed Mar 11, 2024
1 parent e931b42 commit 65c4a7e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### New Features

* Added conversion of of standard and elaboration severity tasks
* `unique`, `unique0`, and `priority` case statements now produce corresponding
`parallel_case` and `full_case` statement attributes
* Added support for attributes in unary, binary, and ternary expressions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Preprocessing:
Conversion:
--pass-through Dump input without converting
-E --exclude=CONV Exclude a particular conversion (Always, Assert,
Interface, Logic, or UnbasedUnsized)
Interface, Logic, SeverityTasks, or UnbasedUnsized)
-v --verbose Retain certain conversion artifacts
-w --write=MODE/FILE/DIR How to write output; default is 'stdout'; use
'adjacent' to create a .v file next to each input;
Expand Down
4 changes: 2 additions & 2 deletions src/Convert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import qualified Convert.StringParam
import qualified Convert.StringType
import qualified Convert.Struct
import qualified Convert.StructConst
import qualified Convert.SystemTasks
import qualified Convert.SeverityTasks
import qualified Convert.TFBlock
import qualified Convert.Typedef
import qualified Convert.TypeOf
Expand Down Expand Up @@ -122,7 +122,7 @@ initialPhases tops selectExclude =
, Convert.Interface.disambiguate
, Convert.Package.convert
, Convert.StructConst.convert
, Convert.SystemTasks.convert
, selectExclude Job.SeverityTasks Convert.SeverityTasks.convert
, Convert.PortDecl.convert
, Convert.ParamNoDefault.convert tops
, Convert.ResolveBindings.convert
Expand Down
19 changes: 13 additions & 6 deletions src/Convert/SystemTasks.hs → src/Convert/SeverityTasks.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{- sv2v
- Author: Ethan Sifferman <ethan@sifferman.dev>
-
- Conversion of SystemVerilog System Tasks to Verilog.
-}

module Convert.SystemTasks (convert) where
- Author: Ethan Sifferman <ethan@sifferman.dev>
-
- Conversion of standard and elaboration severity tasks `$info`, `$warning`,
- `$error`, and `$fatal` (20.10 and 20.11).
-
- * Severity task messages are converted into `$display` tasks.
- * Standard `$fatal` tasks run `$finish` directly after running `$display`.
- * Elaboration `$fatal` tasks set `_sv2v_elaboration_fatal` to a
- non-negative value, causing the simulation to exit once all elaboration
- severity task messages have been printed.
-}

module Convert.SeverityTasks (convert) where

import Convert.Traverse
import Language.SystemVerilog.AST
Expand Down
3 changes: 2 additions & 1 deletion src/Job.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data Exclude
| Assert
| Interface
| Logic
| SeverityTasks
| Succinct
| UnbasedUnsized
deriving (Typeable, Data, Eq)
Expand Down Expand Up @@ -75,7 +76,7 @@ defaultJob = Job
&= groupname "Conversion"
, exclude = nam_ "exclude" &= name "E" &= typ "CONV"
&= help ("Exclude a particular conversion (Always, Assert, Interface,"
++ " Logic, or UnbasedUnsized)")
++ " Logic, SeverityTasks, or UnbasedUnsized)")
, verbose = nam "verbose" &= help "Retain certain conversion artifacts"
, write = Stdout &= ignore -- parsed from the flexible flag below
, writeRaw = "s" &= name "write" &= name "w" &= explicit
Expand Down
2 changes: 1 addition & 1 deletion sv2v.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ executable sv2v
Convert.StringType
Convert.Struct
Convert.StructConst
Convert.SystemTasks
Convert.SeverityTasks
Convert.TFBlock
Convert.Traverse
Convert.Typedef
Expand Down

0 comments on commit 65c4a7e

Please sign in to comment.