RSLI register not changing

78 views
Skip to first unread message

Bianca M

unread,
Oct 8, 2020, 11:44:55 PM10/8/20
to cmpt-295-sfu
SFU ID:301366608
Github username:biancago
Line and file: line 203 part2.c
Expected behavior: return rd = 10 0x0a
Observed behavior: returs rd= 11 0x0b
Question: I have no clue why the actual value says its 0x0b when I checked the register it's 0x0a and even printed it out





Bianca M

unread,
Oct 8, 2020, 11:59:44 PM10/8/20
to cmpt-295-sfu
sorry I meant he rd is 0x0a but the register is still 0xb

Parmida Vahdatnia

unread,
Oct 9, 2020, 12:04:03 AM10/9/20
to cmpt-295-sfu
I can't understand what you're doing in your SRL and SRA, either insert comments in your code so I could go through it or try to implement it with a switch case of if-else statement checking  instruction.rtype.funct7, it will clean up your code and make debugging easier. 

Bianca M

unread,
Oct 9, 2020, 12:37:12 AM10/9/20
to cmpt-295-sfu
 I just wrote comments on my SRAI and SRLI

Bianca M

unread,
Oct 9, 2020, 1:21:40 AM10/9/20
to cmpt-295-sfu
I tried returning rd = 10   but still converts it to 11 ,   i tried returning other values like 26 0x1a and it makes it into 0x1b

Bianca M

unread,
Oct 9, 2020, 5:17:19 AM10/9/20
to cmpt-295-sfu
I've already checked store, load, and every instruction and none of them are causing it... I'm so lost.

Artun

unread,
Oct 9, 2020, 11:55:28 AM10/9/20
to cmpt-295-sfu
I had the same problem with my SRLI. I changed my switch statement to if/else statements for SRLI/SRAI and it's working now.

Arrvindh Shriraman

unread,
Oct 9, 2020, 12:57:55 PM10/9/20
to cmpt-295-sfu
1. Your shifting is bogus. 

Note that shift values have to be between 0..31; right now your wont be; I will let you figure out why.

2. Not sure why you need filter; 

3. Switch-case is also appears bogus. If you convert it to if-else it will be easier to spot the bug if any.
Reply all
Reply to author
Forward
0 new messages