Merge pull request #21 from sifive/add_freedom_sim_targets
authorTim Newsome <tim@sifive.com>
Fri, 12 Aug 2016 01:43:46 +0000 (18:43 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Aug 2016 01:43:46 +0000 (18:43 -0700)
Add freedom sim targets

debug/gdbserver.py
isa/macros/scalar/test_macros.h
isa/rv64ud/fclass.S
isa/rv64uf/fclass.S

index f3c111a78aeac3ac5bc3953ec9ed2901ee36b73c..8a6e87439a124f9835ba8b81f8cea43ee505276f 100755 (executable)
@@ -79,6 +79,9 @@ def ihex_parse(line):
         data += "%c" % int(line[8+2*i:10+2*i], 16)
     return record_type, address, data
 
+def readable_binary_string(s):
+    return "".join("%02x" % ord(c) for c in s)
+
 class DeleteServer(unittest.TestCase):
     def tearDown(self):
         del self.server
@@ -173,7 +176,8 @@ class SimpleMemoryTest(DeleteServer):
         for line in b:
             record_type, address, line_data = ihex_parse(line)
             if (record_type == 0):
-                self.assertEqual(line_data, data[address:address+len(line_data)])
+                self.assertEqual(readable_binary_string(line_data),
+                        readable_binary_string(data[address:address+len(line_data)]))
 
 class InstantHaltTest(DeleteServer):
     def setUp(self):
index 721b80b2d79593c93b6189331570c0f19bfdcf15..c8069fddba960dbf6eeb5bae116f6b9b321afef8 100644 (file)
@@ -504,6 +504,14 @@ test_ ## testnum: \
   TEST_FP_OP_D_INTERNAL( testnum, 0, dword result, val1, val2, 0.0, \
                     inst a0, f0, f1)
 
+#define TEST_FCLASS_S(testnum, correct, input) \
+  TEST_CASE(testnum, a0, correct, li a0, input; fmv.s.x fa0, a0; \
+                    fclass.s a0, fa0)
+
+#define TEST_FCLASS_D(testnum, correct, input) \
+  TEST_CASE(testnum, a0, correct, li a0, input; fmv.d.x fa0, a0; \
+                    fclass.d a0, fa0)
+
 #define TEST_INT_FP_OP_S( testnum, inst, result, val1 ) \
 test_ ## testnum: \
   li  TESTNUM, testnum; \
index 3daace0370c445301aa4ae08977c5eff6e73f0f1..39394900457d50db3acf6aa4db12ccfa9fb3d6ca 100644 (file)
@@ -17,10 +17,6 @@ RVTEST_CODE_BEGIN
   # Arithmetic tests
   #-------------------------------------------------------------
 
-  #define TEST_FCLASS_D(testnum, correct, input) \
-    TEST_CASE(testnum, a0, correct, li a0, input; fmv.d.x fa0, a0; \
-                                    fclass.d a0, fa0)
-
   TEST_FCLASS_D( 2, 1 << 0, 0xfff0000000000000 )
   TEST_FCLASS_D( 3, 1 << 1, 0xbff0000000000000 )
   TEST_FCLASS_D( 4, 1 << 2, 0x800fffffffffffff )
index 5a6361e6544a50655ee721dc433a9959d3e72694..9bb86b17b18c58632b493dae7db9e7f50c7b7fff 100644 (file)
@@ -17,10 +17,6 @@ RVTEST_CODE_BEGIN
   # Arithmetic tests
   #-------------------------------------------------------------
 
-  #define TEST_FCLASS_S(testnum, correct, input) \
-    TEST_CASE(testnum, a0, correct, li a0, input; fmv.s.x fa0, a0; \
-                                    fclass.s a0, fa0)
-
   TEST_FCLASS_S( 2, 1 << 0, 0xff800000 )
   TEST_FCLASS_S( 3, 1 << 1, 0xbf800000 )
   TEST_FCLASS_S( 4, 1 << 2, 0x807fffff )