summaryrefslogtreecommitdiff
path: root/src/systemc/core/port.hh
AgeCommit message (Collapse)Author
2018-10-16systemc: Remove a redundant error check.Gabe Black
If the check doesn't abort the port binding in progress, it will be reported twice. Change-Id: I691ebd0f1598193f861c6085341dcd2fb05dd210 Reviewed-on: https://gem5-review.googlesource.com/c/13327 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Fix how the maximum size is computed for sc_ports.Gabe Black
Change-Id: I073eb16cbeb892f24ac3860daca056ed2fb09086 Reviewed-on: https://gem5-review.googlesource.com/c/13325 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: Add an sc_gem5::Port destructor.Gabe Black
This destructor just removes the port from the list of all ports. Change-Id: I809b529540c2946d20aeb8d64467d77dc94a7a96 Reviewed-on: https://gem5-review.googlesource.com/c/13288 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add missing sc_interface::register_port, and add calls to it.Gabe Black
This function is standard and supposed to be on sc_interface, but it was somehow left out. This change adds it, and makes sure it's called by the port binding code. The default implementation does nothing, as it's supposed to according to the spec. Also note that only the ports farthest from the interfaces are suppose to call register_port. As the port bindings are completed, we keep track of whether a port has been bound to another port. If it has, the source port is farther from the interfaces than the target port (since it has to go "through" the target port to get to them, and so the target port should not call register_port. Change-Id: Ia98f9ff364385fd1699d88a1d99787d205816a08 Reviewed-on: https://gem5-review.googlesource.com/c/13199 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Change how the timing of binding ports works.Gabe Black
In the Accellera implementation, interfaces are bound to ports immediately if no ports have been bound, and otherwise saves them for later along with the ports. The existing implementation would save all interface and port bindings to finalize at the end of elaboration. This seems like pointless complexity, but it's necessary to get the output to match in the tests. Change-Id: Ib82d324ee2be9e56e6a41561611c7fca4f4f4e72 Reviewed-on: https://gem5-review.googlesource.com/c/13196 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: Add an error check whether an interface is alread bound to a port.Gabe Black
Change-Id: I06e3484176c0c06daa28f7be0ed8437b3b15ddb2 Reviewed-on: https://gem5-review.googlesource.com/c/12816 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>