summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-16systemc: Fix a typo in one of the error messages.Gabe Black
This typo was added purposefully to match Accellera's output, but then it was discovered that some test's golden output had the typo, and some didn't. That must mean that not all tests have up to date output, and that Accellera couldn't possibly pass all of their own tests. To resolve this conflict, this change fixes the typo and manually updates all the golden output. Change-Id: I3d80f74ff21e844609e7bde5dfcd99fc56c085b0 Reviewed-on: https://gem5-review.googlesource.com/c/13204 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: 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: 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: 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: 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: Implement sc_vector.Gabe Black
Change-Id: I3cf096c4432fdf310fa1279da32620d5c9f57b5d Reviewed-on: https://gem5-review.googlesource.com/c/13197 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: 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: Centralize how object parents are chosen.Gabe Black
There's a lot of repeated code for this. Also, the sc_vector type needs to be able to artificially inject a parent for the objects it creates. Change-Id: I76f9b551632cd2cd70e26741b215290b35c382e9 Reviewed-on: https://gem5-review.googlesource.com/c/13194 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Use c++11 partial functions instead of boosts.Gabe Black
This creates a depenendency on c++11 which the headers otherwise avoid, but gem5 itself already has a c++11 dependency and not a boost dependency, and outside of having a local copy of boost (which Accellera does) there isn't a good way to put the placeholder values _1, _2, etc., into the custom sc_unnammed namespace. Change-Id: I52ca4c1bc52bef6ff2c62e9f3c32af46f95244dc Reviewed-on: https://gem5-review.googlesource.com/c/13193 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Filter out a test which breaks rules gem5 won't let it break.Gabe Black
Change-Id: Ifbc27a3134730a95ecdb79c588c4d7fe6e889046 Reviewed-on: https://gem5-review.googlesource.com/c/13192 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add a non-standard sc_time constructor and from_string.Gabe Black
The sc_time constructor was being called, but because of implicit type conversions, a const char * was being treated as a bool and totally unrelated constructor was being called. This change adds and implements the missing but non-standard constructor. It also implements the from_string function which uses that constructor. Change-Id: I21e7e40fd1a8d1c579b1abdc2036d016501f510c Reviewed-on: https://gem5-review.googlesource.com/c/13191 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 the sc_time_tuple class.Gabe Black
This class is non-standard and is an implementation detail in Accellera's implementation, but is referred to directly by the tests. It does the same thing as the time printing function, so rather than having duplicate code the printing function now uses the sc_time_tuple class even though it was doing fine on its own already. Change-Id: I69594ed0651f212ded6d979d60523bb3b0a789b1 Reviewed-on: https://gem5-review.googlesource.com/c/13189 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Merge notify and notifyWork and ignore disabled for resets.Gabe Black
Always notify a process if a reset signal changed, even if it's disabled. Also, because notify was what checked disabled and only notifyWork was virtual, this change merges the two so both can be overridden without any extra virtual functions. Change-Id: I1e3563fa587aab65a5e95cd8a382ed48e093de3b Reviewed-on: https://gem5-review.googlesource.com/c/13188 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Ensure the reset event is notified before reseting the target.Gabe Black
The target may be the process which is currently running. In that case, the reset method will end and never get to notifying the reset event. To fix that, we need to notify the reset event first. Change-Id: If3a9d87edc0999293a68d86d35989ae49eab3c07 Reviewed-on: https://gem5-review.googlesource.com/c/13187 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 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: Remove a hack which scaled sc_time into ps unnecessarily.Gabe Black
sc_time is now represented in whatever the underlying time resolution is which isn't necessarily ps. Stop trying to scale it (incorrectly). Change-Id: I18975e0ab01386b24196666e0ba02d1b36e11735 Reviewed-on: https://gem5-review.googlesource.com/c/12976 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Change how the default timescale is set.Gabe Black
The spec says that the default timescale should be 1 PS, but the Accellera implementation uses the time resolution. Change-Id: I7b307a33ef0856e9c19d81e401b15691275d4978 Reviewed-on: https://gem5-review.googlesource.com/c/12975 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Simplify sc_time_stamp().Gabe Black
sc_time is now inherently based on properly scaled Ticks, so there's no reason to try to scale it to be in picoseconds, especially since the scaling factor may be unreliable if the timescale hasn't been fixed yet. Change-Id: I28baeb9792e81e1d00f6f37672df435766311864 Reviewed-on: https://gem5-review.googlesource.com/c/12974 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Implement sc_get_curr_process_handle().Gabe Black
The implementation is fairly trivial, but the pieces it relies on weren't always available. Change-Id: Ie77168ff336febd3ebe22c400f2b1f133e43aca7 Reviewed-on: https://gem5-review.googlesource.com/c/12973 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Print an Info when setting a tracefile's time unit.Gabe Black
This matches Accellera's output for the tests. Change-Id: Ie67fd673a980b8ca2fdcd8f357ff7993a9091221 Reviewed-on: https://gem5-review.googlesource.com/c/12972 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Move some constants out of sc_time.cc for other files to use.Gabe Black
Change-Id: Ic88c6834dfe980022e58a3d859ea53193a55bbb1 Reviewed-on: https://gem5-review.googlesource.com/c/12971 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add a warning to sc_interface::default_event.Gabe Black
The default implementation returns a dummy event, but in the Accellera implementation it also prints a warning. Print a warning as well, so that the output matches for the tests. Change-Id: I1ae2755685515c3fe538f4075af396e963cf155d Reviewed-on: https://gem5-review.googlesource.com/c/12970 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Filter out an Info about delta cycles and pseudo timesteps.Gabe Black
In the Accellera implementation, every time a delta cycle is traced a check is done to see if the user has been told what the pseudo timestep is. To avoid doing that check over and over, we'll leave that out and tell the verify.py to ignore that message in the reference output. Change-Id: I825f05394dccf03e951d29561a11c3cc6d4bcda7 Reviewed-on: https://gem5-review.googlesource.com/c/12969 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Check the process type when using sc_join.Gabe Black
Method processes aren't allowed in an sc_join. Change-Id: I5c8421a396dbe261645a074df514f69fc652c9c8 Reviewed-on: https://gem5-review.googlesource.com/c/12968 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Make sure the right type process is running when calling wait.Gabe Black
That function is only allowed when running a thread or cthread. Change-Id: Idf98b70018169d4f724aa8168f3c4e8161f0b83d Reviewed-on: https://gem5-review.googlesource.com/c/12967 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add an error check to sc_time.Gabe Black
Change-Id: Ie525a1624a6496a51277fb984cbfeec21eb79749 Reviewed-on: https://gem5-review.googlesource.com/c/12966 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add some error checks to sc_export.Gabe Black
Change-Id: Ib0c14a5c7dad37b33d61c9b406f6b84121d94e46 Reviewed-on: https://gem5-review.googlesource.com/c/12965 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-16systemc: Fix the implementation of sc_event::triggered.Gabe Black
This function just returned false. The new implementation uses the scheduler's changeStamp function to keep track of how recently the event was triggered so it can return return the right value. Change-Id: Idf61cd459e53e224a33d3e53c16210f5e0a99a3a Reviewed-on: https://gem5-review.googlesource.com/c/12825 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Teach verify.py how to verify vcd files.Gabe Black
The reference output skips the first 7 lines which have volatile info like the current time. Change-Id: I9c173ff3903982a07349ca6957ab25e07bdf8e54 Reviewed-on: https://gem5-review.googlesource.com/c/12824 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Fix the default width values for the various sc_trace-s.Gabe Black
These were all set to 8 * sizeof(char) instead of using the size of the actual data type being traced. Also add a very simple implementation to the generic sc_signal_in_if<T> sc_trace which just delegates to the sc_trace of the underlying type T. Change-Id: I129df46ef9d49705dc3dac76e30c0a3652c981eb Reviewed-on: https://gem5-review.googlesource.com/c/12818 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Fix a typo in verify.py.Gabe Black
In the generic (non-console output) output checker, a variable should have been called self.test, but was called self.text. Change-Id: I2518d6ff01c51fc195eef2b61e987d1b3104c89b Reviewed-on: https://gem5-review.googlesource.com/c/12817 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-16systemc: Add some additional error checks.Gabe Black
Change-Id: I19c5e6f1795c2777dbe7d210cfa01f6ced2020f3 Reviewed-on: https://gem5-review.googlesource.com/c/12815 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-13mem-cache: Add missing includes in TreePLRUDaniel
Add missing includes to TreePLRU files. Change-Id: Ia1e7b2aa91eec8a30b6dccf513cca37a3058b350 Reviewed-on: https://gem5-review.googlesource.com/c/13477 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
2018-10-13mem: Get rid of some stray lines which ended up in packet.hh.Gabe Black
These were left in by mistake when refactoring patches for review. Change-Id: I4c39b5a3e2a2d3957e725a6ffcf48c25b8a69f2e Reviewed-on: https://gem5-review.googlesource.com/c/13495 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-12arch: Explicitly specify the endianness in the generic mem helpers.Gabe Black
This avoids using the accessors which automatically assume an endianness, requiring the memory system to know what the guest ISA is. Change-Id: I863fa4116f00e77b801a2f8ea2fbe34e7f55fd5f Reviewed-on: https://gem5-review.googlesource.com/c/13461 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2018-10-12mips: Use little endian packet accessors.Gabe Black
We know data is little endian, so we can use those accessors explicitly. Change-Id: I6220a543686b1d45d26973391b028dc04ce85dd2 Reviewed-on: https://gem5-review.googlesource.com/c/13460 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-12alpha: Use little endian packet accessors.Gabe Black
We know data is little endian, so we can use those accessors explicitly. Change-Id: Ieb9c1eb8a4fec31ee69cbbfd8c1afdf9f64de366 Reviewed-on: https://gem5-review.googlesource.com/c/13459 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-12sparc: Use big endian packet accessors.Gabe Black
We know data is big endian, so we can use those accessors explicitly. Change-Id: I06fe35254433b20db05f5f10d0ca29a44d47c301 Reviewed-on: https://gem5-review.googlesource.com/c/13458 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-12arm: Use little endian packet accessors.Gabe Black
We know data is little endian, so we can use those accessors explicitly. Change-Id: Iee337109fcda134e1ac5a700e5141fd7060f9c45 Reviewed-on: https://gem5-review.googlesource.com/c/13457 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2018-10-12x86: Use little endian packet accessors.Gabe Black
We know data is little endian, so we can use those accessors explicitly. Change-Id: I09aa7f1e525ad1346e932ce4a772b64bf59dc350 Reviewed-on: https://gem5-review.googlesource.com/c/13456 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>