summaryrefslogtreecommitdiff
path: root/src/systemc/ext/core/sc_port.hh
AgeCommit message (Collapse)Author
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-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: Refactor sensitivities.Gabe Black
Dynamic and Static sensitivities used to be represented by the same classes, even though they're (almost) disjoint in how they worked. Also timeouts, which can be used alongside dynamic sensitivities, were handled by the sensitivities themselves. That meant that the sensitivity mechanism had to mix in more types of behaviors, increasing complexity. Also, the non-standard timed_out function Accellera includes is harder to implement if the path for timeouts and regular sensitivities are mixed together. This change splits up dynamic and static sensitivities and splits out timeouts. It also immitates the ordering Accellera uses when going through sensitivities for an event. Static sensitivities are triggered first in reverse order (why?), and then dynamic sensitivities are triggered in what amounts to reverse order. To delete a sensitivity which has been handled, it's swapped with the one in the last position, and then the vector is truncated to drop it at the end. This has the net effect of stirring the dynamic sensitivities, and isn't easily immitated using a different approach, even if other approaches would be more straightforward. Double check addSensitivity for event.hh Change-Id: I1e73dce386b95f68e9d6737deb8bed70ef717e0d Reviewed-on: https://gem5-review.googlesource.com/c/12805 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Add a "kind()" overload to sc_port_base.Gabe Black
This is "implementation defined" but needs to exist to match the golden reference output from Accellera. Change-Id: I9b7949343b7c62a8d568abc06ab4dfc88233b20a Reviewed-on: https://gem5-review.googlesource.com/c/12621 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: When sensitive to an event finder, find on all interfaces.Gabe Black
When a process is sensitive to an event finder and that finder is attached to a port which is bound to multiple interfaces, the process is supposed to be made sensitive to the event finder function's result when called on each interface, not just the first one. Change-Id: I92312e04e60fab7a7ea51c1ed687edabe9768205 Reviewed-on: https://gem5-review.googlesource.com/c/12444 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: Implement positional binding.Gabe Black
Change-Id: Ifbcd7e4148b82b9bf5241e040e812925daea3705 Reviewed-on: https://gem5-review.googlesource.com/12263 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: Use sc_assert to check the number of interfaces.Gabe Black
The sc_port code had been using the .at() function of the vector class, but when that failed it threw an exception, and it was very difficult to tell where the exception came from from how gem5 crashed. This change switches to sc_assert (the systemc version of assert) which makes the cause/location of failures much more obvious. Change-Id: I1cd51c86f47b314be551c304b014c44cfa030175 Reviewed-on: https://gem5-review.googlesource.com/12262 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Track exports and prim channels, and call their callbacks.Gabe Black
Also call the callbacks on the ports which were already being tracked. Change-Id: I5ba8ea366e87fc48b58712f35b93c27bccf92cb3 Reviewed-on: https://gem5-review.googlesource.com/12210 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Implement port binding except positional binding.Gabe Black
This change adds code which keeps track of ports and interfaces which are being bound to be finalized later, and the actual port binding of interfaces and recursive binding port ports. Change-Id: Ifa885ed44b667254762cc101580be4f0a7d7a131 Reviewed-on: https://gem5-review.googlesource.com/12084 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Fix the seed used with sc_gen_unique_name for sc_port.Gabe Black
The seed should only be "port" not "sc_port". Change-Id: Ia046103abc0a9ed283fcb7cf7d8069383a1e2b0d Reviewed-on: https://gem5-review.googlesource.com/12067 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: Add the "implementation defined" vport function.Gabe Black
This function is in an "implementation defined" class body in the spec, and has a comment next to it which says "(for internal use only)" next to it, but it is still used directly in one of the tests. Change-Id: Ib3727c93cc531ddd31a24897291dc7e7c97c2b58 Reviewed-on: https://gem5-review.googlesource.com/11354 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add bind() to sc_port_base.Gabe Black
sc_port_base is supposed to be implementation defined, but internal details of it are relied on by the systemc tests. Change-Id: I53d84e708a5543a2cf4bd0deffc2efea1c008d97 Reviewed-on: https://gem5-review.googlesource.com/11350 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-07-24systemc: Flesh out the sc_port implementation slightly.Gabe Black
This makes other files compile because it changes the relationship between constructors,etc., slightly. Change-Id: I8d9a6e12ec640a82da166fe05c4f5e91f3f608de Reviewed-on: https://gem5-review.googlesource.com/10840 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-07-24systemc: Seperate the "external" header interface.Gabe Black
Most (but not all) of the SystemC headers are part of the "external" interface that an existing, standard compliant module would include through <systemc.h> or <systemc>. Since those follow slightly different rules (relative includes, no gem5 includes), this change separates them out so that they're easier to identify. Also, this change moves the other files into a "core" subdirectory, with the intention to add a "dt", aka data type, directory some time in the future when those standard defined types are implemented. Change-Id: Ida63f9cc0bc0431024d4dd691cc5b22b944a99a8 Reviewed-on: https://gem5-review.googlesource.com/10835 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>