Connectable

The Connectable type class defines the module mkConnection, which is used to connect a pair of related types.

typeclass Connectable#(type a, type b);
    module mkConnection#(a x1, b x2)(Empty);
endtypeclass

Instances of typeclass to be connectable

Get and Put

instance Connectable#(Get#(a), Put#(a));

One put and another will get the element.

Tuples

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

  • Get Put
  • 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:

  • Client Server
  • 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.


  1. C.7.2 Bluespec Reference Guide. 2017. ↩
Created May 5, 2020 // Last Updated May 6, 2020

If you could revise
the fundmental principles of
computer system design
to improve security...

... what would you change?