Skip to content

Commit 0ccc4ac

Browse files
committed
Move I2C core to Experimental submodule
Since the I2C core is subject to changes in the near future, we've moved it to an `Experimental` submodule.
1 parent cf174eb commit 0ccc4ac

File tree

12 files changed

+40
-40
lines changed

12 files changed

+40
-40
lines changed

clash-cores/clash-cores.cabal

+11-10
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ library
124124
hs-source-dirs: src
125125

126126
exposed-modules:
127-
Clash.Cores.I2C
128-
Clash.Cores.I2C.BitMaster
129-
Clash.Cores.I2C.BitMaster.BusCtrl
130-
Clash.Cores.I2C.BitMaster.StateMachine
131-
Clash.Cores.I2C.ByteMaster
132-
Clash.Cores.I2C.ByteMaster.ShiftRegister
133-
Clash.Cores.I2C.Types
127+
Clash.Cores.Experimental.I2C
128+
Clash.Cores.Experimental.I2C.BitMaster
129+
Clash.Cores.Experimental.I2C.BitMaster.BusCtrl
130+
Clash.Cores.Experimental.I2C.BitMaster.StateMachine
131+
Clash.Cores.Experimental.I2C.ByteMaster
132+
Clash.Cores.Experimental.I2C.ByteMaster.ShiftRegister
133+
Clash.Cores.Experimental.I2C.Types
134+
134135
Clash.Cores.LatticeSemi.ECP5.Blackboxes.IO
135136
Clash.Cores.LatticeSemi.ECP5.IO
136137
Clash.Cores.LatticeSemi.ICE40.Blackboxes.IO
@@ -196,9 +197,9 @@ test-suite unittests
196197
buildable: False
197198

198199
other-Modules:
199-
Test.Cores.I2C
200-
Test.Cores.I2C.Config
201-
Test.Cores.I2C.Slave
200+
Test.Cores.Experimental.I2C
201+
Test.Cores.Experimental.I2C.Config
202+
Test.Cores.Experimental.I2C.Slave
202203
Test.Cores.Internal.SampleSPI
203204
Test.Cores.Internal.Signals
204205
Test.Cores.SPI

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99

1010
{-# LANGUAGE CPP #-}
1111

12-
module Clash.Cores.I2C
12+
module Clash.Cores.Experimental.I2C
1313
( i2c
14-
, i2cTop
15-
, Clash.Cores.I2C.ByteMaster.I2COperation(..)
14+
, Clash.Cores.Experimental.I2C.ByteMaster.I2COperation(..)
1615
) where
1716

1817
import Clash.Prelude hiding (read)
1918

20-
import Clash.Cores.I2C.BitMaster
21-
import Clash.Cores.I2C.ByteMaster
19+
import Clash.Cores.Experimental.I2C.BitMaster
20+
import Clash.Cores.Experimental.I2C.ByteMaster
2221

2322
-- | Core for I2C communication. Returns the output enable signals for SCL en SDA
2423
-- These signals assume that when they are `high`, they pull down SCL and SDA respectively.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
{-# LANGUAGE CPP #-}
99
{-# LANGUAGE RecordWildCards #-}
10-
module Clash.Cores.I2C.BitMaster
10+
module Clash.Cores.Experimental.I2C.BitMaster
1111
( bitMaster
1212
, BitMasterI
1313
, BitMasterO
@@ -20,9 +20,9 @@ import Control.Monad
2020
import Control.Monad.Trans.State
2121
import Data.Tuple
2222

23-
import Clash.Cores.I2C.BitMaster.BusCtrl
24-
import Clash.Cores.I2C.BitMaster.StateMachine
25-
import Clash.Cores.I2C.Types
23+
import Clash.Cores.Experimental.I2C.BitMaster.BusCtrl
24+
import Clash.Cores.Experimental.I2C.BitMaster.StateMachine
25+
import Clash.Cores.Experimental.I2C.Types
2626

2727
-- | Internal state of the I2C BitMaster.
2828
data BitMasterS

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
{-# LANGUAGE CPP #-}
99
{-# LANGUAGE RecordWildCards #-}
10-
module Clash.Cores.I2C.BitMaster.BusCtrl
10+
module Clash.Cores.Experimental.I2C.BitMaster.BusCtrl
1111
( busStatusCtrl
1212
, BusStatusCtrl(..)
1313
, busStartState
@@ -18,8 +18,8 @@ import Control.Lens
1818
import Control.Monad
1919
import Control.Monad.State
2020

21-
import Clash.Cores.I2C.BitMaster.StateMachine
22-
import Clash.Cores.I2C.Types
21+
import Clash.Cores.Experimental.I2C.BitMaster.StateMachine
22+
import Clash.Cores.Experimental.I2C.Types
2323

2424
-- | Bus status control state.
2525
data BusStatusCtrl

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
{-# LANGUAGE CPP #-}
99
{-# LANGUAGE RecordWildCards #-}
10-
module Clash.Cores.I2C.BitMaster.StateMachine where
10+
module Clash.Cores.Experimental.I2C.BitMaster.StateMachine where
1111

1212
import Clash.Prelude
1313
import Control.Lens hiding (Index)
1414
import Control.Monad
1515
import Control.Monad.State
1616

17-
import Clash.Cores.I2C.Types
17+
import Clash.Cores.Experimental.I2C.Types
1818

1919
-- | States for bit-level I2C operations.
2020
data BitStateMachine

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
{-# LANGUAGE CPP #-}
99
{-# LANGUAGE RecordWildCards #-}
10-
module Clash.Cores.I2C.ByteMaster
10+
module Clash.Cores.Experimental.I2C.ByteMaster
1111
( byteMaster
1212
, ByteMasterI
1313
, ByteMasterO
@@ -21,8 +21,8 @@ import Control.Monad
2121
import Control.Monad.Trans.State
2222
import Data.Tuple
2323

24-
import Clash.Cores.I2C.ByteMaster.ShiftRegister
25-
import Clash.Cores.I2C.Types
24+
import Clash.Cores.Experimental.I2C.ByteMaster.ShiftRegister
25+
import Clash.Cores.Experimental.I2C.Types
2626
import Data.Maybe (fromJust)
2727

2828
data ByteStateMachine = Idle | Active | Start | Read | Write | Ack | Stop
@@ -67,8 +67,8 @@ type ByteMasterO = (Bool,Bool,BitVector 8,BitCtrlSig)
6767

6868
-- | Byte level controller, takes care of correctly executing i2c communication
6969
-- based on the supplied control signals. It should be instantiated alongside
70-
-- 'Clash.Cores.I2C.BitMaster.bitMaster'. The outgoing 'BitCtrlSig' controls the
71-
-- 'Clash.Cores.I2C.BitMaster.bitMaster. whose 'BitRespSig' should be supplied as last
70+
-- 'Clash.Cores.Experimental.I2C.BitMaster.bitMaster'. The outgoing 'BitCtrlSig' controls the
71+
-- 'Clash.Cores.Experimental.I2C.BitMaster.bitMaster. whose 'BitRespSig' should be supplied as last
7272
-- input.
7373
byteMaster
7474
:: KnownDomain dom

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-}
77

88
{-# LANGUAGE RecordWildCards #-}
9-
module Clash.Cores.I2C.ByteMaster.ShiftRegister where
9+
module Clash.Cores.Experimental.I2C.ByteMaster.ShiftRegister where
1010

1111
import Clash.Prelude
1212

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Maintainer : QBayLogic B.V. <[email protected]>
66
-}
77

8-
module Clash.Cores.I2C.Types where
8+
module Clash.Cores.Experimental.I2C.Types where
99

1010
import Clash.Prelude
1111

clash-cores/test/Test/Cores/I2C.hs renamed to clash-cores/test/Test/Cores/Experimental/I2C.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{-# LANGUAGE CPP #-}
22

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

55
import qualified Data.List as L
66

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

1010
import Data.Maybe
11-
import Test.Cores.I2C.Config
12-
import Test.Cores.I2C.Slave
11+
import Test.Cores.Experimental.I2C.Config
12+
import Test.Cores.Experimental.I2C.Slave
1313
import Test.Tasty
1414
import Test.Tasty.HUnit
1515

clash-cores/test/Test/Cores/I2C/Config.hs renamed to clash-cores/test/Test/Cores/Experimental/I2C/Config.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{-# LANGUAGE CPP #-}
22

3-
module Test.Cores.I2C.Config where
3+
module Test.Cores.Experimental.I2C.Config where
44

55
import Clash.Prelude
66
import Clash.Explicit.SimIO
77
import Control.Monad (when)
88
import Numeric (showHex)
99

10-
import Clash.Cores.I2C.ByteMaster (I2COperation(..))
10+
import Clash.Cores.Experimental.I2C.ByteMaster (I2COperation(..))
1111

1212
data ConfStateMachine = CONFena |
1313
CONFaddr | CONFaddrAck |

clash-cores/test/Test/Cores/I2C/Slave.hs renamed to clash-cores/test/Test/Cores/Experimental/I2C/Slave.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE CPP #-}
22

3-
module Test.Cores.I2C.Slave where
3+
module Test.Cores.Experimental.I2C.Slave where
44

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

clash-cores/test/unittests.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Main where
1010
import Prelude
1111
import Test.Tasty
1212

13-
import qualified Test.Cores.I2C
13+
import qualified Test.Cores.Experimental.I2C
1414
import qualified Test.Cores.SPI
1515
import qualified Test.Cores.SPI.MultiSlave
1616
import qualified Test.Cores.UART
@@ -20,7 +20,7 @@ import qualified Test.Cores.Xilinx.DnaPortE2
2020

2121
tests :: TestTree
2222
tests = testGroup "Unittests"
23-
[ Test.Cores.I2C.i2cTest
23+
[ Test.Cores.Experimental.I2C.i2cTest
2424
, Test.Cores.SPI.tests
2525
, Test.Cores.SPI.MultiSlave.tests
2626
, Test.Cores.UART.tests

0 commit comments

Comments
 (0)