Assign 2 - Part 2 - Random Test

110 views
Skip to first unread message

Danial

unread,
Oct 8, 2020, 8:33:14 PM10/8/20
to cmpt-295-sfu

SFU ID: 301390696 (danialk)
Github username: danialkhan4
Line and file:  part2.c (line unknown)
Expected behavior: pass all tests
Observed behavior: all tests passed except random
Question:

When running bash ./scripts/localci.sh I get the following error:

### *****python3 part2_tester.py random*****
```
Starting random test
ERROR: instruction 8, register 5. Expected: 0xffffffff, Actual: 0xfffff41f
ERROR: instruction 9, register 10. Expected: 0x00000001, Actual: 0x00000000
ERROR: instruction 10, register 5. Expected: 0x00000000, Actual: 0xfffff41f
ERROR: instruction 12, register 10. Expected: 0x0000000a, Actual: 0x00000015
ERROR: reference trace finished before student trace
random test has failed.


- My output random.trace file is more lines than the reference random.trace

- for instruction 8, the actual value is changing when I redo my test, for example if i run bash again without remaking, I get a different value like 0xfffff41f or sometimes no error




Danial

unread,
Oct 8, 2020, 8:44:36 PM10/8/20
to cmpt-295-sfu

random.trace file at instruction 7, 8, 9

Arrvindh Shriraman

unread,
Oct 8, 2020, 10:16:43 PM10/8/20
to cmpt-295-sfu
PC is broken; you are jumping somewhere in the middle and jumping again. Hard to debug; track down the value of the PC after every instruction.
random is just straight line code so you should just be running instructions in code.

Danial

unread,
Oct 8, 2020, 10:45:26 PM10/8/20
to cmpt-295-sfu
It seems it increments normally for every instruction, after the final instruction I get Illegal ecall number 30
 
It should stop at instruction 14 but continues to instruction 19 

Arrvindh Shriraman

unread,
Oct 9, 2020, 11:20:03 AM10/9/20
to cmpt-295-sfu

Then check the implementation of instructions that write to a0
Reply all
Reply to author
Forward
0 new messages