summaryrefslogtreecommitdiff
path: root/src/systemc/ext/channel
AgeCommit message (Collapse)Author
2018-12-19systemc: Allow specific functions to shadow the base class methodNikos Nikoleris
sc_in::bind and sc_core::sc_object::print shadow their respective base class method. This change adds the necessary declarations to inform the compiler that this is intentional. Change-Id: I8c6bc0f05aa568630783db63d52be90f4ea4748c Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15135 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-12-18systemc: Ensure resets and edges are notified when signaling a change.Gabe Black
Boolean sc_buffers (either pure bool or sc_dt::sc_logic) should signal positive and negative edges and resets even when their value doesn't change, unlike sc_signals. The spec doesn't actually say that and just mentions the value changed event, but it may have been implied that the other types of events also happen, they just made special mention of the value change event. This change moves some code around a bit so that when _signalChange() is called, if the underlying type is a boolean signal, it will automatically notify the appropriate edge event and signal any reset. Putting the functionality in _signalChange instead of delegating it to the sc_buffer lets us have a single template for sc_buffer and makes the base class template specialization handle whether the edge events exist, and if so which should be notified. Change-Id: Ic4ca86afc3fde6a9df5c15a0a7386e24ac89a9e2 Reviewed-on: https://gem5-review.googlesource.com/c/14916 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-09systemc: Get rid of a duplicated base class initializer for sc_fifo.Gabe Black
These were consistent, but redundant and incorrect none the less. Change-Id: I9ff7fdb9c83f9a8af6fbe969c6c73b9aab8967ad Reviewed-on: https://gem5-review.googlesource.com/c/14136 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-05systemc: Explicitly keep the sc_port bind alongside sc_in's version.Gabe Black
The sc_in bind function was hiding the one from sc_port by changing the const-ness of its parameter. This change explicitly exposes the underlying sc_port version, and keeps it alongside the new sc_in version. This seems mildly dangerous and undesirable because now there are two very similar functions which would both need to be overridden in order to get new behavior, but I don't think it's any more dangerous and undesirable than as (perhaps unintentionally) specified in the standard. Change-Id: Ib42a1f8e70bc97abeeeb8d614e71c4019b3a2323 Reviewed-on: https://gem5-review.googlesource.com/c/13880 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Don't include the scheduler in an external header file.Gabe Black
The scheduler is an internal detail and shouldn't be exposed to the headers in ext. It would transitively include more headers which are not in ext, making it not self contained. Change-Id: I8384cde9d19363953ffd0c91e7d8d27f8f79a570 Reviewed-on: https://gem5-review.googlesource.com/c/13336 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Fix accounting in the sc_fifo class.Gabe Black
Reads shouldn't free up space until an update happens. Change-Id: I18e1601c27b44643f103c86f04b1fa2c23baf1e8 Reviewed-on: https://gem5-review.googlesource.com/c/13333 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Switch to using predefined messages for channels.Gabe Black
Create and use predefined messages for channels which match the ones Accellera uses. Change-Id: I179214838bbd83604e50225926cdc6b5b1b16923 Reviewed-on: https://gem5-review.googlesource.com/c/13330 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Distinguish internal events from normal sc_events.Gabe Black
The internal events aren't supposed to show up in the namespace or as children of objects. Change-Id: Id04b9bfe2e1f8f216390dd989797558eaf33d715 Reviewed-on: https://gem5-review.googlesource.com/c/13309 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Change how signal based resets work.Gabe Black
The previous implementation used the value changed event to track when signals changed value, but there were a couple problems with this approach. First, this piggybacked on the sensitivity mechanism in some ways, but diverged in others. The sensitivity didn't notify a process when it was satisfied like other sensitivity types would, and it also ignored whether the process was disabled. Second, the value_changed_event is notified by a signal instance as a delta notification, but reset signals are supposed to act immediately. That means they should happen before all delta notifications, or in other words all delta notifications should see the reset status of a given process. That's particularly important in the case of wait(int n) where setting the reset clears the reset count, and the count is checked when determining whether or not to wake up a process when its sensitivity is satisfied, potentially by a delta notification. Third, by removing the middle man and not trying to repurpose the sensitivity mechanism, the code gets simpler and easier to understand. Change-Id: I0d05d11437291d368b060f6a45a207813615f113 Reviewed-on: https://gem5-review.googlesource.com/c/13294 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement writer policies.Gabe Black
This includes the nonstandard SC_NO_WRITE_CHECK #define which the Accellera tests use and depend on. Change-Id: I106c4c16160325725a00d5c337047251817dca32 Reviewed-on: https://gem5-review.googlesource.com/c/13203 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Don't use write() in sc_clock to set the clock value.Gabe Black
The two different processes we have to use to match Accellera behavior would trip the checks in write. Change-Id: Iee729b239bccd8f7b854894000c9ef2c47600563 Reviewed-on: https://gem5-review.googlesource.com/c/13202 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement register_port in all the predefined channels.Gabe Black
Something the Accellera implementation does which would be good to do in the gem5 implementation is to create a base class for sc_signal which isn't templated, and which holds the common/non-type specific versions of the various sc_signal methods. This will reduce code redundancy and binary size, and also let us hide more code in .cc files so that it's less likely we'd need to recompile model code to fix a bug. Also, since this all uses of sc_channel_warn_unimple have now been eliminated, remove that function. Change-Id: Ia574647c034e7136093c2047b69de725ac34f52f Reviewed-on: https://gem5-review.googlesource.com/c/13200 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Remove some old warn includes from ext/channel.Gabe Black
The calls to sc_channel_warn_unimpl have been removed, so the includes aren't needed. Change-Id: I58a916a7c4ef9a266be591789696457799b6b8dd Reviewed-on: https://gem5-review.googlesource.com/c/13198 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Use the stage of simulation and not port size in add_trace.Gabe Black
The assumption was that a port wouldn't have any interfaces until after elaboration, and that if it would be traced, it would have interfaces. Checking if the simulation has started (and hence elaboration has finished) is a more accurate and direct way to check the same thing. Change-Id: I7fe9ecea469997d1a257dd3e4a0db31889aff722 Reviewed-on: https://gem5-review.googlesource.com/c/13195 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement sc_event_queue.Gabe Black
Change-Id: I58fd72b8c64ee82eb478d810f7114bab7a31cbfa Reviewed-on: https://gem5-review.googlesource.com/c/13184 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement general and VCD trace support.Gabe Black
This doesn't include WIF trace support, but does make allowances for adding it in the future. Change-Id: Ifb62f40a7d8a13e94463930a44ac4b1cf41e3009 Reviewed-on: https://gem5-review.googlesource.com/c/12826 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Change an error message to match the reference outputs.Gabe Black
This is different from the message the Accellera implementation would print, so it looks like it wouldn't pass this test as is. Change-Id: I0286fd3e3df7bc3e87f38c35086a32d8dec0bcc9 Reviewed-on: https://gem5-review.googlesource.com/c/12814 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Implement the sc_signal_rv channel and ports.Gabe Black
Change-Id: Id1a3fd2ded224bbe94a4a65e0acf34a3547aedcc Reviewed-on: https://gem5-review.googlesource.com/c/12813 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Implement sc_buffer.Gabe Black
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>
2018-10-09systemc: Implement the sc_*_resolved classes.Gabe Black
Change-Id: Ib595da10e0f900ee4cc1847d41d29251dacb55d7 Reviewed-on: https://gem5-review.googlesource.com/c/12620 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Implement sc_mutex.Gabe Black
Change-Id: I8a5bd03b46d44aeca3bba15a01a5f2180b4ed5c7 Reviewed-on: https://gem5-review.googlesource.com/c/12618 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Implement sc_semaphore.Gabe Black
Change-Id: I778d41bd81880e76caa71dc92359a00127d8f987 Reviewed-on: https://gem5-review.googlesource.com/c/12617 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Implement sc_fifo::dump and improve sc_fifo::print.Gabe Black
The print function is supposed to print both pending and committed writes, apparently. Accellera's implementation of sc_fifo uses a ring buffer to store the entries and manages a head and tail pointer to keep track of what's full, etc. Their dump function prints that whole buffer using the indexes. When not using a ring buffer, there's no easy way to determine what those indexes should be. Fortunately the test that uses dump never moves away from the base of the ring buffer, so I can get the same effect (which also makes sense on its own) by printing the index into the fifo instead. Change-Id: I50fe049461f6a5e8a55b54eeb2f134d20f0812c6 Reviewed-on: https://gem5-review.googlesource.com/c/12455 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Implement the << operator for sc_signal.Gabe Black
Change-Id: I16955e58d96d49ec3bba90b73f5a368a245da438 Reviewed-on: https://gem5-review.googlesource.com/c/12454 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Implement the "event()" style sc_signal methods.Gabe Black
Change-Id: Ia829aef2292ff2d50e14433d5c36a2e15a9de54b Reviewed-on: https://gem5-review.googlesource.com/c/12453 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Implement most of sc_fifo and its interfaces.Gabe Black
There are still some bugs since the output of the tests don't all match, but more tests pass and fewer abort. Change-Id: I37f84d65c4a8a43357c98282096e39b9401fc1dd Reviewed-on: https://gem5-review.googlesource.com/c/12275 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Implement most of sc_inout.Gabe Black
Because sc_inout needs sc_dt::sc_logic and that probably calls functions from dt_sc_mempool.cc and because those hadn't yet been stubbed out. This change adds stubs for those as well. Change-Id: I544a1669575b594d4612558b8b6f47668ac94414 Reviewed-on: https://gem5-review.googlesource.com/12221 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Make sc_out delegate to its base class sc_inout.Gabe Black
The spec says these are essentially identical classes, they just have both so that users can show their intent. Change-Id: I51908edca89acea25891a52bfa7fca0681ccfc5c Reviewed-on: https://gem5-review.googlesource.com/12220 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Implement a significant portion of sc_clock.Gabe Black
Change-Id: Ic195f46ac13b46a02c86a5fc8d90ba66a415a9c8 Reviewed-on: https://gem5-review.googlesource.com/12215 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Implement the sc_in class.Gabe Black
Change-Id: I08174462cb650c7918a4e8f5284d4ee814cf595d Reviewed-on: https://gem5-review.googlesource.com/12085 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Partially implement the sc_signal class template.Gabe Black
There are a few details of this class that still need to be fleshed out, but this implements most of it. Change-Id: I6f8b546aacd8537d4341dc91e59b95864ae0f7c4 Reviewed-on: https://gem5-review.googlesource.com/12075 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Add m_cur_val and m_new_val to sc_signal.Gabe Black
These members are referred to in one of the tests. Change-Id: Iab0110a0e3acf627986664069622704f17b703a1 Reviewed-on: https://gem5-review.googlesource.com/11355 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add the nonstandard sc_trace_params and sc_trace_params_vec.Gabe Black
These two types are supposedly only for internal use in the Accellera implementation based on a big warning in all caps, but they still appear in the tests and examples in that version of systemc. Change-Id: Icfb3ffdf1e78988def5dac145172bf28f93d7d38 Reviewed-on: https://gem5-review.googlesource.com/11283 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add the nonstandard time_stamp function.Gabe Black
Change-Id: I608c390b125611e5b62483c7e8567bb5479df553 Reviewed-on: https://gem5-review.googlesource.com/11281 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add a nonstandard sc_signal constructor.Gabe Black
This constructor takes an initial value to set the sc_signal to, and is used in the tests. Change-Id: I197218846d9a79f9237238c78b1bbd8a7f55443f Reviewed-on: https://gem5-review.googlesource.com/11266 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Define the nonstandard sc_event_queue_port typedef.Gabe Black
Used in the tests. Change-Id: Ic4b4a313b2bd02e5cb3ec07c4f7ee79219728881 Reviewed-on: https://gem5-review.googlesource.com/11262 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Add some deprecated features to sc_clock.*.Gabe Black
Add in two deprecated typedefs, and a deprecated constructor. These are necessary to get the regressions to build. Change-Id: Id8320a67c680acbca0abaee9898158ffd2678d67 Reviewed-on: https://gem5-review.googlesource.com/11183 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Add in the deprecated binding port constructors.Gabe Black
These are needed by... you guessed it, the regression tests. Change-Id: Id30e71944cc7f3faca7dcb197f37938368364fcd Reviewed-on: https://gem5-review.googlesource.com/10958 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Add a non-standard default writer policy on sc_buffer.Gabe Black
The standard says there's not supposed to be a default writer policy for the sc_buffer template class, but in the Accellera implementation there is, and the regression tests depend on it to compile. Change-Id: I31d17617441224e86c56c54e45364be8f4f45b00 Reviewed-on: https://gem5-review.googlesource.com/10957 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Add the deprecated sc_signal_out_if typedef.Gabe Black
This is needed by the regression tests. Change-Id: I5666cf9ad445869e74edda857afd59ab7ece4f4c Reviewed-on: https://gem5-review.googlesource.com/10955 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-08Systemc: Port over all of the systemc "datatype" headers.Gabe Black
These are the headers originally written by Accellera with a few modifications. Most significantly, I went through and mostly (but not entirely) manually editted them to conform to gem5 style and to be more self consistent. Second, I resolved some macros which optionally select features. I removed support for deprecated functions, and otherwise enabled everything. The actual implementation behind these headers will also be ported over, but in a subsequent change. Change-Id: I203d3f6c8a3af9120b946001d01defbb0643a6b6 Reviewed-on: https://gem5-review.googlesource.com/10843 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-07-24systemc: Stub out the predefined channels.Gabe Black
Change-Id: Ie030aad26875bd49e54981ec1e9076b7b5af6630 Reviewed-on: https://gem5-review.googlesource.com/10839 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>