worked on client arbiter but need to consider if starving is possible when multiple client arbiters grant access to the same server

This commit is contained in:
Yehowshua Immanuel 2025-04-15 18:21:42 -04:00
parent f3acae0c1c
commit a58c836981
2 changed files with 50 additions and 7 deletions

View file

@ -26,7 +26,8 @@ dummyRule =
$display "test rule" $display "test rule"
-- we need a way to make serverMap safer... -- we need a way to make serverMap safer...
mkBus :: (Addr -> Maybe (MkServerIdx numServers)) mkBus :: (Add n (TLog numServers) (TLog (TAdd numServers 1)))
=> (Addr -> Maybe (MkServerIdx numServers))
-> Module (Bus inFlightTransactions numClients numServers) -> Module (Bus inFlightTransactions numClients numServers)
mkBus serverMap = do mkBus serverMap = do
-- Tag engines for each client to manage transaction tags -- Tag engines for each client to manage transaction tags
@ -113,9 +114,51 @@ mkBus serverMap = do
} }
clientResponseArbiterSlot.request clientResponseArbiterSlot.request
(sprintf "client[%d] arbit server response" clientIdx): when True ==> do (sprintf "client[%d] arbit submission" clientIdx): when True ==> do
return |> action {} let
selectedClientResponseArbiter :: Arbiter.Arbiter_IFC (TAdd numServers 1)
selectedClientResponseArbiter = (select responseArbiterByClient clientIdx)
selectedClientResponseQueue :: FIFOF (TaggedBusResponse inFlightTransactions)
selectedClientResponseQueue = (select clientResponseQueues clientIdx)
-- `TAdd numServers 1` because we can receive request from all servers
-- as well as a bypass requests from our one corresponding client request
-- queue
grantedIdx :: UInt (TLog (TAdd numServers 1))
grantedIdx = unpack selectedClientResponseArbiter.grant_id
isClientRequest :: Bool
isClientRequest = grantedIdx == fromInteger (valueOf numServers)
if isClientRequest then do
let
clientRequest :: TaggedBusRequest inFlightTransactions
clientRequest = selectedClientRequestQueue.first
responseUnMapped :: BusResponse
responseUnMapped = case clientRequest.busRequest of
BusReadRequest _ -> BusReadResponse (Left UnMapped)
BusWriteRequest _ -> BusWriteResponse (Left UnMapped)
response :: TaggedBusResponse inFlightTransactions
response = TaggedBusResponse {
tag = clientRequest.tag;
busResponse = responseUnMapped
}
selectedClientResponseQueue.enq response
selectedClientRequestQueue.deq
else do
let
grantedServerIdx :: MkServerIdx numServers
grantedServerIdx = truncate grantedIdx
selectedSubmitResponseQueue :: FIFOF (TaggedBusResponse inFlightTransactions)
selectedSubmitResponseQueue = (select submitResponseQueues grantedServerIdx)
response :: TaggedBusResponse inFlightTransactions
response = selectedSubmitResponseQueue.first
selectedClientResponseQueue.enq response
selectedSubmitResponseQueue.deq
addRules |> foldr (<+>) (rules {}) clientRules addRules |> foldr (<+>) (rules {}) clientRules

View file

@ -1,6 +1,6 @@
<mxfile host="Electron" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.0.16 Chrome/132.0.6834.196 Electron/34.2.0 Safari/537.36" version="26.0.16"> <mxfile host="Electron" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/26.0.16 Chrome/132.0.6834.196 Electron/34.2.0 Safari/537.36" version="26.0.16">
<diagram name="simplified" id="y4uZzcGV7WDpy27g0Dv6"> <diagram name="simplified" id="y4uZzcGV7WDpy27g0Dv6">
<mxGraphModel dx="833" dy="592" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> <mxGraphModel dx="675" dy="346" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root> <root>
<mxCell id="0" /> <mxCell id="0" />
<mxCell id="1" parent="0" /> <mxCell id="1" parent="0" />
@ -329,11 +329,11 @@
</mxGeometry> </mxGeometry>
</mxCell> </mxCell>
<mxCell id="x_lcP1lRQqL86m_3BT7G-6" value="value" style="endArrow=classic;html=1;rounded=0;jumpStyle=gap;labelBackgroundColor=#F8CECC;fontSize=10;" parent="1" edge="1"> <mxCell id="x_lcP1lRQqL86m_3BT7G-6" value="value" style="endArrow=classic;html=1;rounded=0;jumpStyle=gap;labelBackgroundColor=#F8CECC;fontSize=10;" parent="1" edge="1">
<mxGeometry x="-0.3043" width="50" height="50" relative="1" as="geometry"> <mxGeometry x="-0.8667" width="50" height="50" relative="1" as="geometry">
<mxPoint x="440" y="350" as="sourcePoint" /> <mxPoint x="440" y="360" as="sourcePoint" />
<mxPoint x="280" y="280" as="targetPoint" /> <mxPoint x="280" y="280" as="targetPoint" />
<Array as="points"> <Array as="points">
<mxPoint x="380" y="350" /> <mxPoint x="380" y="360" />
<mxPoint x="380" y="280" /> <mxPoint x="380" y="280" />
</Array> </Array>
<mxPoint as="offset" /> <mxPoint as="offset" />