Ejemplo n.º 1
0
 def create(self):
     # TODO: It would be nice to test with slen=128, but spike currently
     # requires vlen==slen.
     return testlib.MultiSpike([
         #                testlib.Spike(self, isa="RV64IMAFDV", abstract_rti=30,
         #                    support_hasel=False, support_abstract_csr=False,
         #                    vlen=512, elen=64, slen=512, harts=self.harts[:2]),
         testlib.Spike(
             self,
             isa="RV32IMAFDCV",
             dmi_rti=4,
             support_abstract_csr=True,
             support_haltgroups=False,
             # elen must be at least 64 because D is supported.
             elen=64,
             harts=self.harts[2:]),
         testlib.Spike(
             self,
             isa="RV32IMAFDCV",
             dmi_rti=4,
             support_abstract_csr=True,
             support_haltgroups=False,
             # elen must be at least 64 because D is supported.
             elen=64,
             harts=self.harts[2:])
     ])
Ejemplo n.º 2
0
 def create(self):
     return testlib.Spike(self,
                          progbufsize=0,
                          dmi_rti=4,
                          support_hasel=False,
                          support_abstract_csr=True,
                          support_haltgroups=False)
Ejemplo n.º 3
0
 def create(self):
     # 64-bit FPRs on 32-bit target
     return testlib.Spike(self,
                          isa="RV32IMAFDC",
                          dmi_rti=4,
                          support_abstract_csr=True,
                          support_haltgroups=False)
Ejemplo n.º 4
0
 def setUp(self):
     self.binary = testlib.compile("debug.c")
     self.spike = testlib.Spike(self.binary, halted=False)
     self.gdb = testlib.Gdb()
     self.gdb.command("file %s" % self.binary)
     self.gdb.command("target extended-remote localhost:%d" %
                      self.spike.port)
Ejemplo n.º 5
0
 def create(self):
     # 32-bit FPRs only
     return testlib.Spike(self,
                          isa="RV64IMAFC",
                          progbufsize=0,
                          abstract_rti=30,
                          support_abstract_csr=True)
Ejemplo n.º 6
0
    def setUp(self):
        length = 2**20
        fd = file("data.c", "w")
        fd.write("#include <stdint.h>\n")
        fd.write("uint32_t length = %d;\n" % length)
        fd.write("uint8_t d[%d] = {\n" % length)
        self.crc = 0
        for i in range(length / 16):
            fd.write("  /* 0x%04x */ " % (i * 16))
            for _ in range(16):
                value = random.randrange(1 << 8)
                fd.write("%d, " % value)
                self.crc = binascii.crc32("%c" % value, self.crc)
            fd.write("\n")
        fd.write("};\n")
        fd.write("uint8_t *data = &d[0];\n")
        fd.close()

        self.binary = testlib.compile("checksum.c", "data.c", "start.S",
                                      "-mcmodel=medany", "-T",
                                      "standalone.lds", "-nostartfiles")
        self.spike = testlib.Spike(None, halted=True)
        self.gdb = testlib.Gdb()
        self.gdb.command("file %s" % self.binary)
        self.gdb.command("target extended-remote localhost:%d" %
                         self.spike.port)
Ejemplo n.º 7
0
 def create(self):
     return testlib.Spike(self,
                          isa="RV64IMAFDV",
                          abstract_rti=30,
                          support_hasel=False,
                          support_abstract_csr=False,
                          vlen=512,
                          elen=64)
Ejemplo n.º 8
0
 def create(self):
     return testlib.MultiSpike([
         testlib.Spike(self,
                       isa="RV64IMAFDV",
                       support_hasel=False,
                       support_abstract_csr=False,
                       vlen=512,
                       elen=64,
                       harts=self.harts[2:]),
         testlib.Spike(
             self,
             isa="RV32IMAFDCV",
             support_abstract_csr=True,
             support_haltgroups=False,
             # elen must be at least 64 because D is supported.
             elen=64,
             harts=self.harts[:2]),
     ])
