Instruction profiler that suggests extensions, sub-instructions.
Welcome to our project! This guide will help you get started quickly.
Before running the project, make sure you have the following dependencies installed:
- Python3>= 3.9.5
- matplotlib
- riscv toolchain
After installing the dependencies, next install the profiler.
To install PARISCV, follow these steps:
-
Clone the repository:
git clone https://github.com/ashuthosh-mr/profiler.git
-
Navigate to the project directory:
cd profiler -
Unzip the necesary library files:
unxz internal_folder.tar.xz tar -xvf internal_folder.tar
-
Change the permission of ext1 and pariscv.sh:
chmod +x pariscv.sh ext1
-
To profile the region of interest in the application, place this line before the kernel:
unsigned long cycles_start,cycles_end; asm volatile ("rdcycle %0" : "=r" (cycles_start));
-
Similarly, place thhis line after the kernel.
asm volatile ("rdcycle %0" : "=r" (cycles_end)); printf("Total cycles:%d\n",cycles_end-cycles_start);
To profile any given application, just run:
./pariscv.shDefault ISA, MABI, source names are used as shown in pariscv.sh. But one can further specify the ISA flags suppported, mabi and path to the source file through the following flags:
./pariscv.sh ISA=rv64gcv_zba_zbb_zbc MABI=lp64d SOURCE=../../main.cThe output shows the total cycles, commonly used extensions and commonly used instructions within each extension.
You can find detailed documentation and usage examples on the project's web page.