This repository provides a set of utilities to enable bluespec simulators to expose some of their I/O ports to their host systems via unix fifo or sockets (currently only fifos). It also provides some utility functions to enable writing host tools to communicate with simulators. See the examples for more details.
The BlueUnixBridges library provides a set of C and BSV functions. The C
functions are prefixed by the initials of each word in the library name, bub
,
followed by one of fifo
or socket
, and then followed by the actual
function name.
module mkUnixFifoSource #(String pathname) (Source #(t));
module mkUnixFifoSink #(String pathname) (Sink #(t))
fifo_desc_t* bub_fifo_OpenAsProducer (char* pathname, size_t bytesize, encoder_t encoder);
fifo_desc_t* bub_fifo_OpenAsConsumer (char* pathname, size_t bytesize, decoder_t decoder);
fifo_desc_t* bub_fifo_OpenAsProducerConsumer (char* pathname, size_t bytesize, encoder_t encoder, decoder_t decoder);
bool bub_fifo_Consume (fifo_desc_t* desc, void* elemdest);
bool bub_fifo_Produce (fifo_desc_t* desc, void* elemsrc);
void bub_fifo_Close (fifo_desc_t* desc);