Ejemplo n.º 9
0
 def setUp(self):
     self.binary = testlib.compile("mprv.S", "-T", "standalone.lds",
                                   "-nostartfiles")
     self.spike = testlib.Spike(None, halted=True)
     self.gdb = testlib.Gdb()
     self.gdb.command("file %s" % self.binary)
     self.gdb.command("target extended-remote localhost:%d" %
                      self.spike.port)
     self.gdb.command("load")
Ejemplo n.º 10
0
 def create(self):
     # 64-bit FPRs on 32-bit target
     return testlib.Spike(
         self,
         isa="RV32IMAFDCV",
         dmi_rti=4,
         support_abstract_csr=True,
         support_haltgroups=False,
         # elen must be at least 64 because D is supported.
         elen=64)
Ejemplo n.º 11
0
 def create(self):
     # TODO: It would be nice to test with slen=128, but spike currently
     # requires vlen==slen.
     return testlib.Spike(self,
                          isa="RV64IMAFDV",
                          abstract_rti=30,
                          support_hasel=False,
                          support_abstract_csr=False,
                          vlen=512,
                          elen=64,
                          slen=512)
Ejemplo n.º 12
0
 def create(self):
     return testlib.Spike(self, isa="RV32IMAFC", progbufsize=0)
Ejemplo n.º 13
0
 def create(self):
     return testlib.Spike(self, isa="RV32IMAV", support_hasel=True,
             support_haltgroups=False)
Ejemplo n.º 14
0
 def create(self):
     return testlib.Spike(self, isa="RV64IMAFD", abstract_rti=30)
Ejemplo n.º 15
0
 def create(self):
     return testlib.Spike(self, isa="RV32IMAFC")
Ejemplo n.º 16
0
 def test_nogdb(self):
     """Make sure that we can run past ebreak when gdb isn't attached."""
     spike = testlib.Spike(self.binary, timeout=10)
     result = spike.wait()
     self.assertEqual(result, 0)
Ejemplo n.º 17
0
 def create(self):
     # 64-bit FPRs on 32-bit target
     return testlib.Spike(self, isa="RV32IMAFDC")
Ejemplo n.º 18
0
 def create(self):
     return testlib.Spike(self, abstract_rti=30)
Ejemplo n.º 19
0
 def server(self):
     return testlib.Spike(parsed.cmd, halted=True)
Ejemplo n.º 20
0
 def create(self):
     # 32-bit FPRs only
     return testlib.Spike(self, isa="RV64IMAFC")
Ejemplo n.º 21
0
 def create(self):
     return testlib.Spike(self,
                          abstract_rti=30,
                          support_hasel=False,
                          support_abstract_csr=False)
Ejemplo n.º 22
0
 def create(self):
     return testlib.Spike(self, isa="RV64IMAFD")
Ejemplo n.º 23
0
 def create(self):
     return testlib.Spike(self, progbufsize=0)
Ejemplo n.º 24
0
 def create(self):
     return testlib.Spike(self)
Ejemplo n.º 25
0
 def test_noport(self):
     """Make sure that we can run past ebreak when --gdb-port isn't used."""
     spike = testlib.Spike(self.binary, with_gdb=False, timeout=10)
     result = spike.wait()
     self.assertEqual(result, 0)
Ejemplo n.º 26
0
 def create(self):
     return testlib.Spike(self,
                          isa="RV32IMAFC",
                          progbufsize=0,
                          dmi_rti=4,
                          support_abstract_csr=True)
Ejemplo n.º 27
0
 def server(self):
     return testlib.Spike(self.cmd, halted=True, xlen=32)
Ejemplo n.º 28
0
 def create(self):
     return testlib.Spike(self, support_hasel=False)
Ejemplo n.º 29
0
 def target(self):
     return testlib.Spike(self.sim_cmd, xlen=32)