Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/49397 )
13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
Change subject: python,scons: Break slicc's dependence on m5.util.
......................................................................
python,scons: Break slicc's dependence on m5.util.
The only dependence remaining was a small utility function makeDir which
was only used by slicc. This change moves it to where it's used, and
cleans up the additions to sys.path a little.
Change-Id: I7415b53ea2e9c378b6dbf342b8b3a966f48e117c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49397
Tested-by: kokoro <[email protected]>
Reviewed-by: Hoa Nguyen <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/mem/slicc/symbols/SymbolTable.py
M src/python/m5/util/__init__.py
M util/slicc
3 files changed, 10 insertions(+), 11 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
Hoa Nguyen: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/mem/slicc/symbols/SymbolTable.py
b/src/mem/slicc/symbols/SymbolTable.py
index fb01b01..f9f7a10 100644
--- a/src/mem/slicc/symbols/SymbolTable.py
+++ b/src/mem/slicc/symbols/SymbolTable.py
@@ -25,13 +25,22 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from m5.util import makeDir
+import os
from slicc.generate import html
from slicc.symbols.StateMachine import StateMachine
from slicc.symbols.Type import Type
from slicc.util import Location
+def makeDir(path):
+ """Make a directory if it doesn't exist. If the path does exist,
+ ensure that it is a directory"""
+ if os.path.exists(path):
+ if not os.path.isdir(path):
+ raise AttributeError("%s exists but is not directory" % path)
+ else:
+ os.mkdir(path)
+
class SymbolTable(object):
def __init__(self, slicc):
self.slicc = slicc
diff --git a/src/python/m5/util/__init__.py b/src/python/m5/util/__init__.py
index a99012e..71621e7 100644
--- a/src/python/m5/util/__init__.py
+++ b/src/python/m5/util/__init__.py
@@ -155,15 +155,6 @@
line += item
print(line)
-def makeDir(path):
- """Make a directory if it doesn't exist. If the path does exist,
- ensure that it is a directory"""
- if os.path.exists(path):
- if not os.path.isdir(path):
- raise AttributeError("%s exists but is not directory" % path)
- else:
- os.mkdir(path)
-
def isInteractive():
"""Check if the simulator is run interactively or in a batch
environment"""
diff --git a/util/slicc b/util/slicc
index bc5f50d..201008b 100755
--- a/util/slicc
+++ b/util/slicc
@@ -31,7 +31,6 @@
base = dirname(__file__)
sys.path.insert(1, join(base, "../src/mem"))
- sys.path.insert(1, join(base, "../src/python"))
sys.path.insert(1, join(base, "../build_tools"))
sys.path.insert(1, join(base, "../ext/ply"))
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49397
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I7415b53ea2e9c378b6dbf342b8b3a966f48e117c
Gerrit-Change-Number: 49397
Gerrit-PatchSet: 18
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Hoa Nguyen <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s