Skip to content

Commit d41c4e9

Browse files
committed
Move I2C example files to clash-cores
1 parent 149885c commit d41c4e9

File tree

11 files changed

+46
-35
lines changed

11 files changed

+46
-35
lines changed

clash-cores/clash-cores.cabal

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,29 +106,43 @@ common basic-config
106106
QuickCheck,
107107
string-interpolate ^>= 0.3,
108108
template-haskell,
109+
transformers,
109110

110111
library
111112
import: basic-config
112113
hs-source-dirs: src
113114

114115
exposed-modules:
115-
Clash.Cores.Xilinx.Internal
116+
Clash.Cores.I2C
117+
Clash.Cores.I2C.BitMaster
118+
Clash.Cores.I2C.BitMaster.BusCtrl
119+
Clash.Cores.I2C.BitMaster.StateMachine
120+
Clash.Cores.I2C.ByteMaster
121+
Clash.Cores.I2C.ByteMaster.ShiftRegister
122+
Clash.Cores.I2C.Types
123+
Clash.Cores.LatticeSemi.ECP5.Blackboxes.IO
124+
Clash.Cores.LatticeSemi.ECP5.IO
125+
Clash.Cores.LatticeSemi.ICE40.Blackboxes.IO
126+
Clash.Cores.LatticeSemi.ICE40.IO
127+
Clash.Cores.SPI
128+
Clash.Cores.UART
116129
Clash.Cores.Xilinx.BlockRam
117130
Clash.Cores.Xilinx.BlockRam.BlackBoxes
118131
Clash.Cores.Xilinx.BlockRam.Internal
119132
Clash.Cores.Xilinx.DcFifo
120133
Clash.Cores.Xilinx.DcFifo.Internal.BlackBoxes
121134
Clash.Cores.Xilinx.DcFifo.Internal.Instances
122135
Clash.Cores.Xilinx.DcFifo.Internal.Types
123-
Clash.Cores.Xilinx.Ila
124-
Clash.Cores.Xilinx.Ila.Internal
125-
Clash.Cores.Xilinx.VIO
126-
Clash.Cores.Xilinx.VIO.Internal.BlackBoxes
127136
Clash.Cores.Xilinx.Floating
128137
Clash.Cores.Xilinx.Floating.Annotations
129138
Clash.Cores.Xilinx.Floating.BlackBoxes
130139
Clash.Cores.Xilinx.Floating.Explicit
131140
Clash.Cores.Xilinx.Floating.Internal
141+
Clash.Cores.Xilinx.Ila
142+
Clash.Cores.Xilinx.Ila.Internal
143+
Clash.Cores.Xilinx.Internal
144+
Clash.Cores.Xilinx.VIO
145+
Clash.Cores.Xilinx.VIO.Internal.BlackBoxes
132146
Clash.Cores.Xilinx.Xpm
133147
Clash.Cores.Xilinx.Xpm.Cdc
134148
Clash.Cores.Xilinx.Xpm.Cdc.ArraySingle
@@ -139,12 +153,6 @@ library
139153
Clash.Cores.Xilinx.Xpm.Cdc.Handshake.Internal
140154
Clash.Cores.Xilinx.Xpm.Cdc.Single
141155
Clash.Cores.Xilinx.Xpm.Cdc.Single.Internal
142-
Clash.Cores.SPI
143-
Clash.Cores.UART
144-
Clash.Cores.LatticeSemi.ICE40.IO
145-
Clash.Cores.LatticeSemi.ICE40.Blackboxes.IO
146-
Clash.Cores.LatticeSemi.ECP5.IO
147-
Clash.Cores.LatticeSemi.ECP5.Blackboxes.IO
148156

149157
ghc-options:
150158
-fexpose-all-unfoldings
@@ -171,6 +179,9 @@ test-suite unittests
171179
buildable: False
172180

173181
other-Modules:
182+
Test.Cores.I2C
183+
Test.Cores.I2C.I2CConfig
184+
Test.Cores.I2C.I2CSlave
174185
Test.Cores.Internal.SampleSPI
175186
Test.Cores.Internal.Signals
176187
Test.Cores.SPI

