Run uClibc testsuite - foss-for-synopsys-dwc-arc-processors/linux GitHub Wiki

uClibc provides test suite that verifies its features.

Running test suite with standalone nSIM

To run test suite you need to build Linux kernel, uClibc, busybox and some dependent packages. It is very convenient to use Buildroot to make all preparations. In the following article you can find short man end examples of how to use Buildroot:
How to build filesystem and kernel images for ARC cores with Buildroot

Configure buildroot

Here is an example that uses menuconfig:

  1. Go to to buildroot directory and clear your current configuration: make defconfig
  2. Run make menuconfig
  3. Select Target options ---> Target Architecture ---> ARC (little endian)
  4. Select Target options ---> Target CPU ---> ARC HS38
  5. Enable uClibc tests Toolchain ---> Compile and install uClibc tests
  6. Enable Linux Kernel Kernel ---> Linux Kernel
  7. Select Kernel ---> Kernel version ---> Latest version
  8. Select Kernel ---> Kernel binary format ---> vmlinux
  9. Set up nsim_hs kernel defconfig Kernel ---> Defconfig name ---> nsim_hs
  10. Enable Filesystem images ---> initial RAM filesystem linked into linux kernel
  11. Save configuration.

Another way is to save this line as file "uClibc_testsuite_defconfig" in buildroot/configs/

BR2_arcle=y
BR2_archs38=y
BR2_UCLIBC_INSTALL_TEST_SUITE=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_DEFCONFIG="nsim_hs"
BR2_LINUX_KERNEL_VMLINUX=y
BR2_TARGET_ROOTFS_INITRAMFS=y

and load it using menuconfig:

make uClibc_testsuite_defconfig

Build everything

Now we are ready to start build. Run make in "buildroot" root directory (or somewhere else if you are using out-of-tree build).
Output files would be created in "images" sub-directory.

Run Linux using nSIM

Check that path nsimdrv is added to your PATH environmental variables.
Command line for standalone nSIM:

nsimdrv -prop=nsim_isa_family=av2hs -prop=nsim_isa_core=1 -prop=chipid=0xffff -prop=nsim_isa_atomic_option=1 -prop=nsim_isa_ll64_option=1 -prop=nsim_mmu=4 -prop=mmu_pagesize=8192 -prop=mmu_super_pagesize=2097152 -prop=mmu_stlb_entries=16 -prop=mmu_ntlb_ways=4 -prop=mmu_ntlb_sets=128 -prop=icache=32768,64,4,0 -prop=dcache=16384,64,2,0 -prop=nsim_isa_shift_option=2 -prop=nsim_isa_swap_option=1 -prop=nsim_isa_bitscan_option=1 -prop=nsim_isa_sat=1 -prop=nsim_isa_div_rem_option=1 -prop=nsim_isa_mpy_option=9 -prop=nsim_isa_enable_timer_0=1 -prop=nsim_isa_enable_timer_1=1 -prop=nsim_isa_number_of_interrupts=32 -prop=nsim_isa_number_of_external_interrupts=32 -prop=isa_counters=1 -prop=nsim_isa_pct_counters=8 -prop=nsim_isa_pct_size=48 -prop=nsim_isa_pct_interrupt=0 -prop=nsim_mem-dev=uart0,base=0xc0fc1000,irq=24 -prop=nsim_isa_aps_feature=1 -prop=nsim_isa_num_actionpoints=4 vmlinux

Command line for nSIM via MDB:

mdb -nsim -av2hs -prop=cpunum=0 -mmuv4 -Xrtc -Xatomic -Xtimer0 -Xtimer1 -Xmpyd -Xqmpyh -Xdiv_rem -toggle=deadbeef=1 -prop=nsim_mem-dev=uart0,base=0xc0fc1000,irq=24 -prop=mmu_pagesize=8192 -prop=mmu_super_pagesize=2097152 -prop=mmu_stlb_entries=16 -prop=mmu_ntlb_ways=4 -prop=mmu_ntlb_sets=128 -icache=16384,64,2,o -dcache=16384,64,4,o -prop=nsim_isa_aps_feature=1 -prop=nsim_isa_num_actionpoints=4 -prop=nsim_isa_ll64_option=1 -run -cl vmlinux

Wait a bit while Linux is starting. Login as root - no password is required.

Running test suite

Go to /root/uClibc/test directory.
Start tests with next command line: []( make -i test V=y UCLIBC_ONLY=y 2>&1 | tee testlog ) []( + -i option forces make to ignore errors ) []( + UCLIBC_ONLY is required to run only uClibc tests ) []( + V is for verbose output ) []( UPD: If you have problem with previous command, start test with next command line: )

./uclibcng-testrunner.sh 2>&1 | tee testlog

Test log will be written to "testlog" file and shown on display.
uclibcng-testrunner.sh script launches uClibs tests listed in uclibcng-testrunner.in file.