For a research project, I needed to generate a lot of exceptions.  For
this, I repurposed the illegal instruction exception.  I found a bug where
the EPCR was loaded with the wrong address.  The patch below fixes this
problem and has serviced over 1 billion exceptions both with Linux and in
bare metal.

At a higher level, is there any reason why different exceptions should have
different EPCR values?  It seems like having a single EPCR selection logic
would simplify things and probably eliminate subtle (hard to detect and
correct) bugs.  Note that the patch I submitted matches (coincidentally)
the range exception.



Index: or1200_except.v
===================================================================
--- or1200_except.v (revision 868)
+++ or1200_except.v (working copy)
@@ -518,7 +518,9 @@
        except_type <=  `OR1200_EXCEPT_ILLEGAL;
        eear <=  ex_pc;
        epcr <=  ex_dslot ?
-       wb_pc : ex_pc;
+       wb_pc : delayed1_ex_dslot ?
+ dl_pc : delayed2_ex_dslot ?
+ id_pc : ex_pc;
        dsx <= ex_dslot;
     end
 `endif
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to