[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


https://bugs.libre-soc.org/show_bug.cgi?id=1193

            Bug ID: 1193
           Summary: TrapTestCase.case_2_rfid is broken, without an obvious
                    fix
           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: ---

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/trap/trap_cases.py;h=32b20125f8f54fd67174c8545a0ea3392b365053;hb=30f2d8a8e92ad2939775f19e6a0f387499e9842b#l77

    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,
                      initial_msr=0xa000000000000003,
                      expected=e)

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