Commit b46009af by Zachary Snow

Refactor project setup for our purposes

parent bfafea5d
-- | A parser for SystemVerilog.
module Language.SystemVerilog
( module Language.SystemVerilog.AST
, module Language.SystemVerilog.Parser
) where
import Language.SystemVerilog.AST
import Language.SystemVerilog.Parser
module Language.Verilog.AST module Language.SystemVerilog.AST
( Identifier ( Identifier
, Module (..) , Module (..)
, ModuleItem (..) , ModuleItem (..)
......
module Language.Verilog.Parser module Language.SystemVerilog.Parser
( parseFile ( parseFile
, preprocess , preprocess
) where ) where
import Language.Verilog.AST import Language.SystemVerilog.AST
import Language.Verilog.Parser.Lex import Language.SystemVerilog.Parser.Lex
import Language.Verilog.Parser.Parse import Language.SystemVerilog.Parser.Parse
import Language.Verilog.Parser.Preprocess import Language.SystemVerilog.Parser.Preprocess
import Language.Verilog.Parser.Tokens import Language.SystemVerilog.Parser.Tokens
-- | Parses a file given a table of predefined macros, the file name, and the file contents. -- | Parses a file given a table of predefined macros, the file name, and the file contents.
parseFile :: [(String, String)] -> FilePath -> String -> [Module] parseFile :: [(String, String)] -> FilePath -> String -> [Module]
......
{ {
{-# OPTIONS_GHC -w #-} {-# OPTIONS_GHC -w #-}
module Language.Verilog.Parser.Lex module Language.SystemVerilog.Parser.Lex
( alexScanTokens ( alexScanTokens
) where ) where
import Language.Verilog.Parser.Tokens import Language.SystemVerilog.Parser.Tokens
} }
......
{ {
module Language.Verilog.Parser.Parse (modules) where module Language.SystemVerilog.Parser.Parse (modules) where
import Data.Bits import Data.Bits
import Data.List import Data.List
import Data.BitVec import Data.BitVec
import Language.Verilog.AST import Language.SystemVerilog.AST
import Language.Verilog.Parser.Tokens import Language.SystemVerilog.Parser.Tokens
} }
%name modules %name modules
......
module Language.Verilog.Parser.Preprocess module Language.SystemVerilog.Parser.Preprocess
( uncomment ( uncomment
, preprocess , preprocess
) where ) where
......
module Language.Verilog.Parser.Tokens module Language.SystemVerilog.Parser.Tokens
( Token (..) ( Token (..)
, TokenName (..) , TokenName (..)
, Position (..) , Position (..)
......
module Language.Verilog.Simulator module Language.SystemVerilog.Simulator
( Simulator ( Simulator
, SimCommand (..) , SimCommand (..)
, SimResponse (..) , SimResponse (..)
...@@ -16,7 +16,7 @@ import Data.VCD hiding (Var, step) ...@@ -16,7 +16,7 @@ import Data.VCD hiding (Var, step)
import qualified Data.VCD as VCD import qualified Data.VCD as VCD
import Data.BitVec import Data.BitVec
import Language.Verilog.Netlist import Language.SystemVerilog.Netlist
--check msg = putStrLn msg >> hFlush stdout --check msg = putStrLn msg >> hFlush stdout
......
-- | A parser for Verilog.
module Language.Verilog
( module Language.Verilog.AST
, module Language.Verilog.Parser
) where
import Language.Verilog.AST
import Language.Verilog.Parser
name: sv2v
version: 0.0.1
category: Language, Hardware, Embedded
synopsis: SystemVerilog to Verilog conversion
description:
A tool for coverting SystemVerilog to Verilog. Also exposes a limited
SystemVerilog parser and AST. Forked from the Verilog parser found at
https://github.com/tomahawkins/verilog
author: Zachary Snow <zach@zachjs.com>, Tom Hawkins <tomahawkins@gmail.com>
maintainer: Zachary Snow <zach@zachjs.com>
license: BSD3
license-file: LICENSE
homepage: https://github.com/zachjs/sv2v
build-type: Simple
cabal-version: >= 1.10
library
default-language: Haskell2010
build-tools:
alex >= 3 && < 4,
happy >= 1 && < 2
build-depends:
base >= 4.8.2.0 && < 5.0,
array >= 0.5.1.0 && < 0.6
exposed-modules:
Data.BitVec
Language.SystemVerilog
Language.SystemVerilog.AST
Language.SystemVerilog.Parser
Language.SystemVerilog.Parser.Lex
Language.SystemVerilog.Parser.Parse
Language.SystemVerilog.Parser.Preprocess
Language.SystemVerilog.Parser.Tokens
ghc-options: -W
executable sv2v
default-language: Haskell2010
main-is: sv2v.hs
Build-Depends:
base
ghc-options:
-O3
-threaded
-rtsopts
-with-rtsopts=-N
-funbox-strict-fields
-Wall
source-repository head
type: git
location: git://github.com/zachjs/sv2v.git
{- sv2v
Author: Zachary Snow <zach@zachjs.com>
conversion entry point
-}
import System.IO
import System.Exit
main :: IO ()
main = do
let res = Left "unimplemented"
case res of
Left err -> do
hPrint stderr err
exitFailure
Right _ -> do
exitSuccess
name: verilog
version: 0.0.12
category: Language, Hardware, Embedded
synopsis: Verilog preprocessor, parser, and AST.
description:
A parser and supporting a small subset of Verilog.
Intended for machine generated, synthesizable code.
author: Tom Hawkins <tomahawkins@gmail.com>
maintainer: Tom Hawkins <tomahawkins@gmail.com>
license: BSD3
license-file: LICENSE
homepage: http://github.com/tomahawkins/verilog
build-type: Simple
cabal-version: >= 1.10
library
default-language: Haskell2010
build-tools:
alex >= 3 && < 4,
happy >= 1 && < 2
build-depends:
base >= 4.8.2.0 && < 5.0,
array >= 0.5.1.0 && < 0.6
exposed-modules:
Data.BitVec
Language.Verilog
Language.Verilog.AST
Language.Verilog.Parser
Language.Verilog.Parser.Lex
Language.Verilog.Parser.Parse
Language.Verilog.Parser.Preprocess
Language.Verilog.Parser.Tokens
ghc-options: -W
source-repository head
type: git
location: git://github.com/tomahawkins/verilog.git
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment