[Libre-soc-bugs] [Bug 1193] New: TrapTestCase.case_2_rfid is broken, without an obvious fix

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Oct 20 02:12:18 BST 2023


            Bug ID: 1193
           Summary: TrapTestCase.case_2_rfid is broken, without an obvious
           Product: Libre-SOC's first SoC
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: CONFIRMED
          Severity: minor
          Priority: ---
         Component: Source Code
          Assignee: lkcl at lkcl.net
          Reporter: programmerjake at gmail.com
                CC: libre-soc-bugs at lists.libre-soc.org
   NLnet milestone: ---


    def case_2_rfid(self):
        lst = ["rfid"]
        initial_regs = [0] * 32
        initial_regs[1] = 1
        initial_sprs = {'SRR0': 0x12345678, 'SRR1': 0xb000000000001033}
        e = ExpectedState(pc=0x700)
        e.intregs[1] = 1
        e.msr = 0xb000000000001033  # TODO, not actually checked
        self.add_case(Program(lst, bigendian),
                      initial_regs, initial_sprs,

pc=0x700 looks just plain wrong, since we are in privileged mode...I don't
think the fix is obvious since it looks like it was trying to test that rfid
causes a privileged instruction trap when running in problem mode...

The ExpectedState I get if expected=None (pc changed to hex):
        e = ExpectedState(pc=0x12345678)
        e.intregs[1] = 0x1
        e.sprs['SRR0'] = 0x12345678
        e.sprs['SRR1'] = 0xb000000000001033
        e.msr = 0xa000000000000033

msr looks wrong, the MSB end should be 0xb... not 0xa... since:
MSR[0:2] <- SRR1[0:2]

Since I need to ensure all the trap opcodes work correctly when fixing bug
#1066 after it was reverted, I'm marking TrapTestCase.case_2_rfid as skipped
with a FIXME for now.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list