things still typecheck
This commit is contained in:
parent
989c4e9616
commit
b4c7537a85
3 changed files with 31 additions and 43 deletions
34
bs/Bus.bs
34
bs/Bus.bs
|
@ -1,25 +1,14 @@
|
|||
package Bus(a) where
|
||||
package Bus(mkBus) where
|
||||
|
||||
import Types
|
||||
import BusTypes
|
||||
import TagEngine
|
||||
import Vector
|
||||
import Util
|
||||
import Arbiter
|
||||
|
||||
interface (TestType :: * -> *) t = {}
|
||||
-- doSomething :: t -> Action
|
||||
|
||||
mkTestType :: (
|
||||
Bits t n, Arith t, Eq t
|
||||
)
|
||||
=> Module (TestType t)
|
||||
mkTestType = do
|
||||
return $ interface TestType {}
|
||||
|
||||
mkTestTop :: Module Empty
|
||||
mkTestTop = do
|
||||
testType :: TestType (UInt 5)
|
||||
testType <- mkTestType
|
||||
return $ interface Empty { }
|
||||
clientRequest :: Arbiter.ArbiterClient_IFC -> Action
|
||||
clientRequest ifc = ifc.request
|
||||
|
||||
mkBus :: Vector numClients (BusClient inFlightTransactions)
|
||||
-> Vector numServers (BusServer inFlightTransactions numClients)
|
||||
|
@ -28,8 +17,13 @@ mkBus clientVec serverVec = do
|
|||
tagEngineByClient :: Vector numClients (TagEngine inFlightTransactions)
|
||||
tagEngineByClient <- replicateM mkTagEngine
|
||||
|
||||
arbiterByServer :: Vector numServers (Arbiter_IFC numClients)
|
||||
arbiterByServer <- replicateM (mkArbiter False)
|
||||
|
||||
addRules |>
|
||||
rules
|
||||
"placeholder rule": when True ==> do
|
||||
let selectedArbiter = (select arbiterByServer 0)
|
||||
mapM_ clientRequest selectedArbiter.clients
|
||||
|
||||
return $ interface Empty { }
|
||||
|
||||
|
||||
a :: UInt 5
|
||||
a = 3
|
||||
|
|
Reference in a new issue