skeletons of Bus module slowly forming
This commit is contained in:
parent
da761f6e4e
commit
fe2fa21fcc
17
bs/Bus.bs
17
bs/Bus.bs
|
@ -2,11 +2,16 @@ package Bus(a) where
|
||||||
|
|
||||||
import Types
|
import Types
|
||||||
import BusTypes
|
import BusTypes
|
||||||
|
import TagEngine
|
||||||
|
import Vector
|
||||||
|
|
||||||
interface (TestType :: * -> *) t = {}
|
interface (TestType :: * -> *) t = {}
|
||||||
-- doSomething :: t -> Action
|
-- doSomething :: t -> Action
|
||||||
|
|
||||||
mkTestType :: (Bits t n, Arith t, Eq t) => Module (TestType t)
|
mkTestType :: (
|
||||||
|
Bits t n, Arith t, Eq t
|
||||||
|
)
|
||||||
|
=> Module (TestType t)
|
||||||
mkTestType = do
|
mkTestType = do
|
||||||
return $ interface TestType {}
|
return $ interface TestType {}
|
||||||
|
|
||||||
|
@ -16,5 +21,15 @@ mkTestTop = do
|
||||||
testType <- mkTestType
|
testType <- mkTestType
|
||||||
return $ interface Empty { }
|
return $ interface Empty { }
|
||||||
|
|
||||||
|
mkBus :: Vector numClients (BusClient (UInt (TLog numClients)))
|
||||||
|
-> Vector numServers (BusServer (UInt (TLog numClients)) clientTagType)
|
||||||
|
-> Module Empty
|
||||||
|
mkBus clientVec serverVec = do
|
||||||
|
tagEngineByClient :: Vector numClients (TagEngine (TLog numClients))
|
||||||
|
tagEngineByClient <- replicateM mkTagEngine
|
||||||
|
|
||||||
|
return $ interface Empty { }
|
||||||
|
|
||||||
|
|
||||||
a :: UInt 5
|
a :: UInt 5
|
||||||
a = 3
|
a = 3
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
package BusTypes(
|
package BusTypes(
|
||||||
|
Bus(..),
|
||||||
BusClient(..), BusServer(..),
|
BusClient(..), BusServer(..),
|
||||||
BusRequest(..), BusResponse(..),
|
BusRequest(..), BusResponse(..),
|
||||||
ReadRequest(..), ReadResponse(..), WriteRequest(..), WriteResponse(..),
|
ReadRequest(..), ReadResponse(..), WriteRequest(..), WriteResponse(..),
|
||||||
|
@ -87,10 +88,6 @@ interface (BusServer :: * -> * -> *) transactionTagType clientTagType =
|
||||||
dequeueResponse :: ActionValue (clientTagType, BusResponse, transactionTagType)
|
dequeueResponse :: ActionValue (clientTagType, BusResponse, transactionTagType)
|
||||||
peekClientTagDestination :: clientTagTye
|
peekClientTagDestination :: clientTagTye
|
||||||
|
|
||||||
interface (Bus :: # -> # -> * -> * -> *) numClients numServers transactionTagType clientTagType =
|
|
||||||
clients :: Vector numClients (BusClient transactionTagType)
|
|
||||||
servers :: Vector numServers (BusServer transactionTagType clientTagType)
|
|
||||||
|
|
||||||
type Token = UInt 5
|
type Token = UInt 5
|
||||||
type Numeric = 5
|
type Numeric = 5
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue