-
Notifications
You must be signed in to change notification settings - Fork 48
Linux Virtual Appliance User Guide
This is a draft document and is subject to change without notice.
This is a manual on how to use Virtual Appliance for ARC Linux Virtual Platform.
- Download latest VirtualBox distribution from https://www.virtualbox.org/wiki/Downloads. VirtualBox Extension Pack is not required. Install VirtualBox. Start it.
- Click menu item "File > Import Appliance". Choose *.ova file of this virtual appliance.
- When importing dialog will pop that will prompt for a VM parameters. Check them and edit of needed. Most likely candidates for editing: VM name, amount of CPU cores, amoount of RAM.
Start Virtual appliance.
Change current directory to the ~/snps/virtual-appliance
:
$ cd ~/snps/virtual-appliance
Start SystemC model:
$ SC_SIGNAL_WRITE_CHECK=DISABLE ./sc_top
Depending on the parameters used at compile time, one of the provided properties.ini
will be used. For the default ARC 700 single core model properties_up_a7.ini
will be used, which in turn will set appropriate nSIM properties file and vmlinux file.
Set required environment variables: NSIM_HOME
, SYSTEMC_HOME
, TLM_HOME
and SCML_HOME
. You can source ~/snps/setenv.sh
to use packages provided with this virtual appliance.
Compile model:
$ make clean
$ make EXTRA_CXXFLAGS="-fpermissive"
By default model for ARC 700 is built. To build model for ARC HS pass following variables to the make
:
- ARC 700 model:
make
- Single core ARC HS model:
make ARCV2HS=1
- Dual Core ARC HS model:
make CONFIG_SMP=1 ARCV2HS=1
Set required permissions to sc_top:
sudo /sbin/setcap cap_net_admin,cap_net_bind_service=pe ./sc_top
Your recompiled model is ready.
Add toolchain to the PATH
:
$ export PATH=/home/arc/snps/toolchain-arc700/host/usr/bin:$PATH
Compile application (source code for hello world is already included):
$ cd snps/pub/examples
$ arc-linux-gcc -g -o hello_world hello_world.c
For simplicity in this example we already work right in the NFS share. If you work in another directory then you will need to copy executable to the NFS share to make it available to the target.
Start gdbserver on target system:
[ARCLinux] $ cd /mnt/examples
[ARCLinux] $ gdbserver :49101 hello_world
Start GDB on host:
$ arc-linux-gdb --quiet hello_world
(gdb) set sysroot /home/arc/toolchain-arc700/staging
(gdb) target remote 192.168.218.2:49101
(gdb) break main
(gdb) continue
(gdb) continue
(gdb) quit
-
Q: I've issued "halt" command to the target. Linux halted, but SystemC model is still running.
A: It is a known issue in the current SystemC model: it doesn't exit when CPU was halted. You need too close SystemC model with CTRL+C combinations (or send SIGINT via
kill
command). -
Q: When SystemC model exits there is an error message about failed assertion.
A: It is a known issue, which exibits itself only when exiting from the model, therefore it doesn't have any known real consequences.