aboutsummaryrefslogtreecommitdiff
path: root/debug/targets/SiFive
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-08-07 12:51:42 -0700
committerTim Newsome <tim@sifive.com>2017-08-28 12:16:39 -0700
commit3a44725d27f6b2c77f0ca912d792b6856fde6a17 (patch)
treee89d52105aa01d59e7d4588ef157d477f0a4335d /debug/targets/SiFive
parentab6c2ccaec192684cf4649d5d69bd105d738d1c7 (diff)
downloadriscv-tests-3a44725d27f6b2c77f0ca912d792b6856fde6a17.zip
riscv-tests-3a44725d27f6b2c77f0ca912d792b6856fde6a17.tar.gz
riscv-tests-3a44725d27f6b2c77f0ca912d792b6856fde6a17.tar.bz2
Make the debug tests aware of multicore.
Targets now contain an array of harts. When running a regular test, one hart is selected to run the test on while the remaining harts are parked in a safe infinite loop. There's currently only one test that tests multicore behavior, but there could be more. The infrastructure should be able to support heterogeneous multicore, but I don't have a target like that to test with.
Diffstat (limited to 'debug/targets/SiFive')
-rw-r--r--debug/targets/SiFive/Freedom/E300.py9
-rw-r--r--debug/targets/SiFive/Freedom/E300Sim.py9
-rw-r--r--debug/targets/SiFive/Freedom/U500.py7
-rw-r--r--debug/targets/SiFive/Freedom/U500Sim.py11
-rw-r--r--debug/targets/SiFive/HiFive1.py5
5 files changed, 28 insertions, 13 deletions
diff --git a/debug/targets/SiFive/Freedom/E300.py b/debug/targets/SiFive/Freedom/E300.py
index 95ddcfd..170de40 100644
--- a/debug/targets/SiFive/Freedom/E300.py
+++ b/debug/targets/SiFive/Freedom/E300.py
@@ -1,9 +1,12 @@
import targets
-class E300(targets.Target):
+class E300Hart(targets.Hart):
xlen = 32
ram = 0x80000000
- ram_size = 16 * 1024
+ ram_size = 256 * 1024 * 1024
instruction_hardware_breakpoint_count = 2
- openocd_config_path = "Freedom.cfg"
link_script_path = "Freedom.lds"
+
+class E300(targets.Target):
+ openocd_config_path = "Freedom.cfg"
+ harts = [E300Hart()]
diff --git a/debug/targets/SiFive/Freedom/E300Sim.py b/debug/targets/SiFive/Freedom/E300Sim.py
index 91be2e8..f9428d0 100644
--- a/debug/targets/SiFive/Freedom/E300Sim.py
+++ b/debug/targets/SiFive/Freedom/E300Sim.py
@@ -1,14 +1,17 @@
import targets
import testlib
-class E300Sim(targets.Target):
+class E300Hart(targets.Hart):
xlen = 32
- timeout_sec = 6000
ram = 0x80000000
ram_size = 256 * 1024 * 1024
instruction_hardware_breakpoint_count = 2
- openocd_config_path = "Freedom.cfg"
link_script_path = "Freedom.lds"
+class E300Sim(targets.Target):
+ timeout_sec = 6000
+ openocd_config_path = "Freedom.cfg"
+ harts = [E300Hart()]
+
def create(self):
return testlib.VcsSim(sim_cmd=self.sim_cmd, debug=False)
diff --git a/debug/targets/SiFive/Freedom/U500.py b/debug/targets/SiFive/Freedom/U500.py
index c22aa4c..6da3ac5 100644
--- a/debug/targets/SiFive/Freedom/U500.py
+++ b/debug/targets/SiFive/Freedom/U500.py
@@ -1,9 +1,12 @@
import targets
-class U500(targets.Target):
+class U500Hart(targets.Hart):
xlen = 64
ram = 0x80000000
ram_size = 16 * 1024
instruction_hardware_breakpoint_count = 2
- openocd_config_path = "Freedom.cfg"
link_script_path = "Freedom.lds"
+
+class U500(targets.Target):
+ openocd_config_path = "Freedom.cfg"
+ harts = [U500Hart()]
diff --git a/debug/targets/SiFive/Freedom/U500Sim.py b/debug/targets/SiFive/Freedom/U500Sim.py
index 62bc827..5c500c4 100644
--- a/debug/targets/SiFive/Freedom/U500Sim.py
+++ b/debug/targets/SiFive/Freedom/U500Sim.py
@@ -1,14 +1,17 @@
import targets
import testlib
-class U500Sim(targets.Target):
+class U500Hart(targets.Hart):
xlen = 64
- timeout_sec = 6000
ram = 0x80000000
ram_size = 256 * 1024 * 1024
instruction_hardware_breakpoint_count = 2
- openocd_config_path = "Freedom.cfg"
link_script_path = "Freedom.lds"
- def create(self):
+class U500Sim(Target):
+ timeout_sec = 6000
+ openocd_config_path = "Freedom.cfg"
+ harts = [U500Hart()]
+
+ def target(self):
return testlib.VcsSim(sim_cmd=self.sim_cmd, debug=False)
diff --git a/debug/targets/SiFive/HiFive1.py b/debug/targets/SiFive/HiFive1.py
index 813829e..3cb508c 100644
--- a/debug/targets/SiFive/HiFive1.py
+++ b/debug/targets/SiFive/HiFive1.py
@@ -1,8 +1,11 @@
import targets
-class HiFive1(targets.Target):
+class HiFive1Hart(targets.Hart):
xlen = 32
ram = 0x80000000
ram_size = 16 * 1024
instruction_hardware_breakpoint_count = 2
misa = 0x40001105
+
+class HiFive1(targets.Target):
+ harts = [HiFive1Hart()]