Skip to content

This Github-Repo is to track the progress of my RISC-V based hands-on project research internship

Notifications You must be signed in to change notification settings

Aathkheyakhan/VSDSquadron_RISC-V_MiniReasearchInternship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

VSDSquadron_RISC-V_MiniReasearchInternship

This Github-Repo is to track my progress regarding RISC-V based hands-on project research internship

TASK-1


Install all the necessary files regarding internship such as riscv_workshop.vdi and visualC++ and oracle virtual-box(which is free and open source virtualization software).Download and do the installation steps and setup virtual machine(its an physical computer but inside a virtual environment)

STEP:1

Open the VDI File using virtual box in windows and open terminal

STEP:2

Install LEAFPAD (EDITOR)

          sudo apt install LEAFPAD

TASK1 7_29_2024 9_44_26 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_29_2024 9_45_04 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_29_2024 9_45_37 PM

run the cd command to make sure we are in home directory

          cd

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_05_09 PM

To open the file in editor

         leafpad filename.c &

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_06_23 PM

Write a C program to calculate the sum from 1 to n in the leafpad editor

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_07_26 PM

STEP:3

RUN AND COMPLILE THE CODE USING THE FOLLOWING COMMANDS and check the output

         gcc.filename.C

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_07_41 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_09_15 PM

         ./a.out

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_09_25 PM

STEP:4

COMPILE THE SAME PROGRAM WITH RISC-V SIMULATOR

        riscv64-unknown-elf-gcc -O1 -mabi=lp64 -march=rv64i -o filename.o filename.c

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_10_49 PM

To display the CODE IN THE TERMINAL

        cat filename.C

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_09_41 PM

TO generate the file

        ls -ltr filename.o

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_11_09 PM

STEP:5

ASSEMBLY CODE FOR THE PROGRAM

        riscv64-unknown-elf-objdump -d filename.o 

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_12_38 PM

The above code gives a bunch of assembly code so to simplify use the below code.

       riscv64-unknown-elf-objdump -d filename.o | less

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_13_07 PM

(as the above code gives a huge section but we need to Check the values in main and find them out by giving /main and n)

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_13_25 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_13_29 PM

STEP:6

DISPLAY THE ASSEMBLY CODE

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_13_37 PM

STEP:7

OBSERVE THE SAME BY REPLACING THE COMMAND WITH Ofast instead of O1 and display the assembly code

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_14_58 PM

replace O1 with Ofast in the command

   riscv64-unknown-elf-gcc -Ofast -mabi=lp64 -march=rv64i -o filename.o filename.c

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_14_58 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_15_07 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_15_11 PM

vsdworkshop  Running  - Oracle VM VirtualBox 7_30_2024 6_16_34 PM

About

This Github-Repo is to track the progress of my RISC-V based hands-on project research internship

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published