X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Fscd_rem_chan_if.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Fscd_rem_chan_if.h;h=e478cc660f041daf0518b8e7ac7588d78af9ea28;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/scd_rem_chan_if.h b/dol/src/dol/visitor/hdsd/scd/scd_rem_chan_if.h new file mode 100644 index 0000000..e478cc6 --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/scd_rem_chan_if.h @@ -0,0 +1,67 @@ +#ifndef SCD_REM_CHAN_IF_H +#define SCD_REM_CHAN_IF_H + +#include + + +/** + * Interface for SystemC channels with remote input. + */ +class scd_rem_chan_in_if +{ +public: + + /** + * Indicates how many bytes can be received by this channel. + */ + virtual size_t free() const = 0; + + /** + * Receive bytes, convert to internal data structures and generate + * notifications if necessary. + * + * \param buf pointer to buffer to read data from + * \param len number of bytes to receive (not larger than free()) + */ + virtual void receive(const void* buf, size_t len) = 0; + + /** + * Virtual deconstructor + */ + virtual ~scd_rem_chan_in_if() {} +}; + + +/** + * Interface for SystemC channels with remote output. + */ +class scd_rem_chan_out_if +{ +public: + + /** + * Inidcates how many bytes are available to be sent from this channel. + */ + virtual size_t available() const = 0; + + /** + * Get the available data to be sent. Does not guarantee that it is + * actually sent. At most available() bytes are sent. + */ + virtual const void* send() const = 0; + + /** + * Remove bytes from channel that have been successully sent. + * + * \param len number of bytes that have been sent (not larger than + * available()) + */ + virtual void remove(size_t len) = 0; + + /** + * Virtual deconstructor + */ + virtual ~scd_rem_chan_out_if() {} +}; + +#endif