Signed-off-by: Karthika B <[email protected]>
---
 tests/functional/riscv32/meson.build  |  1 +
 tests/functional/riscv32/test_vega.py | 32 ++++++++++++++
 tests/functional/riscv64/meson.build  |  1 +
 tests/functional/riscv64/test_vega.py | 63 +++++++++++++++++++++++++++
 4 files changed, 97 insertions(+)
 create mode 100644 tests/functional/riscv32/test_vega.py
 create mode 100644 tests/functional/riscv64/test_vega.py

diff --git a/tests/functional/riscv32/meson.build 
b/tests/functional/riscv32/meson.build
index f3ebbb8db5..b02c26c186 100644
--- a/tests/functional/riscv32/meson.build
+++ b/tests/functional/riscv32/meson.build
@@ -7,4 +7,5 @@ tests_riscv32_system_quick = [
 
 tests_riscv32_system_thorough = [
   'tuxrun',
+  'vega',
 ]
diff --git a/tests/functional/riscv32/test_vega.py 
b/tests/functional/riscv32/test_vega.py
new file mode 100644
index 0000000000..932819501c
--- /dev/null
+++ b/tests/functional/riscv32/test_vega.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a bare-metal hello-world program on the
+# VEGA machine (RV32, Thejas32) and checks the console output.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import Asset, QemuSystemTest
+from qemu_test.cmd import wait_for_console_pattern
+
+
+class Vega(QemuSystemTest):
+
+    ASSET_HELLO32 = Asset(
+        
'https://gitlab.com/riscv-vega/vega_qemu_test_images/-/raw/v1.0/baremetal/hello32.elf',
+        '77d3449a495b78ff4d7aa93024682d3e8efa10e64a82c6c0029144ddd3b4c638')
+
+    def test_riscv32_vega_hello(self):
+        self.set_machine('vega')
+        hello_path = self.ASSET_HELLO32.fetch()
+
+        self.vm.set_console()
+        self.vm.add_args('-bios', hello_path,
+                         '-M', 'vega,dram-base=0x20000',
+                         '-no-reboot')
+
+        self.vm.launch()
+        wait_for_console_pattern(self, 'Hello World')
+
+
+if __name__ == '__main__':
+    QemuSystemTest.main()
diff --git a/tests/functional/riscv64/meson.build 
b/tests/functional/riscv64/meson.build
index b996c89d7d..932447144d 100644
--- a/tests/functional/riscv64/meson.build
+++ b/tests/functional/riscv64/meson.build
@@ -14,4 +14,5 @@ tests_riscv64_system_thorough = [
   'boston',
   'sifive_u',
   'tuxrun',
+  'vega',
 ]
diff --git a/tests/functional/riscv64/test_vega.py 
b/tests/functional/riscv64/test_vega.py
new file mode 100644
index 0000000000..b71daa7bbb
--- /dev/null
+++ b/tests/functional/riscv64/test_vega.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots bare-metal and Linux payloads on the
+# VEGA machine (RV64, Thejas64) and checks the console output.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import Asset, LinuxKernelTest, QemuSystemTest
+from qemu_test.cmd import wait_for_console_pattern
+
+
+class VegaBaremetal(QemuSystemTest):
+
+    ASSET_HELLO64 = Asset(
+        
'https://gitlab.com/riscv-vega/vega_qemu_test_images/-/raw/v1.0/baremetal/hello64.elf',
+        'cd2f3b04d8d6cd0ee75e3eeef58988cc02ed783f6f5b3b1d3a95195441fc7f1d')
+
+    def test_riscv64_vega_hello(self):
+        self.set_machine('vega')
+        hello_path = self.ASSET_HELLO64.fetch()
+
+        self.vm.set_console()
+        self.vm.add_args('-bios', hello_path,
+                         '-M', 'vega,dram-base=0x20000',
+                         '-no-reboot')
+
+        self.vm.launch()
+        wait_for_console_pattern(self, 'Hello World')
+
+
+class VegaLinux(LinuxKernelTest):
+
+    ASSET_BBL = Asset(
+        
'https://gitlab.com/riscv-vega/vega_qemu_test_images/-/raw/v1.0/linux/bbl',
+        '018fa3e96ec715d4c915c3a85212da6c300c412e56c6c73a16f965526ca8d858')
+    ASSET_DTB = Asset(
+        
'https://gitlab.com/riscv-vega/vega_qemu_test_images/-/raw/v1.0/linux/vega.dtb',
+        '0b8261051c88e690d6508cb1c774fd3cab97d50570ff668fdfabd0bf52c52414')
+    ASSET_ROOTFS = Asset(
+        
'https://gitlab.com/riscv-vega/vega_qemu_test_images/-/raw/v1.0/linux/rootfs.cpio',
+        '389a5b9883b14c2a5614ece120abc4ee60543d1110a03a9de35d80405e18c063')
+
+    def test_riscv64_vega_linux(self):
+        self.set_machine('vega')
+        bbl_path = self.ASSET_BBL.fetch()
+        dtb_path = self.ASSET_DTB.fetch()
+        rootfs_path = self.ASSET_ROOTFS.fetch()
+
+        self.vm.set_console()
+        self.vm.add_args('-M', 'vega,dram-base=0x400000000',
+                         '-m', '2G',
+                         '-bios', 'none',
+                         '-kernel', bbl_path,
+                         '-dtb', dtb_path,
+                         '-initrd', rootfs_path,
+                         '-no-reboot')
+
+        self.vm.launch()
+        self.wait_for_console_pattern('cdac login:')
+
+
+if __name__ == '__main__':
+    QemuSystemTest.main()
-- 
2.43.0


------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
------------------------------------------------------------------------------------------------------------


Reply via email to