summaryrefslogtreecommitdiff
path: root/src/systemc/core/scheduler.cc
AgeCommit message (Collapse)Author
2018-10-16systemc: Switch to using predefined messages for core.Gabe Black
Create and use predefined messages for core which match the ones Accellera uses. Change-Id: I05b1398933f753946d5917f39d0f39c7cb45ed9f Reviewed-on: https://gem5-review.googlesource.com/c/13323 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Refactor reporting to prep for int based messages.Gabe Black
There's a deprecated reporting mechanism based on integer message ids, and the reporting mechanism needs to be refactored a bit to make it easier to support. Some bookkeeping data structures were moved out to somewhere they can be accessed by other code, obviating the non-standard get_handler function. Change-Id: Id427cd79be9ef0f3275fbac39ff047ab672fb3e0 Reviewed-on: https://gem5-review.googlesource.com/c/13318 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: If a process hasn't started, still signal its reset event.Gabe Black
Change-Id: I9c8026cde455070841139d02955f5c083b9e0645 Reviewed-on: https://gem5-review.googlesource.com/c/13314 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Run delta notifications in reverse insertion order.Gabe Black
This is sort of pointless, except that it matches Accellera's behavior. Change-Id: Ia63f2de998157aa68ce36fdc2ba39ca7a80fecbe Reviewed-on: https://gem5-review.googlesource.com/c/13295 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Clear the current process when done with the eval phase.Gabe Black
The current process will still be set sometimes when exiting from the yield loop in the top of runReady in the scheduler. Clear it to ensure that we don't think a process is running when it isn't. Change-Id: Idd44689e10fadf4a3e3ec07c60d107c80a44d39f Reviewed-on: https://gem5-review.googlesource.com/c/13201 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Modify reportifyException to keep sc_reports in scope.Gabe Black
reportifyException was sometimes indirectly creating temporary sc_report objects which would go out of scope when they were returned. The later code which tried to print them would then read garbage. Change-Id: I0a744eb029c62bf2ffee83db0a0e6dcbe3e60f7d Reviewed-on: https://gem5-review.googlesource.com/c/13190 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement signal based resets.Gabe Black
The implementation is based on sc_event sensitivities. Also of note is that the way reset works in the Accellera implementation isn't consistent with the spec. That says that wait(int n) is supposed to be equivalent to calling wait() n times, assuming n is greater than 0. Instead, Accellera stores that count and then doesn't wake up the process until the count is 0, decrementing it otherwise. That means that when the process is in reset, it won't actually reset for those intermediate wait()s which it would if wait() was called repeatedly. Also, oddly, when a reset becomes asserted, it will clear the count to 0 explicitly. That may have been an attempt to make the behavior of wait(int n) match the spec, but it doesn't handle cases where the reset is already set when wait(int n) is called. Change-Id: I92f8e9a128e6618af94dc048ce570a4436e17e4b Reviewed-on: https://gem5-review.googlesource.com/c/13186 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement the synchronous reset state.Gabe Black
Change-Id: Ie0c29bb6cf918aea1c0bc719b9d37628b5b19339 Reviewed-on: https://gem5-review.googlesource.com/c/13185 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: Don't schedule the ready event unnecessarily.Gabe Black
If we're already going to process the thing we'd be scheduling it to process, just let the existing invocation get to it. Change-Id: Ifeebc80903065567fc0eed02beefec6156b22ff7 Reviewed-on: https://gem5-review.googlesource.com/c/12964 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Change how the scheduler orders processes.Gabe Black
The Accellera implementation looks like it does all the methods, then all the threads, and then loops back and tries again, and there are even comments in the code that suggests that. What it actually does, however, is runs all the methods, then runs a single thread if one is waiting, and then starts over. The effect is that the scheduler will run any methods first, then run threads until a method might have become ready, and then repeat. This will actually result in more mixing of threads and methods, more context switches, and worse performance, but it makes the regressions pass more. Change-Id: I7cb0485e26eed79204ff2a3c3ded27b973e0b7b0 Reviewed-on: https://gem5-review.googlesource.com/c/12808 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Rework how delayed sensitivities are handled.Gabe Black
Make BindInfo into a more general purpose Port class which mirrors sc_module and Module, sc_object and Object, etc. This tracks multiple bindings internally, and also pending sensitivities. Keep a global list of ports which are added in reverse order to match Accellera, and which is iterated over to finalize binding and for phase callbacks. This is as opposed to doing it one module at a time, and is to better match Accellera's ordering for the regressions. Also the sensitivity classes are now built with factory functions, which gets around problems calling virtual functions from their constructors or forgetting to having to have extra boilerplate each place they're constructed. The port class also now finalizes port or event finder sensitivities when its binding is completed, unless it's already complete in which case it does so immediately. Change-Id: I1b01689715c425b94e0f68cf0271f5c1565d8c61 Reviewed-on: https://gem5-review.googlesource.com/c/12806 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Add some error checks to some classes.Gabe Black
These check whether those classes are being constructed in legal circumstances, and avoids a null pointer dereference. Change-Id: Ied36ee15c3d7bf6ee444351a841c38576780298e Reviewed-on: https://gem5-review.googlesource.com/c/12622 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Keep all pre-init processes on a single list.Gabe Black
We were keeping track of processes which should be initialized and those which shouldn't on two different lists, and then processing each list one after the other. This could reorder processes from the order they were created, and so cause spurious differences which cause the Accellera tests to fail. This does make the scheduler slightly simpler, so it's not all bad. Change-Id: I63306a41ce7bea91fa9ff2f6774ce9150134ce48 Reviewed-on: https://gem5-review.googlesource.com/c/12613 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Catch exceptions during updates, notifications, and callbacks.Gabe Black
Change-Id: I6005c12ce32d24413618e3955625432985f99f69 Reviewed-on: https://gem5-review.googlesource.com/c/12607 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Track the scheduler status using an enum instead of bools.Gabe Black
The scheduler tracked whether it was paused or stopped with two bools which are mutually exclusive. It's useful to be able to also check for some other mutually exclusive states like what phase the scheduler is currently running. Rather than adding a bunch of additional bools, this change switches those mutually exclusive states over to an enum, and adds some methods to access and maintain that enum. Change-Id: Ia9696b2853d1b122c1100c9df0e12b018fe9b84b Reviewed-on: https://gem5-review.googlesource.com/c/12605 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Fortify how exceptions are caught and passed around.Gabe Black
This change tightens up exception catching and makes gem5's systemc code react to exceptions more in line with the Accellera implementation. This prevents exceptions from being caught by the pybind11 integration which makes it very difficult to see where an exception came from, and makes the output differ by including a (mostly useless) backtrace. Change-Id: I7130d53a98fadd137073d1718f780f32f57c658c Reviewed-on: https://gem5-review.googlesource.com/c/12601 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Warn if a process is dont_initialize with no static sensitivieis.Gabe Black
Change-Id: I4db64f42872a6fb459faa401abdad3f168297347 Reviewed-on: https://gem5-review.googlesource.com/c/12599 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Match how Accellera schedules processes even more closely.Gabe Black
The Accellera implementation runs processes in a cycle where it first runs all the methods it has, then all the threads, and then starts again in case any new methods have been scheduled. This keeps methods and processes in the order they were marked ready (what a prior change made this scheduler do), but also keeps the methods together and the threads together (something it used to do, but that change made it stop doing). This change should make the gem5 scheduler match in both respects. Note that its correct to run the processes in whatever order we want, it's just that if we're going to compare against the "golden" output from the Accellera tests, we need to match the order to get sensible results. Change-Id: I0b1e4ed24c56f97921148b74e90c2dca5fd3fbc4 Reviewed-on: https://gem5-review.googlesource.com/c/12595 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: When stopping immediately, block new processes/updates.Gabe Black
When stopping immediately, we're supposed to finish the current process but not run any other processes or go to the update phase. The rest of the process could introduce new processes or request new updates, so we need to make sure we block those if we're in the process of stopping. Change-Id: I9cc867d294cf171dfedb4b9d43fbc167c2057de8 Reviewed-on: https://gem5-review.googlesource.com/c/12466 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Toggle off clumping methods together in the ready list.Gabe Black
This is totally legal and good for performance, but because some of Accellera's tests depend on processes which can run in any order running in a particular order to reproduce the golden output, it needs to be disabled to pass the tests. This change leaves it as an option which could even be plumbed out in the future to support some sort of "compatibility" mode with the tests. An alternative would be to verify that the tests pass, change the ordering to the alternative (but still correct) order, and then update the reference output. Change-Id: I113a40dec52f8b623253f8a27886b4a0abe89485 Reviewed-on: https://gem5-review.googlesource.com/c/12457 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Store timed notifications in a list instead of a set.Gabe Black
This has three advantages. First, the data structure doesn't have to try to keep track of whether or not an event is already listed there. Second, it's easier to delete an item by storing an iterator for it when it gets inserted. Third, the ordering of events is not dependent on the arbitrary ordering of the set, it's bsaed on the fixed order the events get added to the list. One part of this change makes ScEvent-s keep track of what list they're on, and handle their own insertion and deletion when they're scheduled or descheduled. A side effect of that is that it's no longer safe to simply use a range based for loop to loop over all of an ScEvent and deschedule all its events or to run then (which deschedules them internally once they execute). That can be avoided by looping until the list is empty, and operating on the first element. As the first element is processed and removed from the list, the next element will become first and will get picked up in the next iteration. Change-Id: Icad51a63f153297c88e65f85d22ac721e6c571d8 Reviewed-on: https://gem5-review.googlesource.com/c/12456 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Add a "changeStamp" value to the scheduler.Gabe Black
This value is incremented after each delta cycle's evaluate stage and after timed notifications happen. Its value is used by some channels to determine whether certain events happened within the previous update phase to implement the "event()", "posedge()", and "negedge()" functions. Change-Id: I9a73f0b5007dcbb6a74da9d666f28da1930b9d3d Reviewed-on: https://gem5-review.googlesource.com/c/12452 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Keep track of more cases when we should be ready after resume.Gabe Black
If a thread self suspends, it should be marked as ready after resuming. If a process was already ready when suspended, it should also be remarked as ready after resuming. Special care has to be taken in pre-initialization situations so that processes are put on the right lists, and whether a process is tracked is already marked as ready. Change-Id: I15da7d747db591785358d47781297468c5f9fd09 Reviewed-on: https://gem5-review.googlesource.com/c/12445 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: Fix some issues with starvation checks.Gabe Black
Make sure we check for starvation after timed notifications and at the very end of delta cycles (after delta notifications, not before). Also reverse the order of starvation checks (whether they apply at all, then if they're satisfied) to make those checks faster. Checking a bool is a lot easier than checking if a bunch of other structures are empty. Change-Id: I514ff219909823f1f424fde69856d6b510655188 Reviewed-on: https://gem5-review.googlesource.com/12268 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: When sc_start-ing with zero time, ensure the ready event runs.Gabe Black
The ready event is what notices that we only wanted to run one delta cycle, or no delta cycle if there was nothing to do, and return to sc_main. If the ready event wasn't scheduled, we would advance time before the ready event ran and returned to sc_main which is incorrect. Change-Id: Ic3c10a2f1405f744e8c2bd37aa45846ee6e98e12 Reviewed-on: https://gem5-review.googlesource.com/12267 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: Make sure methods aren't restarted by yield.Gabe Black
Methods may need to yield control to other Processes when throwing them exceptions. In that case, we need to keep track of the fact that the method doesn't need to be restarted when it resumes within yield. Change-Id: I829c387d6ddb563b2957db47e55adadbbe6bc51a Reviewed-on: https://gem5-review.googlesource.com/12265 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: Use the eq pointer directly less often in the scheduler.Gabe Black
This takes advantage of the utility functions that exist a little better, and also avoids accidentally asymetrically using eventsToSchedule and eq->(de)schedule. Change-Id: I1eb1c228d47684cccb9deaf6f3409b77cfbad4cd Reviewed-on: https://gem5-review.googlesource.com/12260 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Clear out the scheduler more agressively and with common code.Gabe Black
It's be useful/necessary to flush pending activity even when not tearing down the scheduler, specifically when stopping. Change-Id: I6b3716a8ca1f8ca151222e08f30bd3c9a43364b9 Reviewed-on: https://gem5-review.googlesource.com/12248 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Make sure no delta cycles are scheduled when stopping.Gabe Black
If the readyEvent is still scheduled when sc_main completes, gem5 will return to it's main fiber and keep executing events, including that one. That means a delta cycle will run even after sc_main is complete. This change ensures that the readyEvent has been descheduled as part of stopping. Change-Id: I9479ac4ebff3335477b371b02efa6d44c70cbc8e Reviewed-on: https://gem5-review.googlesource.com/12224 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Improve scheduler cleanup.Gabe Black
Make the scheduler clear itself out when it's destructed to ensure that nobody will try to use it after it's gone away. Also make sure there are no pending events which might refer to it as well, either systemc events or gem5 events. Change-Id: I12dadc06bd9db7016a8dc0c1827b3e630b0d23d5 Reviewed-on: https://gem5-review.googlesource.com/12222 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Generalize gem5 style event scheduling.Gabe Black
These events are either scheduled directly, or if no event queue is yet available they're recorded in a map to schedule later. Since this was used in a few places (and should have been used for the ready event), this change moves it into some common functions which remove some duplication and abstract away this detail. Change-Id: I4320d7296f4f72344539b2b4b2564a6a27576dd8 Reviewed-on: https://gem5-review.googlesource.com/12219 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Make sure sc_start waits for simulation even when starving.Gabe Black
Even if the simulation would return from sc_start immediately because of starvation, this change ensures that sc_start gives control back to gem5 so that the scheduler will have a chance to set up sensitivities, etc., before things get torn down. Change-Id: I39b1fd704fcbe12c299cad9dbd30258e8fe9d032 Reviewed-on: https://gem5-review.googlesource.com/12218 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Rework the init phase for the new way delta notes are handled.Gabe Black
The initialization phase had been done in a somewhat adhoc way, partially because delta notifications were being handled as top level gem5 events which were ordered based on their priorities. This change makes the initialization phase happen more explicitly, and more in the order in the spec. Change-Id: I91d56b63fefcb81c845c52c97826a976a7559fad Reviewed-on: https://gem5-review.googlesource.com/12217 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Don't run the ready event inline when unpausing.Gabe Black
Now that delta events are handled explicitly by the scheduler, there's no reason to run the readyEvent inline when returning from a pause. The delta events will necessarily be run after the evaluate and update phases. Change-Id: Iad6d431a87742354e3a46a0fb44c309aa785ea60 Reviewed-on: https://gem5-review.googlesource.com/12214 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Rework how delta and timed notifications/timeouts are tracked.Gabe Black
Rather than delegating them entirely to the gem5 event queue and using priorities to ensure the right thing happens, this change adds a few new structures which keep track of them and give the scheduler more control over what happens and in what order. The old scheme was mostly correct, but there were some competing situations which made it next to impossible to make everything happen at the right time. Change-Id: I43f4dd6ddfa488a31073c0318bb41369b1a6117d Reviewed-on: https://gem5-review.googlesource.com/12213 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: When sc_start is told to run zero time, do one delta cycle.Gabe Black
This is a special case which is mentioned in the spec but hadn't yet been given any special handling in this implementation. Change-Id: I500d046f09d916a08e22821f8d3e2f490f8ba5bb Reviewed-on: https://gem5-review.googlesource.com/12212 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Ensure delta notifications happen at the right time after sc_pause.Gabe Black
Normally delta notifications would be created during the evaluation or update phases, and so there isn't any problem with them cutting in front of those stages. When the simulation is paused however, those notifications could be waiting before the ready event starts and could preempt it. This change adds a check for that situation to the end of the pause event and runs the evalution and update stages inline if necessary. Change-Id: I4477b2ae8e7980406df00ba7320ae2a24ae2da9b Reviewed-on: https://gem5-review.googlesource.com/12080 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Don't schedule the update phase if the event queue is null.Gabe Black
That happens when an update is requested before the initialization phase has started. In that case, the update phase will be manually run and no event needs to be scheduled, even if that was possible. Change-Id: I2008e29064d282f82bd1935dbe5b94407aa925b0 Reviewed-on: https://gem5-review.googlesource.com/12078 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Ignore direct requests to mark a process as ready.Gabe Black
That might happen when a process is being marked as ready at the start of simulation. Because the process might not end up on the ready list, displacing it from the init list, excplicitly pop it off the init list as well. Change-Id: Iebf972e3e1baedec17b9b99b4da9dd44cd8e6957 Reviewed-on: https://gem5-review.googlesource.com/12047 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Fill out process handle kill and reset mechanisms.Gabe Black
Some flags were being updated too early, making the functions think what they were about to do had already been done. Also, actually check for and throw the exception installed in a process when it's next supposed to run, and when injecting an exception schedule that other process to run immediately. Change-Id: I0856b69903699b2c66f9dc7f44942bbfe3cfdcc4 Reviewed-on: https://gem5-review.googlesource.com/12046 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Implement the SC_EXIT_ON_STARVATION exit mode.Gabe Black
This mode implies checking whether there's any activity left either before starting a delta cycle, or processing delta or timed notification or timeout. Change-Id: I0780a1f720cf63f3d2907b8dd28685266b52d6b4 Reviewed-on: https://gem5-review.googlesource.com/12038 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Handle event notifications scheduled before sc_start.Gabe Black
After sc_start is called, gem5 has run far enough to have an event queue to schedule the notification events on. Before then, it's still legal to request a timed notification. The scheduler should keep track of those requests, and once an event queue is available it should add them to it. Change-Id: Ie7445b1f2e616f4bd36044a09dbef9e1d12d7350 Reviewed-on: https://gem5-review.googlesource.com/12036 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Implement the various sc_module stage callbacks.Gabe Black
This change also gets rid of the SystemC namespace which was deprecated in favor of sc_gem5. A few utility functions which check whether certain callbacks have finished were also implemented. status tracking moved from a global variable in sc_main.cc to a member of the kernel simobject. Change-Id: I50967fae9c576fbe45b1faff587aaa824857a289 Reviewed-on: https://gem5-review.googlesource.com/12033 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement pending activity related functionsGabe Black
Track the number of notifications/timeouts that are scheduled at any given time. This lets us implement sc_pending_activity_at_current_time, sc_pending_activity_at_future_time, and sc_time_to_pending_activity. Change-Id: Ia3fcd29bdbfe1a6c77eb52ce4836982d4705263c Reviewed-on: https://gem5-review.googlesource.com/12032 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement sc_pause, sc_stop, and re-sc_start-ing.Gabe Black
This change further modifies the scheduler to implement the sc_pause and sc_stop functions, and to ensure that calling sc_start again works. Also, some small changes were made to how processes and contexts are hooked up. Now, rather than checking whether a process is running to determine wether it started on its own or needs to be started manually, there's a bool which explicitly tracks whether it needs this step. The problem was that once a thread finished, it wasn't considered running any more. In that case it had run but finished, but that was indistinguishable from it needing to run but not having been started. Change-Id: I3aefb5493f91d9efa1a1382586196339b67925fe Reviewed-on: https://gem5-review.googlesource.com/12031 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Handle suspended processes and handle sensitivity overload.Gabe Black
This change keeps track of whether a process would have become ready but was suspended so that it can become ready when the process is resumed. Also, this makes a process ignore its static sensitivity while a dynamic sensitivity is in place. Change-Id: If3f6c62f370051e574f81bf227746db8c43527e2 Reviewed-on: https://gem5-review.googlesource.com/11715 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement the sensitivity mechanism.Gabe Black
This change lets processes be sensitive to events, timeouts, etc. Change-Id: If30a256dfa8a2e92192c1f9c96b48e2aa28ec27e Reviewed-on: https://gem5-review.googlesource.com/11713 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement channel updates and rework the scheduler.Gabe Black
This change implements channel updates, and also reworks the scheduler to delegate more to the gem5 event queue by taking advantage of event priorities to ensure things happen in the right order. There's a lengthy comment in scheduler.hh describes how that all works. Change-Id: I5dee71b86b2e612bb720a4429f3a72e4b7c6d01f Reviewed-on: https://gem5-review.googlesource.com/11710 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Partially implement the scheduler.Gabe Black
This change implements the "evaluate" part of the delta cycles, and sketches out a function to run delta cycles and the initialization phase. The kernel object now schedules an event at time zero which runs the initialization phase. Also, some small places which were stubbed out pending a way to check the currently running process have been filled in now that that's being tracked. Change-Id: I6899569eb0195ff1c059fa4e68e90ef162b2f2df Reviewed-on: https://gem5-review.googlesource.com/11709 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>