diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-11 21:46:12 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-09 21:49:08 +0000 |
commit | 8817e547e524cd81b5176cf277ef611920b0815a (patch) | |
tree | f850f6df16e62ca6ae3d9dc585d2075eb799d4f0 /src/systemc/ext/channel/sc_buffer.hh | |
parent | 402377f41eb8b52de88d2231fff4d79f59a23e16 (diff) | |
download | gem5-8817e547e524cd81b5176cf277ef611920b0815a.tar.xz |
systemc: Implement sc_buffer.
This required a small change to sc_signal so that the value change
event and the change stamp for it were accessible.
Change-Id: Ife0545d84f3b25e98da079786c30ffa51025cce7
Reviewed-on: https://gem5-review.googlesource.com/c/12804
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/channel/sc_buffer.hh')
-rw-r--r-- | src/systemc/ext/channel/sc_buffer.hh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/systemc/ext/channel/sc_buffer.hh b/src/systemc/ext/channel/sc_buffer.hh index 22081605e..21dc52be0 100644 --- a/src/systemc/ext/channel/sc_buffer.hh +++ b/src/systemc/ext/channel/sc_buffer.hh @@ -32,7 +32,6 @@ #include "../core/sc_module.hh" // for sc_gen_unique_name #include "sc_signal.hh" -#include "warn_unimpl.hh" // for warn_unimpl namespace sc_core { @@ -49,27 +48,28 @@ class sc_buffer : public sc_signal<T, WRITER_POLICY> {} virtual void - write(const T&) + write(const T &t) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + this->m_new_val = t; + this->request_update(); } sc_buffer<T, WRITER_POLICY> & - operator = (const T &) + operator = (const T &arg) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + write(arg); return *this; } sc_buffer<T, WRITER_POLICY> & - operator = (const sc_signal<T, WRITER_POLICY> &) + operator = (const sc_signal<T, WRITER_POLICY> &arg) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + write(arg.read()); return *this; } sc_buffer<T, WRITER_POLICY> & - operator = (const sc_buffer<T, WRITER_POLICY> &) + operator = (const sc_buffer<T, WRITER_POLICY> &arg) { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + write(arg.read()); return *this; } @@ -79,7 +79,8 @@ class sc_buffer : public sc_signal<T, WRITER_POLICY> virtual void update() { - sc_channel_warn_unimpl(__PRETTY_FUNCTION__); + this->m_cur_val = this->m_new_val; + this->_signalChange(); } private: |