From 157559045f477e443a3f965af6a1959f59930eb8 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 1 Feb 2019 19:58:07 +0000 Subject: Fix imports --- src/VeriFuzz/AST.hs | 4 ++-- src/VeriFuzz/ASTGen.hs | 20 ++++++++++---------- src/VeriFuzz/CodeGen.hs | 20 ++++++++++---------- src/VeriFuzz/Env.hs | 5 +++++ src/VeriFuzz/Gen.hs | 4 ++-- src/VeriFuzz/General.hs | 6 +++--- src/VeriFuzz/Helpers.hs | 8 ++++---- src/VeriFuzz/Icarus.hs | 18 +++++++++--------- src/VeriFuzz/Mutate.hs | 17 ++++++++--------- src/VeriFuzz/Random.hs | 4 ++-- src/VeriFuzz/RandomAlt.hs | 4 ++-- src/VeriFuzz/XST.hs | 4 ++-- src/VeriFuzz/Yosys.hs | 4 ++-- 13 files changed, 61 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/VeriFuzz/AST.hs b/src/VeriFuzz/AST.hs index 0f24c49..2e3a54e 100644 --- a/src/VeriFuzz/AST.hs +++ b/src/VeriFuzz/AST.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Verilog.AST +Module : VeriFuzz.AST Description : Definition of the Verilog AST types. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -13,7 +13,7 @@ Defines the types to build a Verilog AST. {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} -module VeriFuzz.Verilog.AST +module VeriFuzz.AST ( -- * Top level types VerilogSrc(..) , getVerilogSrc diff --git a/src/VeriFuzz/ASTGen.hs b/src/VeriFuzz/ASTGen.hs index 41f905d..5730f50 100644 --- a/src/VeriFuzz/ASTGen.hs +++ b/src/VeriFuzz/ASTGen.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Circuit.ASTGen +Module : VeriFuzz.ASTGen Description : Generates the AST from the graph directly. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -10,17 +10,17 @@ Portability : POSIX Generates the AST from the graph directly. -} -module VeriFuzz.Circuit.ASTGen where +module VeriFuzz.ASTGen where -import Control.Lens ((^..)) -import Data.Foldable (fold) -import Data.Graph.Inductive (LNode, Node) -import qualified Data.Graph.Inductive as G -import Data.Maybe (catMaybes) +import Control.Lens ((^..)) +import Data.Foldable (fold) +import Data.Graph.Inductive (LNode, Node) +import qualified Data.Graph.Inductive as G +import Data.Maybe (catMaybes) +import VeriFuzz.AST import VeriFuzz.Circuit -import VeriFuzz.Internal.Gen -import VeriFuzz.Verilog.AST -import VeriFuzz.Verilog.Helpers +import VeriFuzz.Helpers +import VeriFuzz.Internal.Circuit -- | Converts a 'CNode' to an 'Identifier'. frNode :: Node -> Identifier diff --git a/src/VeriFuzz/CodeGen.hs b/src/VeriFuzz/CodeGen.hs index 3253f86..89bcdb1 100644 --- a/src/VeriFuzz/CodeGen.hs +++ b/src/VeriFuzz/CodeGen.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Verilog.CodeGen +Module : VeriFuzz.CodeGen Description : Code generation for Verilog AST. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -13,16 +13,16 @@ This module generates the code from the Verilog AST defined in {-# LANGUAGE FlexibleInstances #-} -module VeriFuzz.Verilog.CodeGen where +module VeriFuzz.CodeGen where -import Control.Lens (view, (^.)) -import Data.Foldable (fold) -import Data.Text (Text) -import qualified Data.Text as T -import qualified Data.Text.IO as T -import Numeric (showHex) -import Test.QuickCheck (Arbitrary, arbitrary) -import VeriFuzz.Verilog.AST +import Control.Lens (view, (^.)) +import Data.Foldable (fold) +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.IO as T +import Numeric (showHex) +import Test.QuickCheck (Arbitrary, arbitrary) +import VeriFuzz.AST -- | 'Source' class which determines that source code is able to be generated -- from the data structure using 'genSource'. This will be stored in 'Text' and diff --git a/src/VeriFuzz/Env.hs b/src/VeriFuzz/Env.hs index 85c761e..a20fd2d 100644 --- a/src/VeriFuzz/Env.hs +++ b/src/VeriFuzz/Env.hs @@ -12,6 +12,11 @@ Environment to run the simulator and synthesisers in a matrix. module VeriFuzz.Env where +import Control.Monad.Trans.Reader +import VeriFuzz.Icarus +import VeriFuzz.XST +import VeriFuzz.Yosys + -- | Environment used to run the main data SimMatrix = SimMatrix { yosys :: Yosys , xst :: Maybe Xst diff --git a/src/VeriFuzz/Gen.hs b/src/VeriFuzz/Gen.hs index d3e356d..90c42a9 100644 --- a/src/VeriFuzz/Gen.hs +++ b/src/VeriFuzz/Gen.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Verilog.Gen +Module : VeriFuzz.Gen Description : Various useful generators. Copyright : (c) 2019, Yann Herklotz Grave License : GPL-3 @@ -10,7 +10,7 @@ Portability : POSIX Various useful generators. -} -module VeriFuzz.Verilog.Gen where +module VeriFuzz.Gen where import qualified Data.Text as T import Test.QuickCheck (Arbitrary, Gen, arbitrary) diff --git a/src/VeriFuzz/General.hs b/src/VeriFuzz/General.hs index dbd1da0..1d2f183 100644 --- a/src/VeriFuzz/General.hs +++ b/src/VeriFuzz/General.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Simulator.General +Module : VeriFuzz.General Description : Class of the simulator. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -10,7 +10,7 @@ Portability : POSIX Class of the simulator and the synthesize tool. -} -module VeriFuzz.Simulator.General where +module VeriFuzz.General where import Data.Bits (shiftL) import Data.ByteString (ByteString) @@ -20,7 +20,7 @@ import qualified Data.Text as T import Prelude hiding (FilePath) import Shelly import System.FilePath.Posix (takeBaseName) -import VeriFuzz.Verilog.AST +import VeriFuzz.AST -- | Simulator class. class Simulator a where diff --git a/src/VeriFuzz/Helpers.hs b/src/VeriFuzz/Helpers.hs index 99e5f38..09bb7dd 100644 --- a/src/VeriFuzz/Helpers.hs +++ b/src/VeriFuzz/Helpers.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Verilog.Helpers +Module : VeriFuzz.Helpers Description : Defaults and common functions. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -10,11 +10,11 @@ Portability : POSIX Defaults and common functions. -} -module VeriFuzz.Verilog.Helpers where +module VeriFuzz.Helpers where import Control.Lens -import Data.Text (Text) -import VeriFuzz.Verilog.AST +import Data.Text (Text) +import VeriFuzz.AST regDecl :: Identifier -> ModItem regDecl = Decl Nothing . Port (Reg False) 1 diff --git a/src/VeriFuzz/Icarus.hs b/src/VeriFuzz/Icarus.hs index 527322a..fbcb657 100644 --- a/src/VeriFuzz/Icarus.hs +++ b/src/VeriFuzz/Icarus.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Simulator.Icarus +Module : VeriFuzz.Icarus Description : Icarus verilog module. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -10,18 +10,18 @@ Portability : POSIX Icarus verilog module. -} -module VeriFuzz.Simulator.Icarus where +module VeriFuzz.Icarus where import Control.Lens -import Data.ByteString (ByteString) -import qualified Data.ByteString as B -import Data.Foldable (fold) +import Data.ByteString (ByteString) +import qualified Data.ByteString as B +import Data.Foldable (fold) import Data.Hashable -import Data.List (transpose) -import Prelude hiding (FilePath) +import Data.List (transpose) +import Prelude hiding (FilePath) import Shelly -import VeriFuzz.Simulator.General -import VeriFuzz.Verilog +import VeriFuzz.AST +import VeriFuzz.General data Icarus = Icarus { icarusPath :: FilePath , vvpPath :: FilePath diff --git a/src/VeriFuzz/Mutate.hs b/src/VeriFuzz/Mutate.hs index 3e03a02..705e607 100644 --- a/src/VeriFuzz/Mutate.hs +++ b/src/VeriFuzz/Mutate.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Verilog.Mutation +Module : VeriFuzz.Mutation Description : Functions to mutate the Verilog AST. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -11,16 +11,15 @@ Functions to mutate the Verilog AST from "VeriFuzz.Verilog.AST" to generate more random patterns, such as nesting wires instead of creating new ones. -} -module VeriFuzz.Verilog.Mutate where +module VeriFuzz.Mutate where import Control.Lens -import Data.Maybe (catMaybes, fromMaybe) -import Data.Text (Text) -import qualified Data.Text as T -import VeriFuzz.Internal.Gen -import VeriFuzz.Internal.Shared -import VeriFuzz.Verilog.AST -import VeriFuzz.Verilog.CodeGen +import Data.Maybe (catMaybes, fromMaybe) +import Data.Text (Text) +import qualified Data.Text as T +import VeriFuzz.AST +import VeriFuzz.CodeGen +import VeriFuzz.Internal -- | Return if the 'Identifier' is in a 'ModDecl'. inPort :: Identifier -> ModDecl -> Bool diff --git a/src/VeriFuzz/Random.hs b/src/VeriFuzz/Random.hs index 7989b49..a6684dd 100644 --- a/src/VeriFuzz/Random.hs +++ b/src/VeriFuzz/Random.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Circuit.Random +Module : VeriFuzz.Random Description : Random generation for DAG Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -10,7 +10,7 @@ Portability : POSIX Define the random generation for the directed acyclic graph. -} -module VeriFuzz.Circuit.Random where +module VeriFuzz.Random where import Data.Graph.Inductive (Context, LEdge) import qualified Data.Graph.Inductive as G diff --git a/src/VeriFuzz/RandomAlt.hs b/src/VeriFuzz/RandomAlt.hs index 93a50e9..82bc743 100644 --- a/src/VeriFuzz/RandomAlt.hs +++ b/src/VeriFuzz/RandomAlt.hs @@ -1,5 +1,5 @@ {-|p -Module : VeriFuzz.Circuit.RandomAlt +Module : VeriFuzz.RandomAlt Description : RandomAlt generation for DAG Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -10,7 +10,7 @@ Portability : POSIX Define the random generation for the directed acyclic graph. -} -module VeriFuzz.Circuit.RandomAlt where +module VeriFuzz.RandomAlt where import qualified Data.Graph.Inductive.Arbitrary as G import Data.Graph.Inductive.PatriciaTree (Gr) diff --git a/src/VeriFuzz/XST.hs b/src/VeriFuzz/XST.hs index 1cd63eb..2690882 100644 --- a/src/VeriFuzz/XST.hs +++ b/src/VeriFuzz/XST.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Simulator.XST +Module : VeriFuzz.XST Description : Xst (ise) simulator implementation. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -12,7 +12,7 @@ Xst (ise) simulator implementation. {-# LANGUAGE QuasiQuotes #-} -module VeriFuzz.Simulator.XST where +module VeriFuzz.XST where import Control.Lens hiding ((<.>)) import qualified Data.Text as T diff --git a/src/VeriFuzz/Yosys.hs b/src/VeriFuzz/Yosys.hs index e18de5a..c0eecb5 100644 --- a/src/VeriFuzz/Yosys.hs +++ b/src/VeriFuzz/Yosys.hs @@ -1,5 +1,5 @@ {-| -Module : VeriFuzz.Simulator.Yosys +Module : VeriFuzz.Yosys Description : Yosys simulator implementation. Copyright : (c) 2018-2019, Yann Herklotz Grave License : BSD-3 @@ -12,7 +12,7 @@ Yosys simulator implementation. {-# LANGUAGE QuasiQuotes #-} -module VeriFuzz.Simulator.Yosys where +module VeriFuzz.Yosys where import Data.Maybe (fromMaybe) import Data.Text (Text) -- cgit