IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

README.md 5.84 KB
Newer Older
Alfredo's avatar
Alfredo committed
1
# riscv_vm
Alfredo's avatar
Alfredo committed
2
3
&nbsp;<img src="https://github.com/openhwgroup/riscv_vm/blob/master/RISCV_VM.png" width="200" title="RISC-V VM">

Alfredo's avatar
Alfredo committed
4
The OpenHW Group's RISC-V Virtual Machine (riscv_vm) is intended for anyone wanting to study, configure as-preferred, modify, implement or release hardware based the RISC-V Instruction Set Architecture. The VM is preconfigured for RISC-V HW development. It was developed and tested with VirtualBox 6.0.10 but not on other virtualization SW. As of Sept 10, 2019, it includes most of the SW described in the https://open-isa.org/get-started/ webpage, except for NXP's VEGA board SDK.
Alfredo's avatar
Alfredo committed
5
6
7
   * RISC-V SW tool chain using the Eclipse-IDE
   * RISC-V Imperas OVPSim model
   * RISC-V Verilator model
Alfredo's avatar
Alfredo committed
8
   * The files in the ~/bin directory are used to create the VM Linux image after Ubuntu 18.04LTS has been installed. 
Alfredo's avatar
Alfredo committed
9
10
11
   * The VM'sminimal configuration is 2CPU/4G-RAM/20GB-DISK with USB 2.0 enabled
   * To donwload a protable *.osa appliance file, go to:
     - [RISCV_VM *.OVA image on Google Drive](https://drive.google.com/drive/folders/18njYttFpczl-CrHkZ7HQ-lLf-w2fBcL9)
Alfredo's avatar
Alfredo committed
12
13
     - **Size:** 4 GB (3,785,816,576 bytes)
     - **MDA5:** 29e97756c8cb77f42503ae7ef4ddf876
Alfredo's avatar
Alfredo committed
14
     - **SHA1:** b274fcac89d7c2d3fbaa26742e91a8c115774fad
15
16
17
   * **Note1: that the virtual machine userID /password is _user/abc123_**
   * Note2: an early version of the VM was released with a work-around to comply with 3rd party SW components in the VEGA SDK; for that version, the SDK must must installed directly within the VM following the instructions located [here](https://open-isa.org/get-started/)
   * <span style="color: green"> **Note3: as of Monday September 16th, the VM includes all SW.**</span>
18
 
Alfredo's avatar
Alfredo committed
19
## Importing VM into VirtualBox on Windows10 host
20
The instructions to install and run are:
Alfredo's avatar
Alfredo committed
21
22
1. Open a Windows Command-line prompt with Admin privileges:
   * Press the Windows-Start key
Alfredo's avatar
Alfredo committed
23
   * search for the _"cmd.exe"_ program
Alfredo's avatar
Alfredo committed
24
   * right-click on CMD icon
Alfredo's avatar
Alfredo committed
25
   * select _“Run as administrator”_
Alfredo's avatar
Alfredo committed
26
2. Download and run the installer batch file available in this repository: 
Alfredo's avatar
Alfredo committed
27
   - [riscv_vm Windows10 Install script](https://github.com/openhwgroup/riscv_vm/blob/master/riscv_vm_win10_install.bat)
Alfredo's avatar
Alfredo committed
28
29
30
31
3. Install VirtualBox and its corresponding Extension Pack downloaded by the installer script
4. Import the *.OVA “appliance” into VirtualBox
5. Start the VcXsrv client
6. Start git-bash to run the following:
Alfredo's avatar
Alfredo committed
32
33
   - Start the VM from the git-bash in head-less mode (your path may be different):
  ```
Alfredo's avatar
Alfredo committed
34
        <PROMPT$>/c/bta_cadtree/VirtualBox/vb6_0_10/VBoxManage startvm riscv_vm --type headless
Alfredo's avatar
Alfredo committed
35
36
        <PROMPT$>export DISPLAY=localhost:0.0
  ```
Alfredo's avatar
Alfredo committed
37
7. SSH into the VM using the command:
Alfredo's avatar
Alfredo committed
38
39
   - ssh -Yv user@<_IP of riscv_vm2_>
   - In my case that is: ssh -Yv user@192.168.56.101
40
41
8. Finally, install the JLink driver for the host system by following the instructions here:
   - https://www.segger.com/downloads/jlink/
42

43
44
## Installing the riscv_vm tools directly on Ubuntu 18.04LTS host (UNTESTED)
On Ubuntu 18.04 the virtual box that is included by default is 5.x. Follow these instructions to download and install 6.x from virtualbox instead:
45
46
1. From a command-line terminal
2. clone the repo from your Linux machine:
47
   - git clone git@github.com:openhwgroup/riscv_vm.git
48
49
50
3. Run the installer script in "sudo" mode: 
   - sudo riscv_vm/riscv_vm_ubuntu_install.sh
4. Import the *.OVA “appliance” into VirtualBox
51
52
53
54
55
56
57
5. There does not seem to be host networks by default in virtualbox on Linux. To add:
   - elect from the GUI menu \[File] -> \[Host Network Manager]
   - then \[Network] -> \[Create]
   - In the newly created network enable the DHCP server
6. The VM may start in error related to host network, you may resolve this by simply opening the Machine's network settings and pressing ok (with perhaps a dummy edit).
7. The installer script installs both VirtualBox and the corresponding extension pack for support of USB. The script also adds the current user to the vboxusers group: 
   * **NOTE**: log-off and on again for new groups to take effect
Alfredo's avatar
Alfredo committed
58
8. Your Linux kernel may not be compatible with VirtualBox, if the isntallation fails with a message similar to this:
Alfredo's avatar
Alfredo committed
59
60
61
62
63
64
65
66
67
```
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (5.2.11-100.fc29.x86_64) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.
```
68
69
70
9. Finally, install the JLink driver for the host system by following the instructions here:
   - https://www.segger.com/downloads/jlink/
   
Alfredo's avatar
Alfredo committed
71
72
## Importing VM into VirtualBox on MacOS host
The instructions to install and run are:
Alfredo's avatar
Alfredo committed
73
74
75
76
77
78
79
80
81
82
83
1. Open the “Terminal” application, found in /Applications/Utilities/
2. Download and run the installer script  available in this repository: 
   - [riscv_vm MacOS Install script](https://github.com/openhwgroup/riscv_vm/blob/master/riscv_vm_macos_install.command) 
3. Install VirtualBox and its corresponding Extension Pack downloaded by the installer script
4. Import the *.OVA “appliance” into VirtualBox
5. Start the XQuartz client:
   - Install XQuartz on your Mac, which is the official X server software for Mac
   - Run Applications > Utilities > XQuartz.app
6. Right click on the XQuartz icon in the dock and select Applications > Terminal.  This should bring up a new xterm terminal windows to run the following:
   - Start the VM from the xquartz-terminal in head-less mode (your path may be different):
  ```
Alfredo's avatar
Alfredo committed
84
        <PROMPT$>/c/bta_cadtree/VirtualBox/vb6_0_10/VBoxManage startvm riscv_vm --type headless
Alfredo's avatar
Alfredo committed
85
86
87
88
89
        <PROMPT$>export DISPLAY=localhost:0.0
  ```
7. SSH into the VM using the command:
   - ssh -Yv user@<_IP of riscv_vm2_>
   - In my case that is: ssh -Yv user@192.168.56.101
90
91
8. Finally, install the JLink driver for the host system by following the instructions here:
   - https://www.segger.com/downloads/jlink/