The
Connectable
type class defines the modulemkConnection
, which is used to connect a pair of related types.
typeclass Connectable#(type a, type b);
module mkConnection#(a x1, b x2)(Empty);
endtypeclass
instance Connectable#(Get#(a), Put#(a));
One put and another will get the element.
instance Connectable#(Tuple2#(a, c), Tuple2#(b, d))
provisos (Connectable#(a, b), Connectable#(c, d));
This is used by ClientServer to connect the Get of Client to the Put of the Server and visa-versa.
Reference 1
Reference 1 C.7.1 GetPut import GetPut::*; Two blocks: Someone else gets or retrieves an item from an interface and Someone else put or gives an item to an iterface. Commonly used in Transaction Level Modeling, or TLM. Get You can retrieve (get) data from an object. method: get(): returns an item from an interface and removes it from the object. interface Get#(type a); method ActionValue#(a) get(); endinterface: Get Example:
Reference 1 Client two subinterfaces: Get#(req_type) request; // outside world will go through this interface to get a request from client Put#(resp_type) response; // outside world will go through this interface to send response to client Server two subinterfaces: Put#(req_type) request; // outside world (client) will go throught this interface to send request to server; Get#(resp_type) response; // outside world (client) will go through this interface to get response from server.
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?