Backed out prior changeset f9fb64a72259
authorSteve Reinhardt <steve.reinhardt@amd.com>
Mon, 24 Nov 2014 02:00:47 +0000 (18:00 -0800)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Mon, 24 Nov 2014 02:00:47 +0000 (18:00 -0800)
Back out use of importlib to avoid implicitly creating
dependency on Python 2.7.

configs/ruby/Ruby.py

index 98df027dc1e2eb951d2a7009f31135a342e93e2d..44d6bdfcc5c9b3e647440c254496b515cbda26b0 100644 (file)
@@ -39,7 +39,6 @@
 #
 # Authors: Brad Beckmann
 
-import importlib
 import math
 import m5
 from m5.objects import *
@@ -183,15 +182,15 @@ def create_system(options, full_system, system, piobus = None, dma_ports = []):
             routers = [], ext_links = [], int_links = [], netifs = [])
     ruby.network = network
 
-    protocol_name = buildEnv['PROTOCOL']
-    protocol = importlib.import_module(protocol_name)
+    protocol = buildEnv['PROTOCOL']
+    exec "import %s" % protocol
     try:
         (cpu_sequencers, dir_cntrls, topology) = \
-             protocol.create_system(options, full_system, system, dma_ports,
-                                    ruby)
+             eval("%s.create_system(options, full_system, system, dma_ports,\
+                                    ruby)"
+                  % protocol)
     except:
-        print "Error: could not create sytem for ruby protocol %s" % \
-            protocol_name
+        print "Error: could not create sytem for ruby protocol %s" % protocol
         raise
 
     # Create a port proxy for connecting the system port. This is