RISC-V SiFive U54Äںˡª¡ªÖÐÖ¹ºÍÒì³£Ïê½â
mstatus.MIE дÈë 0£¨Ä¬Èϸ´Î»Öµ£©À´È«¾Ö½ûÓÃÖÐÖ¹¡£½«»úеģʽÒì³£´¦Öóͷ£³ÌÐòµÄ»ùµØµãдÈë mtvec CSR¡£ÕâÊÇÈκÎÖ¸µ¼Á÷³ÌÖеıØÐè°ì·¨¡£½« mstatus.MPP дÈë 0 ÒÔ½«Ö®Ç°µÄģʽÉèÖÃΪ User£¬ÕâÔÊÐíÎÒÃÇ·µ»Øµ½¸Ãģʽ¡£ÉèÖÃÎïÀíÄÚ´æ±£»¤ (PMP) ÇøÓòÒÔ½«ËùÐèÇøÓòÊÚÓèÓû§ºÍÖ÷¹Üģʽ£¬²¢¿ÉÑ¡Ôñ´Ó»úеģʽµõÏúȨÏÞ¡£ÓÃÖ÷¹ÜģʽÒì³£´¦Öóͷ£³ÌÐòµÄ»ùµØµãдÈë stvec CSR¡£±àд medeleg ¼Ä´æÆ÷£¬½«Ò쳣ίÍиøÖ÷¹Üģʽ¡£Ë¼Á¿ ECALL ºÍÒ³Ãæ¹ýʧÒì³£¡£±àд mstatus.FS ÒÔÆôÓø¡µã£¨ÈôÊÇÖ§³Ö£©¡£½«»úеģʽÓû§¼Ä´æÆ÷´æ´¢µ½¿ÍÕ»»òÓ¦ÓóÌÐòÌض¨µÄÖ¡Ö¸Õë¡£ÓÃÓû§Ì¬Èí¼þµÄÈë¿Úµã±àдmepc
µÇ¼ºó¸´ÖÆ
mretÖ¸Áî½øÈëÓû§Ä£Ê½¡£Note£ºÖ»ÓÐÒ»×éÓû§¼Ä´æÆ÷ (x1 - x31) ÓÃÓÚËùÓÐȨÏÞ¼¶±ð£¬Òò´ËÓ¦ÓÃÈí¼þÈÏÕæÔÚ½øÈëºÍÍ˳ö²î±ð¼¶±ðʱÉúÑĺͻָ´×´Ì¬¡£ÍâµØÖÐÖ¹ Èí¼þÖÐÖ¹£¨ÖÐÖ¹ ID #3£©£ºÍ¨¹ýдÈëÌض¨ hart µÄÄÚ´æÓ³ÉäÖÐÖ¹¹ÒÆð¼Ä´æÆ÷ msip À´´¥·¢¡£×¼Ê±Æ÷ÖÐÖ¹£ºµ±¼Ä´æÆ÷ mtime ´óÓÚ»ò¼´ÊǼĴæÆ÷ mtimecmp ²¢ÇÒÁ½¸ö¼Ä´æÆ÷¶¼ÊÇ CLINT ÄÚ´æÓ³ÉäµÄÒ»²¿·Öʱ£¬»á´¥·¢×¼Ê±Æ÷ÖÐÖ¹£¨ÖÐÖ¹ ID #7£©¡£mtime ºÍ mtimecmp ¼Ä´æÆ÷ͨ³£½öÔÚ»úеģʽÏ¿ÉÓ㬳ý·Ç PMP ÊÚÓèÓû§»òÖÎÀíԱģʽ»á¼ûËüÃÇËùÔÚµÄÄÚ´æÓ³ÉäÇøÓòµÄȨÏÞ¡£È«¾ÖÖÐֹͨ³£Ê×ÏÈ·Óɵ½ PLIC£¬È»ºóʹÓÃÍⲿÖÐÖ¹½øÈë hart£¨ÖÐÖ¹ ID #11£©ÖÐÖ¹²Ù×÷ ÔÚÌØȨģʽ m ÄÚ£¬ÈôÊÇÏà¹ØµÄÈ«¾ÖÖÐֹʹÄÜ {ie} ÇåÁ㣬ÔòÔÚ¸ÃÌØȨģʽϲ»»á±¬·¢ÈκÎÖÐÖ¹£¬µ«¸ü¸ßÌØȨģʽϵĴý¾öÆôÓÃÖÐÖ¹½«ÇÀռĿ½ñÖ´ÐС£ÈôÊÇÉèÖÃÁË {ie}£¬ÔòÔÚÏàͬÌØȨģʽÏ´¦ÓÚ¸ü¸ßÖÐÖ¹¼¶±ðµÄ¹ÒÆðÆôÓÃÖÐÖ¹½«ÇÀռĿ½ñÖ´Ðв¢ÔËÐиü¸ßÖÐÖ¹¼¶±ðµÄÖÐÖ¹´¦Öóͷ£³ÌÐò¡£µ±±¬·¢ÖÐÖ¹»òͬ²½Ò쳣ʱ£¬»áÐÞ¸ÄÌØȨģʽÒÔ·´Ó¦ÐµÄÌØȨģʽ¡£´¦Öóͷ£³ÌÐòÌØȨģʽµÄÈ«¾ÖÖÐֹʹÄÜλ±»É¨³ýÖÐÖ¹½øÈëºÍÍ˳öµ±ÖÐÖ¹±¬·¢Ê±£º? mstatus.MIE µÄÖµ±»¸´ÖƵ½mcause.MPIE ÖУ¬È»ºómstatus.MIE ±»É¨³ý£¬ÓÐÓõؽûÓÃÁËÖÐÖ¹¡£? ÖÐֹǰµÄÌØȨģʽÔÚmstatus.MPP ÖбàÂë¡£? Ä¿½ñ pc ±»¸´ÖƵ½ mepc ¼Ä´æÆ÷ÖУ¬È»ºó½« pc ÉèÖÃΪ mtvec Ö¸¶¨µÄÖµ´Ëʱ£¬¿ØÖÆȨÒƽ»¸øÖÐÖ¹´¦Öóͷ£³ÌÐòÖеÄÈí¼þ£¬²¢½ûÓÃÖÐÖ¹¡£Ö´ÐÐ mret Ö¸Áîʱ£¬»á±¬·¢ÒÔÏÂÇéÐΣº? ÌØȨģʽÉèÖÃΪÔÚ mstatus.MPP ÖбàÂëµÄÖµ¡£? È«¾ÖÖÐֹʹÄÜ mstatus.MIE ÉèÖÃΪ mcause.MPIE µÄÖµ¡£? pc ÉèÖÃΪmepc µÄÖµ¡£´Ëʱ£¬¿ØÖÆȨ½»¸øÈí¼þ¡£ÖÐÖ¹¿ØÖƺÍ״̬¼Ä´æÆ÷ Machine Status Register (mstatus)mstatus ¼Ä´æÆ÷¸ú×Ù²¢¿ØÖÆ hart µÄÄ¿½ñ²Ù×÷״̬£¬°üÀ¨ÊÇ·ñÆôÓÃÖÐÖ¹¡£Í¨¹ýÉèÖà mstatus ÖÐµÄ MIE λÀ´ÆôÓÃÖÐÖ¹¡£ÔÚдÈë mstatus.MIE=1 ֮ǰ£¬½¨ÒéÏÈÔÚ mie ÖпªÆôÖÐÖ¹¡£Machine Trap Vector (mtvec)mtvec ¼Ä´æÆ÷ÓÐÁ½¸öÖ÷Òª¹¦Ð§£º½ç˵ÏÝÚåÏòÁ¿µÄ»ùµØµã£¬ÒÔ¼°ÉèÖà U54Äں˴¦Öóͷ£ÖÐÖ¹µÄģʽ¡£¹ØÓÚ Direct ºÍ Vectored ģʽ£¬ÖÐÖ¹´¦Öóͷ£Ä£Ê½ÔÚ mtvec ¼Ä´æÆ÷µÄ MODE ×Ö¶ÎÖнç˵¡£mtvec ¼Ä´æÆ÷ÔÚ±í 86 ÖÐÐÎò£¬mtvec.MODE ×Ö¶ÎÔÚ±í 87 ÖÐÐÎò¡£Mode DirectÔÚÖ±½ÓģʽϲÙ×÷ʱ£¬ËùÓÐÖÐÖ¹ºÍÒì³£¶¼»á²¶»ñµ½ mtvec.BASE µØµã¡£ÔÚÏÝÚå´¦Öóͷ£³ÌÐòÄÚ²¿£¬Èí¼þ±ØÐè¶ÁÈ¡ mcause ¼Ä´æÆ÷ÒÔÈ·¶¨´¥·¢ÏÝÚåµÄÔµ¹ÊÔÓÉ¡£ÔÚÖ±½ÓģʽϲÙ×÷ʱ£¬BASE ±ØÐèÊÇ 4 ×Ö½Ú¶ÔÆëµÄ¡£Mode VectoredÔÚÏòÁ¿Ä£Ê½ÏÂÔËÐÐʱ£¬ÖÐÖ¹½« pc ÉèÖÃΪ mtvec.BASE + 4 ¡Á Òì³£´úÂ루mcause.EXCCODE£©¡£ÀýÈ磬ÈôÊDZ¬·¢Æøе׼ʱÆ÷ÖÐÖ¹£¬Ôò½« pc ÉèÖÃΪ mtvec.BASE + 0x1C¡£Í¨³££¬ÏÝÚåÏòÁ¿±íÌî³äÓÐÌøתָÁÒÔ½«¿ØÖÆתÒƵ½Ìض¨ÓÚÖÐÖ¹µÄÏÝÚå´¦Öóͷ£³ÌÐò¡£ÔÚÏòÁ¿ÖÐֹģʽÏ£¬BASE ±ØÐèÊÇ 256 ×Ö½Ú¶ÔÆëµÄ¡£ËùÓлúеÍⲿÖÐÖ¹£¨È«¾ÖÖÐÖ¹£©¶¼Ó³Éäµ½Òì³£´úÂë 11¡£Òò´Ë£¬µ±ÆôÓÃÖÐÖ¹ÏòÁ¿Ê±£¬pc ÉèÖÃΪÈκÎÈ«¾ÖÖÐÖ¹µÄµØµã mtvec.BASE + 0x2C¡£Machine Interrupt Enable (mie)ͨ¹ýÉèÖà mie ¼Ä´æÆ÷ÖеÄÏìӦλÀ´ÆôÓø÷ÆäÖÐÖ¹¡£Machine Interrupt Pending (mip)»úеÖÐÖ¹¹ÒÆð (mip) ¼Ä´æÆ÷ָʾĿ½ñÄÄЩÖÐÖ¹´¦ÓÚ¹ÒÆð״̬¡£ÌØȨģʽÖÐÖ¹ U54ÄÚºËÖ§³ÖÓÐÑ¡ÔñµØ½«ÖÐÖ¹ºÍÒì³£¶¨Ïòµ½Sģʽ¡£¸Ã¹¦Ð§ÓÉÖÐÖ¹ºÍÒ쳣ίÍÐCSR´¦Öóͷ££ºmidelegºÍmedeleg¡£SģʽÖÐÖ¹ºÍÒì³£¿ÉÒÔͨ¹ýstvec¡¢sip¡¢sie ºÍ scause ÖÎÀí¡£ÔÚMģʽÏ£¬Èí¼þ»¹¿ÉÒÔÖ±½ÓдÈëSIP¼Ä´æÆ÷£¬´Ó¶øÓÐÓõØÏòSģʽ·¢ËÍÖÐÖ¹¡£Õâ¹ØÓÚ׼ʱÆ÷ºÍÈí¼þÖÐÖ¹ÌØÊâÓÐÓã¬ÓÉÓÚ¿ÉÄÜÐèÒªÔÚMģʽºÍSģʽÏ´¦Öóͷ£ÕâЩÖÐÖ¹¡£Delegation Registers (mideleg and medeleg)ĬÈÏÇéÐÎÏ£¬ËùÓеÄtrap¶¼ÔÚMģʽÏ´¦Öóͷ£¡£MģʽÏÂÈí¼þ¿ÉÒÔͨ¹ýCSR ÓÐÑ¡ÔñµØ½«ÖÐÖ¹ºÍÒ쳣ίÍиøSģʽ¡£ÏêϸµÄÓ³ÉäÈç±í 92 ºÍ±í 93 ¡£×¢ÖØ£¬ÍâµØÖÐÖ¹¿ÉÒÔίÍиøMģʽ¡£Supervisor Status Register (sstatus)ÓëMģʽÀàËÆ£¬SģʽÓÐÒ»¸ö¼Ä´æÆ÷£¬×¨ÃÅÓÃÓÚ¸ú×Ù hart µÄÄ¿½ñ״̬£¬³ÆΪ sstatus¡£sstatus ÏÖʵÉÏÊÇ mstatus µÄÊÜÏÞÊÓͼ£¬ÓÉÓÚ¶Ô sstatus Ëù×öµÄ¸ü¸Ä·´Ó¦ÔÚ mstatus ÖС£Í¨¹ýÔÚ sstatus ÖÐÉèÖà SIE λ²¢ÔÚ sie ¼Ä´æÆ÷ÖÐÆôÓÃËùÐèµÄµ¥ÆäÖÐÖ¹À´ÆôÓÃÖÐÖ¹¡£Supervisor Interrupt Enable Register (sie)ͨ¹ýÔÚ sie ¼Ä´æÆ÷ÖÐÉèÖÃÊʵ±µÄλÀ´ÆôÓÃÖÎÀíÔ±ÖÐÖ¹¡£Supervisor Interrupt Pending (sip)SģʽÖÐÖ¹¹ÒÆð (sip) ¼Ä´æÆ÷ָʾĿ½ñÄÄЩÖÐÖ¹¹ÒÆð¡£Supervisor Cause Register (scause)µ±Sģʽϲ¶»ñÏÝÚåʱ£¬½«µ¼ÖÂÏÝÚåµÄÊÂÎñµÄ´úÂëдÈë cause¡£µ±µ¼ÖÂÏÝÚåµÄÊÂÎñÊÇÖÐֹʱ£¬×î¸ßÓÐÓÃλ scause ÉèÖÃΪ 1£¬×îµÍÓÐÓÃλÌåÏÖÖÐÖ¹ºÅ£¬Ê¹ÓÃÓë sip ÖеÄλÖÃÏàͬµÄ±àÂë¡£ÀýÈ磬Sģʽ׼ʱÆ÷ÖÐÖ¹µ¼Ö cause ±»ÉèÖÃΪ 0x8000_0000_0000_0005¡£scause Ò²ÓÃÓÚָʾͬ²½Òì³£µÄÔµ¹ÊÔÓÉ£¬ÔÚÕâÖÖÇéÐÎÏ£¬scause µÄ×î¸ßÓÐÓÃλÉèÖÃΪ 0¡£ÓйØͬ²½Òì³£´úÂëµÄÁÐ±í£¬Çë°Ý¼û±í 98¡£Supervisor Trap Vector (stvec)ĬÈÏÇéÐÎÏ£¬ËùÓÐÖÐÖ¹¶¼»á²¶»ñµ½ stvec ¼Ä´æÆ÷Öнç˵µÄµ¥¸öµØµã¡£ÓÉÖÐÖ¹´¦Öóͷ£³ÌÐò¶ÁÈ¡Ôµ¹ÊÔÓɲ¢×ö³öÏìÓ¦µÄ·´Ó¦¡£RISC?V ºÍ U54 Äں˻¹Ö§³ÖÑ¡ÔñÐÔµØÆôÓÃÖÐÖ¹ÏòÁ¿µÄÄÜÁ¦¡£µ±ÆôÓÃÏòÁ¿Ê±£¬ÔÚ sie Öнç˵µÄÿÆäÖÐÖ¹¶¼»áÏÝÈëµ½Ëü×Ô¼ºµÄÌض¨ÖÐÖ¹´¦Öóͷ£³ÌÐòÖС£µ± stvec ¼Ä´æÆ÷µÄ MODE ×Ö¶ÎÉèÖÃΪ 1 ʱ£¬ÏòÁ¿ÖÐÖ¹±»ÆôÓá£ÈôÊÇÏòÁ¿ÖÐÖ¹±»½ûÓà (stvec.MODE=0)£¬ËùÓÐÖÐÖ¹¶¼»áÏÝÈë stvec.BASE µØµã¡£ÈôÊÇÆôÓÃʸÁ¿ÖÐÖ¹ (stvec.MODE=1)£¬ÖÐÖ¹½« pc ÉèÖÃΪ stvec.BASE + 4 ¡Á Òì³£´úÂë (scause.EXCCODE)¡£ÀýÈ磬ÈôÊDZ¬·¢ÖÎÀí׼ʱÆ÷ÖÐÖ¹£¬Ôò pc ÉèÖÃΪ stvec.BASE + 0x14¡£Í¨³££¬ÏÝÚåÏòÁ¿±íÖÐÌî³äÓÐÌøתָÁÒÔ½«¿ØÖÆתÒƵ½Ìض¨ÓÚÖÐÖ¹µÄÏÝÚå´¦Öóͷ£³ÌÐò¡£ÔÚÏòÁ¿ÖÐֹģʽÏ£¬BASE ±ØÐèÊÇ 128 ×Ö½Ú¶ÔÆëµÄ¡£ËùÓÐÖ÷¹ÜÍⲿÖÐÖ¹£¨È«¾ÖÖÐÖ¹£©¶¼Ó³Éäµ½Òì³£´úÂë 9¡£Òò´Ë£¬µ±ÆôÓÃÖÐÖ¹ÏòÁ¿Ê±£¬pc ±»ÉèÖÃΪÈκÎÈ«¾ÖÖÐÖ¹µÄµØµã stvec.BASE + 0x24¡£Delegated Interrupt Handling½ÓÊÜίÅÉÏÝÚåºó£¬»á±¬·¢ÒÔÏÂÇéÐΣºsstatus.SIE µÄÖµ±»¸´ÖƵ½ sstatus.SPIE£¬È»ºó sstatus.SIE ±»É¨³ý£¬ÓÐÓõؽûÓÃÖÐÖ¹¡£Ä¿½ñpc±»¸´ÖƵ½sepc¼Ä´æÆ÷ÖУ¬È»ºópc±»ÉèÖÃΪstvecµÄÖµ¡£ÔÚÆôÓÃʸÁ¿ÖÐÖ¹µÄÇéÐÎÏ£¬pc ÉèÖÃΪ stvec.BASE + 4 ¡Á Òì³£´úÂë (scause.EXCCODE)¡£ÖÐֹǰµÄÌØȨģʽ±àÂëÔÚ sstatus.SPP ÖдËʱ£¬¿ØÖÆȨÒƽ»¸øÖÐÖ¹´¦Öóͷ£³ÌÐòÖеÄÈí¼þ£¬ÖÐÖ¹±»½ûÓ᣿ÉÒÔͨ¹ýÏÔʽÉèÖà sstatus.SIE »òÖ´ÐÐ SRET Ö¸ÁîÍËÀ´ÓÉÖóÌÐòÀ´ÖØÐÂÆôÓÃÖÐÖ¹¡£Ö´ÐÐ SRET Ö¸Áîʱ£¬»á±¬·¢ÒÔÏÂÇéÐΣºÌØȨģʽÉèÖÃΪ sstatus.SPP ÖбàÂëµÄÖµstatus.SPIE µÄÖµ±»¸´ÖƵ½ status.SIE
µÇ¼ºó¸´ÖÆ
pc ÉèÖÃΪ sepc µÄÖµ
´Ëʱ£¬¿ØÖÆȨ½»¸øÁËÈí¼þ
ÖÐÖ¹ÑÓ³Ù
U54Äں˵ÄÖÐÖ¹ÑÓ³ÙΪËĸö external_source_for_core_N_clock ÖÜÆÚ£¬ÅÌËã·½·¨ÊÇ´ÓÏò hart ·¢ËÍÖÐÖ¹ÐźÅËæ´¦Öóͷ£³ÌÐòµÄµÚÒ»¸öÖ¸Áî»ñÈ¡ËùÐèµÄÖÜÆÚÊý¡£
ͨ¹ý PLIC ·ÓɵÄÈ«¾ÖÖÐÖ¹»áµ¼ÖÂÈý¸öʱÖÓÖÜÆÚµÄÌØÊâÑÓ³Ù£¬ÆäÖÐ PLIC ÓÉʱÖÓ¼Æʱ¡£ÕâÒâζ×ÅÈ«¾ÖÖÐÖ¹µÄ×ÜÑÓ³Ù£¨ÒÔÖÜÆÚΪµ¥Î»£©Îª£º4 + 3 ¡Á (external_source_for_core_N_clock Hz ¡Â clock Hz)¡£ÕâÊÇ×î¼ÑÇéÐÎϵÄÑ»·¼ÆÊý£¬²¢¼Ù¶¨´¦Öóͷ£³ÌÐòÒÑ»º´æ¡£ËüûÓÐ˼Á¿À´×ÔÍâΧԴµÄÌØÊâÑÓ³Ù
²»¿ÉÆÁÕÏÖÐÖ¹
rnmi£¨¿É»Ö¸´²»¿ÉÆÁÕÏÖÐÖ¹£©ÖÐÖ¹ÐźÅÊÇ hart µÄµçƽÃô¸ÐÊäÈë¡£²»¿ÉÆÁÕÏÖÐÖ¹±È hart ÉϵÄÈκÎÆäËûÖÐÖ¹»òÒì³£¾ßÓиü¸ßµÄÓÅÏȼ¶£¬²¢ÇÒ²»¿É±»Èí¼þ½ûÓá£ÏêϸÀ´Ëµ£¬ËüÃDz»»áͨ¹ýɨ³ý mstatus.mie ¼Ä´æÆ÷À´½ûÓá£
Handler Addresses
NMI ÓÐÒ»¸ö¹ØÁªµÄÒì³£ÏÝÚå´¦Öóͷ£³ÌÐòµØµã¡£¸ÃµØµãÓÉÍⲿÊäÈëÐźÅÉèÖá£
RNMI CSRs
ÕâЩ M ģʽ CSR ÆôÓÿɻָ´·ÇÆÁÕÏÖÐÖ¹ (RNMI)¡£
mnscratch CSR ÓµÓÐÒ»¸ö 64 λ¶Áд¼Ä´æÆ÷£¬Ëüʹ NMI ÏÝÚå´¦Öóͷ£³ÌÐòÄܹ»ÉúÑĺͻָ´±»ÖÐÖ¹µÄÉÏÏÂÎÄ¡£
mnepc CSR ÊÇÒ»¸ö 64 λ¶Áд¼Ä´æÆ÷£¬ÔÚ½øÈë NMI ÏÝÚå´¦Öóͷ£³ÌÐòʱ£¬ËüÉúÑĽÓÊÜÖÐÖ¹µÄÖ¸ÁîµÄ PC¡£mnepc µÄ×îµÍλӲÁ¬ÏßΪÁã¡£
mncause CSR °üÀ¨ NMI µÄÔµ¹ÊÔÓÉ£¬µÚ 63 λÉèÖÃΪ 1£¬²¢ÇÒ NMI Ôµ¹ÊÔÓɱàÂëÔÚ×îµÍÓÐÓÃλÖУ¬ÈôÊDz»Ö§³Ö NMI Ôµ¹ÊÔÓÉ£¬ÔòΪÁã¡£mncause µÄµÍ룬½ç˵Ϊ exception_code£¬ÈçÏ£º
mnstatus CSR °üÀ¨Ò»¸öÁ½Î»×ֶΣ¬ÔÚ½øÈëÏÝÚå´¦Öóͷ£³ÌÐòʱ£¬Ëü°üÀ¨ÒÔÓë mstatus.mpp ÏàͬµÄ·½·¨±àÂëµÄÖÐÖ¹ÉÏÏÂÎĵÄÌØȨģʽ
MNRET Instruction
´Ë½ö M ģʽָÁîʹÓà mnepc ºÍ mnstatus ÖеÄÖµ»®·Ö·µ»ØÖÐÖ¹ÉÏÏÂÎĵijÌÐò¼ÆÊýÆ÷ºÍÌØȨģʽ¡£¸ÃÖ¸ÁÉèÖÃÄÚ²¿ rnmie ״̬λ¡£
±àÂëÓë MRET Ïàͬ£¬³ýÁËµÚ 30 λÉèÖ㨼´ funct7=0111000£©¡£ÀýÈ磺
.word 0x70200073 // opcode for MNRET (return from RNMI)
µÇ¼ºó¸´ÖÆ
RNMI Operation
µ±¼ì²âµ½RNMIÖÐֹʱ£¬½«ÖÐÖ¹µÄPCдÈëmnepc CSR£¬RNMIµÄÀàÐÍдÈëmncause CSR£¬ÖÐÖ¹ÉÏÏÂÎĵÄÌØȨģʽдÈëmnstatus CSR¡£ÄÚ²¿Î¢ÏµÍ³½á¹¹×´Ì¬Î» rnmie ±»É¨³ýÒÔָʾ´¦Öóͷ£Æ÷´¦ÓÚ RNMI ´¦Öóͷ£³ÌÐòÖв¢ÇÒ²»¿É½ÓÊÜÐ嵀 RNMI ÖÐÖ¹¡£É¨³ýʱ£¬ÄÚ²¿ rnmie λ»¹»á½ûÓÃËùÓÐÆäËûÖÐÖ¹
ÕâЩÖÐÖ¹±»³ÆΪ²»¿ÉÆÁÕϵģ¬ÓÉÓÚÈí¼þÎÞ·¨ÆÁÕÏÖÐÖ¹¡£¿ÉÊÇ£¬ÎªÁË׼ȷ²Ù×÷£¬±ØÐèÍƳÙͳһÖÐÖ¹µÄÆäËûʵÀý£¬Ö±Ëæ´¦Öóͷ£³ÌÐòÍê³É£¬Òò´ËÄÚ²¿×´Ì¬Î»
RNMI ´¦Öóͷ£³ÌÐò¿ÉÒÔʹÓà MNRET Ö¸ÁÔÚµÚ 7.11.3 ½ÚÖÐÐÎò£©»Ö»Ø¸´Ê¼Ö´ÐУ¬¸ÃÖ¸Áî´Ó mnepc »Ö¸´ PC£¬´Ó mnstatus »Ö¸´ÌØȨģʽ£¬²¢ÉèÖÃÄÚ²¿ rnmie ״̬룬ÖØÐÂÆôÓÃÆäËûÖÐÖ¹¡£
ÈôÊÇhartÔÚrnmieλÇåÁãʱÓöµ½Òì³££¬Ôò½«Ò쳣״̬дÈëmepcºÍmcause£¬mstatus.mppÉèÖÃΪM-mode£¬hartÌøתµ½RNMIÒì³£´¦Öóͷ£³ÌÐòµØµã¡£
RNMI ´¦Öóͷ£³ÌÐòÖеÄÏÝÚåÖ»ÓÐÔÚ´¦Öóͷ£³ÌÐòÕýÔÚЧÀͱ¬·¢ÔÚ»úеģʽ֮ÍâµÄÖÐֹʱ±¬·¢Ê±²Å»ª»Ö¸´¡£
ÒÔÉϾÍÊÇRISC-V SiFive U54Äںˡª¡ªÖÐÖ¹ºÍÒì³£Ïê½âµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