Merge pull request #1088 from enjoy-digital/ci-openrisc

CI: Add OpenRISC GCC toolchain installation.
This commit is contained in:
enjoy-digital 2021-10-26 16:30:56 +02:00 committed by GitHub
commit ccef999772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 10 deletions

View File

@ -25,15 +25,18 @@ jobs:
- name: Install LiteX - name: Install LiteX
run: | run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py 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 # Install GCC Toolchains
- name: Install RISC-V GCC - name: Install GCC Toolchains
run: | run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py 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 mkdir /usr/local/riscv
sudo cp -r $PWD/../riscv64-*/* /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 # Install Project
- name: Install Project - name: Install Project
@ -43,4 +46,5 @@ jobs:
- name: Run Tests - name: Run Tests
run: | run: |
export PATH=/usr/local/riscv/bin:$PATH export PATH=/usr/local/riscv/bin:$PATH
export PATH=/usr/local/openrisc/bin:$PATH
python3 setup.py test python3 setup.py test

View File

@ -47,11 +47,6 @@ class MOR1KX(CPU):
"csr" : 0xe0000000, "csr" : 0xe0000000,
} }
# GCC Triple.
@property
def gcc_triple(self):
return "or1k-elf"
# GCC Flags. # GCC Flags.
@property @property
def gcc_flags(self): def gcc_flags(self):

View File

@ -10,7 +10,7 @@ import sys
class TestCPU(unittest.TestCase): class TestCPU(unittest.TestCase):
def boot_test(self, cpu_type): 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>'] litex_prompt = [b'\033\[[0-9;]+mlitex\033\[[0-9;]+m>']
is_success = True is_success = True
with open("/tmp/test_boot_log", "wb") as result_file: with open("/tmp/test_boot_log", "wb") as result_file:
@ -34,6 +34,7 @@ class TestCPU(unittest.TestCase):
return is_success return is_success
# RISC-V CPUs.
def test_vexriscv(self): def test_vexriscv(self):
self.assertTrue(self.boot_test("vexriscv")) self.assertTrue(self.boot_test("vexriscv"))
@ -58,3 +59,6 @@ class TestCPU(unittest.TestCase):
def test_minerva(self): def test_minerva(self):
self.assertTrue(self.boot_test("minerva")) self.assertTrue(self.boot_test("minerva"))
# OpenRISC CPUs.
#def test_mor1kx(self):
# self.assertTrue(self.boot_test("mor1kx"))