python: Change m5's tick mechanism of rounding non intergral ticks
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Fri, 22 May 2020 00:41:29 +0000 (17:41 -0700)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Fri, 22 May 2020 09:15:59 +0000 (09:15 +0000)
commit7aa1395877534e4244b00d65776efa1bde59aeb0
tree75aca900ab11dc74584df2e999628bd38f7e7c86
parentebf5755cce7103b0cc9b03b023cd5c6aed379b75
python: Change m5's tick mechanism of rounding non intergral ticks

This commit changes m5's tick rounding mechanism from python's round()
to python's ceil() function.

Currently, non intergral ticks are rounded by round() function in python.
In python2, this function rounds values >= 0.5 to 1. However, in python3,
0.5 is rounded to 0. This causes the function to return 0 ticks for
non-zero second values, which doesn't make sense, and also causes
several tests to fail.

ceil() function is now used to round up the tick values. This makes more
sense as non-zero second values won't be rounded to zero in any cases.

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I14c43e38e8c678f77baf13407f7eeff4b86f1014
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29372
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/m5/ticks.py