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.
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:
module mkMyFifoUpstream (Get#(int));
...
method ActionValue#(int) get();
f.deq;
return f.first;
endmethod
...
You can give (put) data to an object.
method: put(a_type a)
give an item of type a_type
to an interface.
interface Put#(type element_type);
method Action put(element_type x1);
endinterface: Put
Example:
module mkMyFifoDownstream (Put#(int));
...
method Action put(int x);
F.enq(x);
endmethod
...
Two typeclasses: ToGet and ToPut, used to create associated Get and Put interfaces from other types.
Like a Get interface, but separates the get method into two methods: a first
and a deq
.
Todo.
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?