I was trying to do some bounds benchmarking to debug a bug (more about that
later), and set the fetchWidth to 12, and all sorts of badness and memory
corruption ensued, leading to a segfault.  The following patch adds a check
that the fetchWidth is set below Impl::MaxWidth, and notifies the user how
to adjust the hard-coded constant if desired, following the lead of
MaxThreads.

 

There are likely other parameters that should be checked, but my knowledge
of GEM5 is too shallow to be able to identify them all at this point.

 

diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh

--- a/src/cpu/o3/fetch_impl.hh

+++ b/src/cpu/o3/fetch_impl.hh

@@ -100,6 +100,11 @@

               "\tincrease MaxThreads in src/cpu/o3/impl.hh\n",

               numThreads, static_cast<int>(Impl::MaxThreads));

+    if (fetchWidth > Impl::MaxWidth)

+       fatal("fetchWidth (%d) is larger than compiled limit (%d),\n"

+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",

+             fetchWidth, static_cast<int>(Impl::MaxWidth));

+

     // Set fetch stage's status to inactive.

     _status = Inactive;

 

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to