examples/i2c/I2C.hs renamed to clash-cores/src/Clash/Cores/I2C.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{-# LANGUAGE CPP #-}
22

3-
module I2C where
3+
module Clash.Cores.I2C where
44

55
import Clash.Prelude
66

7-
import I2C.BitMaster
8-
import I2C.ByteMaster
9-
import I2C.Types
7+
import Clash.Cores.I2C.BitMaster
8+
import Clash.Cores.I2C.ByteMaster
9+
import Clash.Cores.I2C.Types
1010

1111
{-# ANN i2c
1212
(Synthesize

examples/i2c/I2C/BitMaster.hs renamed to clash-cores/src/Clash/Cores/I2C/BitMaster.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE RecordWildCards #-}
3-
module I2C.BitMaster (bitMaster) where
3+
module Clash.Cores.I2C.BitMaster (bitMaster) where
44

55
import Clash.Prelude
66

@@ -9,9 +9,9 @@ import Control.Monad
99
import Control.Monad.Trans.State
1010
import Data.Tuple
1111

12-
import I2C.BitMaster.BusCtrl
13-
import I2C.BitMaster.StateMachine
14-
import I2C.Types
12+
import Clash.Cores.I2C.BitMaster.BusCtrl
13+
import Clash.Cores.I2C.BitMaster.StateMachine
14+
import Clash.Cores.I2C.Types
1515

1616
data BitMasterS
1717
= BitS

examples/i2c/I2C/BitMaster/BusCtrl.hs renamed to clash-cores/src/Clash/Cores/I2C/BitMaster/BusCtrl.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE RecordWildCards #-}
3-
module I2C.BitMaster.BusCtrl where
3+
module Clash.Cores.I2C.BitMaster.BusCtrl where
44

55
import Clash.Prelude
66
import Control.Lens
77
import Control.Monad
88
import Control.Monad.State
99

10-
import I2C.BitMaster.StateMachine
11-
import I2C.Types
10+
import Clash.Cores.I2C.BitMaster.StateMachine
11+
import Clash.Cores.I2C.Types
1212

1313
data BusStatusCtrl
1414
= BusStatusCtrl

examples/i2c/I2C/BitMaster/StateMachine.hs renamed to clash-cores/src/Clash/Cores/I2C/BitMaster/StateMachine.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE RecordWildCards #-}
3-
module I2C.BitMaster.StateMachine where
3+
module Clash.Cores.I2C.BitMaster.StateMachine where
44

55
import Clash.Prelude
66
import Control.Lens hiding (Index)
77
import Control.Monad
88
import Control.Monad.State
99

10-
import I2C.Types
10+
import Clash.Cores.I2C.Types
1111

1212
data BitStateMachine
1313
= Idle

examples/i2c/I2C/ByteMaster.hs renamed to clash-cores/src/Clash/Cores/I2C/ByteMaster.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE RecordWildCards #-}
3-
module I2C.ByteMaster (byteMaster) where
3+
module Clash.Cores.I2C.ByteMaster (byteMaster) where
44

55
import Clash.Prelude
66

@@ -9,8 +9,8 @@ import Control.Monad
99
import Control.Monad.Trans.State
1010
import Data.Tuple
1111

12-
import I2C.ByteMaster.ShiftRegister
13-
import I2C.Types
12+
import Clash.Cores.I2C.ByteMaster.ShiftRegister
13+
import Clash.Cores.I2C.Types
1414

1515
data ByteStateMachine = Idle | Start | Read | Write | Ack | Stop
1616
deriving (Show, Generic, NFDataX)

examples/i2c/I2C/ByteMaster/ShiftRegister.hs renamed to clash-cores/src/Clash/Cores/I2C/ByteMaster/ShiftRegister.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-# LANGUAGE RecordWildCards #-}
2-
module I2C.ByteMaster.ShiftRegister where
2+
module Clash.Cores.I2C.ByteMaster.ShiftRegister where
33

44
import Clash.Prelude
55

examples/i2c/I2C/Types.hs renamed to clash-cores/src/Clash/Cores/I2C/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module I2C.Types where
1+
module Clash.Cores.I2C.Types where
22

33
import Clash.Prelude
44

examples/i2c/I2Ctest.hs renamed to clash-cores/test/Test/Cores/I2C.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{-# LANGUAGE CPP #-}
22

3-
module I2Ctest where
3+
module Test.Cores.I2C where
44

55
import qualified Data.List as L
66

77
import Clash.Explicit.Prelude
8-
import I2C
8+
import Clash.Cores.I2C
99

10-
import I2Ctest.I2CSlave
11-
import I2Ctest.I2CConfig
10+
import Test.Cores.I2C.I2CSlave
11+
import Test.Cores.I2C.I2CConfig
1212

1313
system0 :: Clock System -> Reset System -> Signal System (Vec 16 (Unsigned 8), Bool, Bool)
1414
system0 clk arst = bundle (regFile,done,fault)

examples/i2c/I2Ctest/I2CConfig.hs renamed to clash-cores/test/Test/Cores/I2C/I2CConfig.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE CPP #-}
22

3-
module I2Ctest.I2CConfig where
3+
module Test.Cores.I2C.I2CConfig where
44

55
import Clash.Prelude
66
import Clash.Explicit.SimIO

examples/i2c/I2Ctest/I2CSlave.hs renamed to clash-cores/test/Test/Cores/I2C/I2CSlave.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE CPP #-}
22

3-
module I2Ctest.I2CSlave where
3+
module Test.Cores.I2C.I2CSlave where
44

55
import Clash.Prelude
66
import Clash.Explicit.SimIO

0 commit comments

Comments
 (0)