CO Project Presentation
CO Project Presentation
Part I: Assembler
Assembler Task
addi a0,zero,-5
addi a1,zero,3
sltiu t0,a0,-1
sltiu t1,a1,2 < Input Assembly code file
sll t2,a0,a1
sub a0,a0,a1
slt t3,zero,a0
beq zero,zero,0
11111111101100000000010100010011
00000000001100000000010110010011
11111111111101010011001010010011
00000000001001011011001100010011
Assembler 00000000101101010001001110110011
01000000101101010000010100110011
00000000101000000010111000110011
RV32I Format
00000000000000000000000001100011
R-Type Instruction
Label in Instruction
Address Instruction
0x00
start: add ra,sp,gp add ra,sp,gp
0x04
jalr t0,t1,4 jalr t0,t1,4
0x08
beq ra,sp,start beq ra,sp,-8
0x0C
beq zero,zero,0 beq
zero,zero,0
Note on “label”:
1. start is initialized with Instruction Address =0x00
2. start is decoded as start - current PC. And, keep in decimal format.
a. decode result = 0x00 - 0x08
3. If label is negative convert into 2’s complement format.
Assembler Evaluation
Step 3 : Go to :
evaluation_framework/automatedTesting
Step 4 :
linux users: $ python3 src/main.py --no-sim --linux
windows user: > python3 src\main.py --no-sim --windows
addi s1,zero,5
addi s2,zero,0
slt t1,zero,t0
srl s4,s2,s1
beq zero,zero,0 PC x0 x1 x2 … …….x31
4 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
16 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
20 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Data Memory
0x00010000:0
0x00010004:0
…
0x00010078:0
0x0001007C:0 Depiction Purpose (Decimal)
Simulator Output Rectification
PC x0 x1 x2 … …….x31
4 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0b00000000000000000000000000000100 …. binary(0)
Data Memory
0x00010000:binary(0) Note: The starting memory address is
… the specified data memory address.
0x0001007C:binary(0)
0x00010000:0b00000000000000000000000000000000
…
0x0001007C:0b00000000000000000000000000000000
Simulator Output Rectification continued
PC x0 x1 x2 … …….x31
4 0 0 380 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0b00000000000000000000000000000100 …. binary(0)
0b00000000000000000000000000000100 … 0b00000000000000000000000000000000
0b00000000000000000000000000001000 … 0b00000000000000000000000000000000
.
.
0x00010000:0b00000000000000000000000000000000
0x00010004:0b00000000000000000000000000000000
.
.
0x0001007C:0b00000000000000000000000000000000
Step 3 : Go to :
evaluation_framework/automatedTesting
Step 4 :
linux users: $ python3 src/main.py --no-asm --linux
windows user: > python3 src\main.py --no-asm --windows
Project TA
Naorem Akshaykumar
Keshav Goel
Ajinkya Ghawale
Priyanshu Kumar Rai
Vishal Kumar
Sameena Khan
Anushree Vardish
Manshaa Kapoor
Ekansh
Thanks