From cb9f0fb1b0f36e2ff276182afa09b1b763d3ab4c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 26 Oct 2021 15:36:07 +0200 Subject: [PATCH 1/3] ci/test_cpu: Install OpenRISC GCC toolchain in CI and add mor1kx to test_cpu. --- .github/workflows/ci.yml | 12 ++++++++---- test/test_cpu.py | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bedbb7c2f..4921e0129 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,15 +25,18 @@ jobs: - name: Install LiteX run: | wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py - python3 litex_setup.py init install --user + python3 litex_setup.py --init --install --user - # Install RISC-V GCC - - name: Install RISC-V GCC + # Install GCC Toolchains + - name: Install GCC Toolchains run: | wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py - python3 litex_setup.py gcc + python3 litex_setup.py --gcc=riscv sudo mkdir /usr/local/riscv sudo cp -r $PWD/../riscv64-*/* /usr/local/riscv + python3 litex_setup.py --gcc=openrisc + sudo mkdir /usr/local/openrisc + sudo cp -r $PWD/../openrisc-*/* /usr/local/openrisc # Install Project - name: Install Project @@ -43,4 +46,5 @@ jobs: - name: Run Tests run: | export PATH=/usr/local/riscv/bin:$PATH + export PATH=/usr/local/openrisc/bin:$PATH python3 setup.py test diff --git a/test/test_cpu.py b/test/test_cpu.py index 9588c43a7..1e9ce00d6 100644 --- a/test/test_cpu.py +++ b/test/test_cpu.py @@ -10,7 +10,7 @@ import sys class TestCPU(unittest.TestCase): def boot_test(self, cpu_type): - cmd = f'lxsim --cpu-type={cpu_type}' + cmd = f'litex_sim --cpu-type={cpu_type}' litex_prompt = [b'\033\[[0-9;]+mlitex\033\[[0-9;]+m>'] is_success = True with open("/tmp/test_boot_log", "wb") as result_file: @@ -34,6 +34,7 @@ class TestCPU(unittest.TestCase): return is_success + # RISC-V CPUs. def test_vexriscv(self): self.assertTrue(self.boot_test("vexriscv")) @@ -58,3 +59,6 @@ class TestCPU(unittest.TestCase): def test_minerva(self): self.assertTrue(self.boot_test("minerva")) + # OpenRISC CPUs. + def test_mor1kx(self): + self.assertTrue(self.boot_test("mor1kx")) From 07b856d01e90e0208c3d0b1406de7f484cdce0db Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 26 Oct 2021 16:06:10 +0200 Subject: [PATCH 2/3] cores/cpu/mor1kx: Fix gcc_triple (Was duplicated). --- litex/soc/cores/cpu/mor1kx/core.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/litex/soc/cores/cpu/mor1kx/core.py b/litex/soc/cores/cpu/mor1kx/core.py index ceba2fea0..3d2f9644f 100644 --- a/litex/soc/cores/cpu/mor1kx/core.py +++ b/litex/soc/cores/cpu/mor1kx/core.py @@ -47,11 +47,6 @@ class MOR1KX(CPU): "csr" : 0xe0000000, } - # GCC Triple. - @property - def gcc_triple(self): - return "or1k-elf" - # GCC Flags. @property def gcc_flags(self): From e617f52e34d6f363e419814cb8b6324c4f383361 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 26 Oct 2021 16:30:02 +0200 Subject: [PATCH 3/3] test/test_cpu: Comment test_mor1kx for now (test work but issue seems related to the pre-built toolchain). --- test/test_cpu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_cpu.py b/test/test_cpu.py index 1e9ce00d6..7d25c876a 100644 --- a/test/test_cpu.py +++ b/test/test_cpu.py @@ -60,5 +60,5 @@ class TestCPU(unittest.TestCase): self.assertTrue(self.boot_test("minerva")) # OpenRISC CPUs. - def test_mor1kx(self): - self.assertTrue(self.boot_test("mor1kx")) + #def test_mor1kx(self): + # self.assertTrue(self.boot_test("mor1kx"))