mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: Remove understand script
This script has been copied over to the core-private directory. Change-Id: Ied64f0d1722d61e207147508d28859b5c693a743 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2131030 Reviewed-by: Nicolas Benech <nbenech@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
c85d4c9e7f
commit
466592e639
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# Python script to parse dependency export CSV from Understand. It detects
|
||||
# these common architectural problems:
|
||||
# * Common code depends on hardware headers
|
||||
# * HAL unit depends directly on another HAL unit. The dependency should
|
||||
# always be via HAL interface.
|
||||
# * Two units have a circular dependency.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# understand_deps_analyze.py <deps_export.csv
|
||||
#
|
||||
# Notice that the CSV export has to be made by:
|
||||
# * Create architecture XML with nvgpu_arch.py (command understand)
|
||||
# * Create nvgpu project in Understand and add nvgpu code, both common and qnx
|
||||
# directories
|
||||
# * Import architecture XML to Understand
|
||||
# * View Graphs->Dependency graphs->By nvgpu (nvgpu probably comes from the
|
||||
# name of the architecture .xml file
|
||||
# * Create arch dependendency report:
|
||||
# * Reports->Dependency->Architecture Dependencies->Export CSV
|
||||
# * Choose nvgpu as "Select an architecture to analyze"
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
def checkMatch(fromUnit, toUnit):
|
||||
ret = None
|
||||
|
||||
if (not fromUnit.startswith("common/hal") and toUnit.startswith("gpu_hw")):
|
||||
ret = "Common depends on HW"
|
||||
|
||||
if (fromUnit.startswith("common/hal") and toUnit.startswith("common/hal")):
|
||||
ret = "HAL depends on HAL"
|
||||
|
||||
# We have still too many of these problems, and it's not clear if we want
|
||||
# to fix them all. Comment out for now.
|
||||
# if (fromUnit.startswith("interface") and not toUnit.startswith("interface")):
|
||||
# ret = "Interface depends on non-interface"
|
||||
|
||||
return ret
|
||||
|
||||
stream = sys.stdin
|
||||
deps = set()
|
||||
|
||||
depRe = re.compile("(.+),(.+),\d+,\d+,\d+,\d+,\d+")
|
||||
for line in stream.readlines():
|
||||
match = depRe.match(line)
|
||||
if match:
|
||||
ret = checkMatch(match.group(1), match.group(2))
|
||||
if (ret):
|
||||
print("%s,%s,%s" % (ret, match.group(1), match.group(2)))
|
||||
|
||||
if "%s,%s" % (match.group(2), match.group(1)) in deps:
|
||||
print("Circular dependency,%s,%s" % (match.group(1), match.group(2)))
|
||||
|
||||
deps.add("%s,%s" % (match.group(1), match.group(2)))
|
||||
Reference in New Issue
Block a user