--- Log opened Thu Aug 10 00:00:53 2017 | ||
mithro | shorne: Should a divide by zero exception work in the or1k qemu? | 05:23 |
---|---|---|
mithro | I'm pretty sure the following ASM http://pastebin.ubuntu.com/25282486/ (from the code at http://pastebin.ubuntu.com/25282460/) should cause a divide by zero exception? | 05:38 |
mithro | Do I have to do something special to "turn on" the exception handling? | 05:46 |
mithro | Looks like I need a mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_OVE); to enable that... | 06:33 |
mithro | shorne: Did you have a fix for this error? | 06:46 |
mithro | ../../gdb/or1k-tdep.c:1017: internal-error: or1k_skip_prologue: Assertion `or1k_analyse_l_addi (inst, &rd, &ra, &simm) && (OR1K_FP_REGNUM == rd) && (OR1K_SP_REGNUM == ra) && (simm == frame_size)' failed. | 06:46 |
mithro | Hrm, should the mor1k fail on an unaligned access? | 07:34 |
shorne | mithro: Both should cause exception vectors | 07:46 |
shorne | I have never run into those errors | 07:46 |
shorne | (if the vectors are enabled) | 07:47 |
mithro | shorne: After enabling the SPR_SR_OVE I get an exception on the div by zero -> http://pastebin.ubuntu.com/25283058/ | 07:47 |
shorne | OVE | 07:47 |
shorne | Overflow flag Exception | 07:47 |
shorne | exception 0x600 | 07:48 |
shorne | Load/store access to naturally not aligned location. | 07:48 |
shorne | exception 0xB00, for range exception (includes overflow) | 07:49 |
mithro | shorne: But I'm not getting an exception on not aligned... http://pastebin.ubuntu.com/25283172/ should work right? | 07:50 |
shorne | its saying "Unhandled exception 11" | 07:51 |
shorne | is that the same as B00? 1<<11 | 07:51 |
mithro | shorne: I assume so, that exception 11 is when I do a div/0 | 07:53 |
shorne | no thats, 800 | 07:53 |
shorne | 11 is B though | 07:54 |
shorne | Is qemu printing unhandled exception 11? | 07:54 |
shorne | I guess so | 07:54 |
mithro | shorne: No, our exception handler is | 07:55 |
mithro | shorne: https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/libbase/exception.c | 07:55 |
shorne | EXCP_RANGE = 0xb, | 07:56 |
shorne | I see... sorry I was just rambling looking at things | 07:58 |
shorne | I am guessing this code will cause the unaligned access | 08:00 |
shorne | char a[5]; | 08:00 |
shorne | int *b = (int *)&a[1]; | 08:00 |
mithro | Our exception vectors are setup at https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/libbase/crt0-or1k.S | 08:00 |
mithro | shorne: Yeah, that is what I thought, but it just seems to continuing straight past it without any issues... | 08:01 |
shorne | thats a 32-bit access at a[1] | 08:01 |
shorne | what does the assembly look like? | 08:01 |
mithro | shorne: http://pastebin.ubuntu.com/25283221/ | 08:03 |
shorne | I see, one thing that might break gdb is how you setup the stack for the function call | 08:04 |
shorne | gdb is trying to look at the code in the prolog to find certain stack details like frame size, return address | 08:05 |
shorne | it scans for an add before the return address | 08:06 |
shorne | (I think... maybe I have a fix for this gdb Assert failure) | 08:06 |
shorne | mithro: yes, I have fixed that gdb issue in my branch here | 08:08 |
shorne | https://github.com/stffrdhrn/binutils-gdb/tree/or1k-upstream-v8 | 08:08 |
shorne | The actual fix is merged into the or1k-tdep.c config (but basically I just bail out of the stack trace instead of failing the assert) | 08:08 |
shorne | ~ | 08:09 |
shorne | But your handler looks like it will work, just strange the unaligned access is not failing | 08:09 |
shorne | Maybe a qemu quirk? | 08:10 |
shorne | Got to go | 08:10 |
mithro | shorne: Your branch doesn't seem to compile... http://pastebin.ubuntu.com/25283274/ | 08:13 |
shorne | mithro: let me see, I think that function is coming from another part of binutils | 09:10 |
shorne | no, you are right, I need to push that change to my branch | 09:15 |
shorne | mithro: I updated sorry about that, I have put gdb on my backburner while working on the linux stuff | 09:16 |
mithro | shorne: I'm hoping to get back to my Linux+QEMU stuff shortly | 09:22 |
shorne | mithro: for linux SMP, I have a few more cleanups to do, then it should be ready for review | 09:24 |
shorne | 1. atomic ops only support 32-bit right now, will pull generic code out of mips/sh and use for openrisc to handle 1/2 byte ops | 09:25 |
shorne | 2. update cpuinfo printing to use the generic cache framework | 09:26 |
shorne | 3. unhacky way to fix timer sync issue (previous attempt to use a sync method didnt work due to what looks like a cache sync issue) | 09:27 |
shorne | 4. clean up all of the commit messages | 09:27 |
shorne | .... Then also need to | 09:28 |
shorne | 1. clean up my smp qemu patches for upstreaming | 09:28 |
shorne | 2. update openrisc architecture spec to describe the things not documented | 09:29 |
-!- ZipCPU_ is now known as ZipCPU | 15:53 | |
mithro | Is anyone here able to explain NASTI in RISC-V? | 16:57 |
imphil | mithro, it's just AXI renamed afaik | 17:12 |
-!- andrzejr_ is now known as andrzejr | 22:19 | |
--- Log closed Fri Aug 11 00:00:54 2017 |
Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!