Merge "Use springbok renode config files to initialize platform."
diff --git a/scripts/test_runner.py b/scripts/test_runner.py
index 983de9c..5941830 100755
--- a/scripts/test_runner.py
+++ b/scripts/test_runner.py
@@ -55,19 +55,23 @@
 class RenodeSimulation(Simulation): # pylint: disable=too-few-public-methods
     """ Renode Simulation """
     def __init__(self, path, elf):
-        # TODO(henryherman): Look at using repl platform file.
+        # Get the ROOTDIR path if it exists
+        self.rootdir = os.environ.get('ROOTDIR', default=None)
+        if self.rootdir is None:
+            parser.error("ROOTDIR environment variable not set.")
         renode_script = """
-mach create "springbok"
-machine LoadPlatformDescriptionFromString "cpu: CPU.SpringbokRiscV32 @ sysbus"
-machine LoadPlatformDescriptionFromString "ram_vec_imem: Memory.MappedMemory @ sysbus 0x30000000 {size: 0x00040000}"
-machine LoadPlatformDescriptionFromString "ram_vec_dmem: Memory.MappedMemory @ sysbus 0x34000000 {size: 0x00400000}"
-sysbus LoadELF @%s
-sysbus.cpu PC 0x30000000
-sysbus.cpu PerformanceInMips 2000
+path set @%(rootdir)s
+$bin=@%(elf)s
+include @sim/config/springbok.resc
+sysbus.cpu2 PerformanceInMips 2000
 emulation SetGlobalQuantum "1"
-sysbus.cpu IsHalted False
-start"""
-        self.renode_script = renode_script % elf
+start
+sysbus.vec_controlblock WriteDoubleWord 0xc 0"""
+        self.script_params = {
+            "rootdir": self.rootdir,
+            "elf":elf
+        }
+        self.renode_script = renode_script % self.script_params
 
         self.renode_args = [
             "mono",