###### tags: `ITRI`
# CASLab x ITRI Virtual Platform Demo
Simulation Platform: https://drive.google.com/file/d/16xIMCTcmbXTVWEEe6Ru0KnbB37kOYD_j/view?usp=sharing
## Architecture Overview

## Manual
### Password
#### Ubuntu
- password: `caslabgpu`
#### Qemu
- Username: `root`
- password: `root`
### Getting Started
#### Step 1 Start Virtual Machine
##### Download VMware workstation 16 playe
[VMware Workstation 16 Player](https://www.vmware.com/tw/products/workstation-player/workstation-player-evaluation.html)
##### Download Demo.ovf File
##### Import ovf file in VMware
Click `Open a Virtual Machine` and choose the `demo.ovf` file downloaded previously.

Wait a few minutes.
#### Step 2. Execution CASLab-GPU and ITRI platform hardware
Open a terminal, and run the simulation platform
`$ cd demo`
* with timing info
* `$ ./Simulation_Platform`
* w/o timing info
* `$ ./Simulation_Platform | grep -v -e 'Timing Info' -e 'sc_start'`
#### Run Testbench on CASLab-GPU
##### Start Qemu
Open another terminal
`$ cd demo`
`$ source startqemu.sh`
wait a couple of times
Log in Qemu
- username: root
- password: root

##### Run CASLab-GPU Testbench
Enter the testbench directory:
`$ cd workspace/non-block-runtime/polybench-gpu-1.0/OpenCL-mid`
Choose a testbench:
EX:
`$ cd ATAX`
Compile the testbench:
`$ make`
Execute the testbench:
`$ ./atax.exe`
(You can try other testbench or write your own OpenCL program)
#### Run ITRI Testbench
##### Choose a testbench you want to run
Open another terminal and enter the testbench directory:
`$ cd demo/ITRI_TB/testbench`
Choose a testbench you want to run:
Ex:
`$ cd 01_test_pooling`
Compile the testbench:
`$ make`
Move the execution file to the execution directory:
`$ mv riscv-main.elf ~/demo/demo_ITRI_tb`
Run the ITRI testbench:
Return to the termunal running Qemu and change to home directory
`$ cd ~`
`$ ./ITRI.o`
You can also write your own program by using APIs provided by ITRI, just remember to compile and name it as `riscv-main.elf` and place it at ``~/demo/demo_ITRI_tb`
#### Exit Qemu
After completion of the simulation, we neet to shutdown the Qemu
`$ shutdown now`