misc: Merge branch 'release-staging-v20.0.0.0' into develop
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from __future__ import print_function
|
||||
from math import ceil
|
||||
import six
|
||||
if six.PY3:
|
||||
long = int
|
||||
@@ -73,7 +74,7 @@ def fromSeconds(value):
|
||||
# convert the value from time to ticks
|
||||
value *= _m5.core.getClockFrequency()
|
||||
|
||||
int_value = int(round(value))
|
||||
int_value = int(ceil(value))
|
||||
err = (value - int_value) / value
|
||||
if err > frequency_tolerance:
|
||||
warn("rounding error > tolerance\n %f rounded to %d", value,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2016 ARM Limited
|
||||
# Copyright (c) 2016, 2020 ARM Limited
|
||||
# All rights reserved.
|
||||
#
|
||||
# The license below extends only to copyright in the software and shall
|
||||
@@ -177,9 +177,16 @@ def printList(items, indent=4):
|
||||
line += item
|
||||
print(line)
|
||||
|
||||
def readCommand(cmd, **kwargs):
|
||||
"""run the command cmd, read the results and return them
|
||||
this is sorta like `cmd` in shell"""
|
||||
def readCommandWithReturn(cmd, **kwargs):
|
||||
"""
|
||||
run the command cmd, read the results and return them
|
||||
this is sorta like `cmd` in shell
|
||||
|
||||
:param cmd: command to run with Popen
|
||||
:type cmd: string, list
|
||||
:returns: pair consisting on Popen retcode and the command stdout
|
||||
:rtype: (int, string)
|
||||
"""
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
|
||||
if isinstance(cmd, str):
|
||||
@@ -196,10 +203,23 @@ def readCommand(cmd, **kwargs):
|
||||
subp = Popen(cmd, **kwargs)
|
||||
except Exception as e:
|
||||
if no_exception:
|
||||
return exception
|
||||
return -1, exception
|
||||
raise
|
||||
|
||||
return subp.communicate()[0].decode('utf-8')
|
||||
output = subp.communicate()[0].decode('utf-8')
|
||||
return subp.returncode, output
|
||||
|
||||
def readCommand(cmd, **kwargs):
|
||||
"""
|
||||
run the command cmd, read the results and return them
|
||||
this is sorta like `cmd` in shell
|
||||
|
||||
:param cmd: command to run with Popen
|
||||
:type cmd: string, list
|
||||
:returns: command stdout
|
||||
:rtype: string
|
||||
"""
|
||||
return readCommandWithReturn(cmd, **kwargs)[1]
|
||||
|
||||
def makeDir(path):
|
||||
"""Make a directory if it doesn't exist. If the path does exist,
|
||||
|
||||
@@ -267,7 +267,7 @@ def dot_gen_colour(simNode, isPort = False):
|
||||
return dot_rgb_to_html(r, g, b)
|
||||
|
||||
def dot_rgb_to_html(r, g, b):
|
||||
return "#%.2x%.2x%.2x" % (r, g, b)
|
||||
return "#%.2x%.2x%.2x" % (int(r), int(g), int(b))
|
||||
|
||||
# We need to create all of the clock domains. We abuse the alpha channel to get
|
||||
# the correct domain colouring.
|
||||
|
||||
Reference in New Issue
Block a user