{"id":283969,"date":"2017-03-27T16:05:06","date_gmt":"2017-03-27T12:05:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283969"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283969","title":{"rendered":"MIPSfpga \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f"},"content":{"rendered":"<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 MIPS32 Release 2, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439.<br \/>  \u0412\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 github \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 mipsfpga-plus [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\">L3<\/a>].<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f3a\/b48\/538\/f3ab4853852145308ccc31bc3ac0e9d2.png\" alt=\"image\"\/><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vvedenie\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430 \u0425\u0430\u0440\u0440\u0438\u0441-\u044d\u043d\u0434-\u0425\u0430\u0440\u0440\u0438\u0441 [<a href=\"https:\/\/habrahabr.ru\/post\/259505\/\">L1<\/a>];<\/li>\n<li>\u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 (\u043b\u044e\u0431\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b), \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u0432 \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439;<\/li>\n<li>\u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u0430\u043c MIPSfpga [<a href=\"https:\/\/habrahabr.ru\/post\/275215\/\">L2<\/a>] \u0438 mipsfpga-plus [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\">L3<\/a>];<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043d\u0435 \u0441\u0442\u0430\u0432\u043b\u044e \u0446\u0435\u043b\u044c \u0432\u0441\u0435\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435 \u0438\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u044f\u0434\u0435\u0440 MIPS microAptiv, \u0442.\u043a. \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e \u0431\u044b \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u043e\u0431\u044a\u0435\u043c\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u0426\u0435\u043b\u044c \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0442\u0440\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445: \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0431\u0435\u0433\u043b\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>MIPS32 microAptiv UP Processor Core Family Integrator\u2019s Guide [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D1_MicroAptiv_UP_Integrators_Guide_MD00941.pdf\">D1<\/a>]<br \/>  (\u0440\u0430\u0437\u0434\u0435\u043b 4 &quot;Interrupt Interface&quot;);<\/li>\n<li>MIPS32 microAptiv UP Processor Core Family Software User\u2019s Manual [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>]<br \/>  (\u0440\u0430\u0437\u0434\u0435\u043b\u044b: 5.1-5.6 &quot;Exceptions and Interrupts in the microAptiv UP Core&quot;, 6.2.13 &quot;Count Register&quot;, 6.2.15 &quot;Compare Register&quot;, 6.2.16 &quot;Status Register&quot;, 6.2.17 &quot;IntCtl Register&quot;, 6.2.22 &quot;Cause Register&quot;, 6.2.28 &quot;EBase Register&quot;, 6.2.33 &quot;Config3 Register&quot;);<\/li>\n<li>Codescape GNU Tools for MIPS Programmer&#8217;s Guide [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D3_MIPS_Toolchain_Codescape_GNU_Tools_for_MIPS_Programmers_Guide_1.1.97.pdf\">D3<\/a>]<br \/>  (\u0440\u0430\u0437\u0434\u0435\u043b\u044b: 15.5. &quot;Exceptions&quot;, 15.6. &quot;Interrupts&quot;).<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 mipsfpga-plus, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0432 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435. \u0421 \u0440\u0430\u0432\u043d\u044b\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0438 \u043d\u0430 \u0436\u0435\u043b\u0435\u0437\u0435 \u2014 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Terasic DE10-Lite [<a href=\"http:\/\/de10-lite.terasic.com\/\">L4<\/a>].<\/p>\n<p>  <\/p>\n<h3 id=\"prinyatye-oboznacheniya\">\u041f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u0443\u0440\u0441\u0438\u0432\u043e\u043c ( <em>SI_Int[7:0]<\/em> ), \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435, \u0442\u043e \u0432\u0441\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b MIPSfpga (m14k_top). \u0414\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442 ( <strong>Count<\/strong> ), \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 (\u043f\u043e\u043b\u0435\u0439) \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f ( <strong>Cause.DC<\/strong> ), \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u043a\u0430\u0445 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 ( <strong>Cause<sub>IV<\/sub><\/strong> ). \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0448\u0438\u0440\u0438\u043d\u0430 x32, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0432 \u0432\u044b\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u043a\u0430\u0445 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c &quot;\u0440\u0435\u0448\u0435\u0442\u043a\u0430&quot; (16#180, 2#00001).<br \/>  \u0422.\u043a. \u0432 MIPSfpga, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043e\u043f\u0446\u0438\u044f &quot;GPR Shadow Registers&quot; (Shadow Register Set, SRS), \u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0443\u0449\u0435\u043d\u044b \u0434\u0435\u0442\u0430\u043b\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0435\u043d\u0435\u0432\u044b\u043c\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0422\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0445\u0435\u043c\u0430\u0445 \u2014 \u043e\u043d\u0430 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0430 \u0441\u0435\u0440\u044b\u043c (\u0431\u043b\u0435\u043a\u043b\u044b\u043c) \u0446\u0432\u0435\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"obrabotka-isklyucheniy\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0432 kernel mode: \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u043e\u043b\u044c \u0438 \u0442.\u0434., \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0448\u0438\u0440\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u0440\u044b\u0432\u0435 \u043e\u0442 \u044f\u0434\u0440\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u041e\u0421), \u0447\u0442\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u041e\u0421 \u043d\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f (Bare Metal code), \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0432\u0441\u0435 \u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0444\u0430\u043a\u0442\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0443\u0445\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 &quot;\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u043b\u0430\u0432\u0430\u043d\u0438\u0435&quot;.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043b\u0435\u0433\u043a\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>if Status.EXL = 1 then     vectorOffset \u2190 16#180 else     if ExceptionType = TLBRefill then         vectorOffset \u2190 16#000     elseif (ExceptionType = Interrupt) then         \/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f         if (Cause.IV = 0) then             vectorOffset \u2190 16#180         else             if (Status.BEV = 1) or (IntCtl.VS = 0) then                 vectorOffset \u2190 16#200             else                 if Config3.VEIC = 1 then                     VecNum \u2190 Cause.RIPL                 else                     VecNum \u2190 VIntPriorityEncoder()                 endif                 vectorOffset \u2190 16#200 + (VecNum \u00d7 (IntCtl.VS || 2#00000))             endif         endif     endif endif  Cause.ExcCode \u2190 ExceptionType  \/\/ \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f\u0434\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Status.EXL \u2190 1  \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0430 &quot;\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439&quot; if Status.BEV = 1 then     vectorBase \u2190 16#BFC00200 else     \/\/ \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 EBase[31:30] = 2'b10      \/\/ \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 kseg0 \u0438\u043b\u0438 kseg1     vectorBase \u2190 EBase[31:12] || 16#000 endif  \/\/ \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0438\u044f \/\/ \u0430\u0434\u0440\u0435\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0430 vectorBase \u0438 vectorOffset \/\/ \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0438\u0437 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 29 \u0432 \u0440\u0430\u0437\u0440\u044f\u0434 30 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f PC \u2190 {vectorBase[31:30], (vectorBase[29:0] + vectorOffset[29:0])}<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043d\u0435 \u0443\u0447\u0442\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0441\u0431\u0440\u043e\u0441\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (Reset, SoftReset, NMI \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 16#BFC00000);<\/li>\n<li>\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f EJTAG;<\/li>\n<li>Cache\/SPRAM Parity error, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438 <strong>Status.BEV<\/strong> = 0 \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 kseg0 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 kseg1 (<strong>vectorBase[29]<\/strong> = 1&#8217;b1) \u0438 <strong>EBase[29:12]<\/strong> = 0 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0435 16#80000000, \u0430 16#A0000000. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u0442.\u043a. \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 MIPSfpga \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f (\u0441\u043c. RTL \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f mfp_ahb_lite_decoder) \u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u0442\u0440\u0438 \u0431\u0438\u0442\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043a \u043f\u0430\u043c\u044f\u0442\u0438;<\/li>\n<li>\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 XTLB Refil \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c 0x80, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>], \u043d\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D3_MIPS_Toolchain_Codescape_GNU_Tools_for_MIPS_Programmers_Guide_1.1.97.pdf\">D3<\/a>] \u0438 \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043a\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0438\u0437 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u0431\u0443\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d \u0437\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>].<br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li>16#000 \u2014 TLB Refill Handler;<\/li>\n<li>16#080 \u2014 XTLB Refil;<\/li>\n<li>16#100 \u2014 Cache\/SPRAM Parity error;<\/li>\n<li>16#180 \u2014 General Exception Handler.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"rezhimy-obrabotki-preryvaniy\">\u0420\u0435\u0436\u0438\u043c\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/h2>\n<p>  <\/p>\n<p>\u0418\u0445 \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>Interrupt Compatibility mode \u2014 \u0440\u0435\u0436\u0438\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438;<\/li>\n<li>Vector Interrupt (VI) mode \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c;<\/li>\n<li>External Interrupt Controller (EIC) mode \u2014 \u0440\u0435\u0436\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 (Compatibility). \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d, \u043f\u0443\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0431\u0438\u0442\u043e\u0432 (\u043f\u043e\u043b\u0435\u0439): <\/p>\n<p>  <\/p>\n<ul>\n<li><strong>Status.BEV<\/strong> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u0440\u043e\u0441\u0430 \u2014 1;<\/li>\n<li><strong>Cause.IV<\/strong> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u0440\u043e\u0441\u0430 \u2014 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e;<\/li>\n<li><strong>IntCtl.VS<\/strong> \u2014 Vector Spacing, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u0440\u043e\u0441\u0430 \u2014 0;<\/li>\n<li><strong>Config3.VINT<\/strong> \u2014 Vectored interrupts, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f, \u0440\u0430\u0432\u0435\u043d 1 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 microAptiv \u044f\u0434\u0435\u0440, \u0432 \u0442.\u0447. \u0438 \u0434\u043b\u044f MIPSfpga;<\/li>\n<li><strong>Config3.VEIC<\/strong> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u043c <em>SI_EICPresent<\/em>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 (\u043f\u043e\u043b\u0435\u0439) \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043e\u0442\u043c\u0435\u0442\u0438\u043c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0440\u0435\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/95b\/00a\/3a7\/95b00a3a78d846e39168f1719f97233f.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<h2 id=\"sistemnyy-taymer\">\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440<\/h2>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044b\u0445 \u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440. \u041e\u043d \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442 \u043f\u043e \u0441\u0432\u043e\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c, \u043d\u043e \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u044d\u043d\u0435\u0440\u0433\u043e\u0441\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0438\u044f, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043b\u044e\u0431\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<br \/>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>Count<\/strong> \u2014 \u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430. \u0415\u0441\u043b\u0438 <strong>Cause.DC<\/strong> == 0 (disable count register, default = 0), \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0430\u043a\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u2014 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0443\u043b\u0435\u0432\u043e\u0435), \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 (\u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e\u043c <strong>Count<\/strong> == <strong>Compare<\/strong>) \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0441\u0431\u0440\u043e\u0441\u0443 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430;<\/li>\n<li><strong>Compare<\/strong> \u2014 \u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u041a\u043e\u0433\u0434\u0430 <strong>Count<\/strong> == <strong>Compare<\/strong> \u0438 <strong>Compare<\/strong> != 0, \u0441\u0438\u0433\u043d\u0430\u043b <em>SI_TimerInt<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443, \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0438\u0442 <strong>Cause.TI<\/strong> (timer interrupt). \u0414\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 <strong>Compare<\/strong>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u044b mips32_setcompare \u0438 mips32_setcount, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 mips\/cpu.h, \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0441\u0431\u0440\u043e\u0441\u0430 \u0442\u0430\u0439\u043c\u0435\u0440\u0430, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L17-L27\">S0<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">mips32_setcompare(MIPS_TIMER_PERIOD);  \/\/set compare (TOP) value to turn on \/reset timer mips32_setcount(0);                    \/\/reset counter<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435 \u0432\u0438\u0434\u043d\u044b \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0438 \u0435\u0433\u043e \u0441\u0431\u0440\u043e\u0441\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2a6\/8c8\/355\/2a68c835553c41028c537ac7c027c6b7.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 <em>SI_TimerInt<\/em> \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0435\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 RTL, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 (Interrupt mode), \u043e \u0447\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"interrupt-compatibility-mode\">Interrupt Compatibility mode<\/h2>\n<p>  <\/p>\n<p>\u0420\u0435\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 MIPS32 Release 1. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e 8 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439: \u0432\u0445\u043e\u0434\u044b <em>SI_Int[7:0]<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0444\u043b\u0430\u0433\u0430\u043c <strong>Cause.IP9<\/strong> \u2014 <strong>IP2<\/strong>;<\/li>\n<li>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e 2 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f: <strong>Cause.IP1<\/strong> \u2014 <strong>IP0<\/strong>;<\/li>\n<li>\u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0445\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439;<\/li>\n<li>\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u0430\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442;<\/li>\n<li>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043f\u0443\u0442\u0435\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 <strong>Cause.IP9<\/strong> \u2014 <strong>IP0<\/strong>, <strong>Cause.TI<\/strong>.<\/li>\n<li>\u0432\u044b\u0445\u043e\u0434 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 ( <em>SI_TimerInt<\/em> ) \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0445\u043e\u0434\u043e\u0432 <em>SI_Int[7:0]<\/em>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434 <em>SI_IPTI[2:0]<\/em>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c 0x2 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e <em>SI_TimerInt<\/em> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a <em>SI_Int[0]<\/em>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e 0x7 \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a <em>SI_Int[5]<\/em>. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a <em>SI_Int[5]<\/em>.<\/li>\n<li>\u0435\u0441\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b MIPS32 Release 1, \u0442\u043e \u0432 \u043d\u0438\u0445 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e 6 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 (<strong>Cause.IP9<\/strong>&#8212;<strong>IP8<\/strong> \u0432 \u043d\u0438\u0445 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442) [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D4_MIPS32_r1_Vol3.pdf\">D4<\/a>], \u043e\u0442\u0441\u044e\u0434\u0430 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <em>SI_IPTI[2:0]<\/em> \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u043e\u0440\u0442 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c <em>SI_Int[5]<\/em>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0435\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0435\u043c \u0431\u044b\u043b\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0432 MIPS32 Release 1.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422\u0435, \u043a\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u0434\u043e\u0443\u043c\u0435\u043d\u0438\u0435 \u043e\u0442 &quot;\u0432\u0441\u0435\u0433\u043e&quot; 6 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 \u0432\u0441\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043b\u044c\u0432\u0438\u043d\u0443\u044e \u0434\u043e\u043b\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b MIPS: \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0432\u0445\u043e\u0434\u0430 \u0432 (\u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437) \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0443 \u0432\u0441\u0435\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043e\u0431\u0449\u0438\u0439, \u0430 \u0442.\u043a. \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 (\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e \u0440\u0435\u0434\u043a\u043e), \u0442\u043e \u043d\u0435\u0442 \u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u043e\u0442\u0435\u0440\u044c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 &quot;\u0440\u0443\u0447\u043d\u043e\u0439&quot; \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432, \u0438 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 [<a href=\"http:\/\/rus-linux.net\/MyLDP\/BOOKS\/Embedded_Linux_system_design_and_development_ru.pdf\">L5<\/a>] \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/38a\/767\/c8a\/38a767c8a904428283be8ce3d8b70213.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 &quot;\u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c&quot;, \u043e\u043d\u0438 \u043b\u0435\u0433\u043a\u043e \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 MIPSfpga, \u043e \u0447\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"primer\">\u041f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>  <\/p>\n<h4 id=\"poryadok-zapuska\">\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 mfp_ahb_lite_matrix_config.vh \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 (\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430) [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_ahb_lite_matrix_config.vh#L29-L41\">S1<\/a>]:<br \/> \n<pre><code>`define MFP_USE_WORD_MEMORY \/\/`define MFP_USE_IRQ_EIC<\/code><\/pre>\n<\/li>\n<li>\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 mipsfpga-plus\/programs\/06_timer_irq\/;<\/li>\n<li>\u0432 \u0444\u0430\u0439\u043b\u0435 main.c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L12\">S2<\/a>]:<br \/> \n<pre><code class=\"cpp\">#define RUNTYPE    COMPATIBILITY<\/code><\/pre>\n<\/li>\n<li>\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435:<br \/> \n<pre><code>02_compile_and_link.bat 05_generate_verilog_readmemh_file.bat 06_simulate_with_modelsim.bat<\/code><\/pre>\n<\/li>\n<li>\u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0436\u0430\u0442\u044c &quot;\u043d\u0435\u0442&quot;, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430;<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"opisanie-programmy-i-konfiguracii-sistemy\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 RTL \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_system.v#L382-L389\">S3<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code>assign SI_Offset      = 17'b0; \/\/not used assign SI_EISS        =  4'b0; \/\/not used assign SI_Int[7:4]    =  4'b0; assign SI_Int[3]      =  uart_interrupt; assign SI_Int[2:0]    =  3'b0; assign SI_EICVector   =  6'b0; \/\/not used assign SI_EICPresent  =  1'b0; \/\/no external interrupt controller assign SI_IPTI        =  3'h7; \/\/enable MIPS timer interrupt on HW5<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b exceptions.S \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u043e\u043d\u0438 \u0432\u0441\u0435, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0435 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L54-L61\">S4<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code>    .org    0x200                       # set symbol offset from section beginning     .weak   __mips_isr_sw0              # if the symbol does not already exist, it will be created __isr_vec_sw0:     la      $k1, __mips_isr_sw0         # load interrupt handler (__mips_isr_sw0) addr     beqz    $k1, __general_exception    # if it is not present then go to generic      nop     jr      $k1                         # jump to irq_sw0     nop<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L12-L20\">S5<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code>    .org    0x0                     # set symbol offset from section beginning     .weak   _mips_tlb_refill        # if the symbol does not already exist, it will be created __tlb_refill:     la      $k1, _mips_tlb_refill   # load exception handler (_mips_tlb_refill) addr     beqz    $k1, __tlb_refill       # if _mips_tlb_refill doen not exist then just loop here     nop     jr      $k1                     # jump to _mips_tlb_refill.                                     # we can use 'j _mips_tlb_refill'      nop                             # but it works only with 1st 28 bits of addr<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0432 \u0444\u0430\u0439\u043b\u0435 mian.c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L17-L27\">S0<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">mips32_setcompare(MIPS_TIMER_PERIOD);   \/\/set compare (TOP) value to turn timer on mips32_setcount(0);                     \/\/reset counter<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L32-L35\">S6<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/compatibility mode, one common handler \/\/ Status.BEV  0 - place handlers in kseg0 (0x80000000) mips32_bicsr (SR_BEV); \/\/ Cause.IV,   0 - general exception handler (offset 0x180) mips32_biccr (CR_IV); \/\/ interrupt enable, HW5, SR_SINT1 - unmasked mips32_bissr (SR_IE | SR_HINT5 | SR_SINT1);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0438 \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0434\u0430\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L59-L79\">S7<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void __attribute__ ((interrupt, keep_interrupts_masked)) _mips_general_exception () { MFP_RED_LEDS = MFP_RED_LEDS | 0x1;  uint32_t cause = mips32_getcr();  \/\/check that this is interrupt exception if((cause &amp; CR_XMASK) == 0) {     \/\/check for timer interrupt     if(cause &amp; CR_HINT5)     {         MFP_RED_LEDS = MFP_RED_LEDS | 0x10;         n++;         mipsTimerReset();          mips32_biscr(CR_SINT1);     \/\/request for software interrupt 1         MFP_RED_LEDS = MFP_RED_LEDS &amp; ~0x10;     }     \/\/check for software interrupt 1     else if (cause &amp; CR_SINT1)     {         MFP_RED_LEDS = MFP_RED_LEDS | 0x8;         mips32_biccr(CR_SINT1);     \/\/clear software interrupt 1 flag         MFP_RED_LEDS = MFP_RED_LEDS &amp; ~0x8;     } }  MFP_RED_LEDS = MFP_RED_LEDS &amp; ~0x1; }<\/code><\/pre>\n<p>  <\/li>\n<li>\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f (HW5), \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0436\u0435 \u0446\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>Cause.TI<\/strong> (\u043c\u0430\u043a\u0440\u043e\u0441 CR_TI);<\/li>\n<li>\u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c MFP_RED_LEDS;<\/li>\n<li>\n<p>\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 (HW5) \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430, \u0441\u0431\u0440\u043e\u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f SW1 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L66-L69\">S8<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">n++; mipsTimerReset(); mips32_biscr(CR_SINT1);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0438 SW1 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0431\u0440\u043e\u0441 \u0444\u043b\u0430\u0433\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L76\">S9<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">mips32_biccr(CR_SINT1);<\/code><\/pre>\n<p>  <\/li>\n<li>\u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 mips\/cpu.h;<\/li>\n<li>\n<p>\u0432 \u043a\u043e\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 7-\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043d\u044b\u0435 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u044b [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L112-L113\">S10<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">for (;;) MFP_7_SEGMENT_HEX = n;<\/code><\/pre>\n<p>  <\/li>\n<li>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u043d\u0438\u0436\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 <strong>Cause<\/strong> \u0438 <strong>Status<\/strong>, <strong>PC<\/strong>, <strong>Count<\/strong> \u0438 <strong>\u0421ompare<\/strong>, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0443.<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/038\/851\/847\/0388518473e841f1bb060cd7cab98a22.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<h2 id=\"vector-interrupt-mode\">Vector Interrupt mode<\/h2>\n<p>  <\/p>\n<p>\u0412\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cdf\/bfb\/08d\/cdfbfb08dd214db88439a1ac78ac7451.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u0441\u043e\u0441\u0442\u0430\u0432 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 (8 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438 2 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SI_TimerInt \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b Interrupt Compatibility mode;<\/li>\n<li>\u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (\u0432\u0435\u043a\u0442\u043e\u0440);<\/li>\n<li>\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u043c \u044f\u0434\u0440\u043e\u043c. \u0412 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430: SW0, SW1 (\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f), HW0-HW7 (\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c SI_Int[7:0])<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/5ed\/cd7\/e53\/5edcd7e53bf949898492e47de792bdcf.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0438 0x200;<\/li>\n<li>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0432\u044b\u043c \u0438 \u0432\u0442\u043e\u0440\u044b\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0435\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u043c <strong>IntCtl.VS<\/strong>. \u0422\u0430\u043a \u0434\u043b\u044f <strong>IntCtl.VS<\/strong> = 1, \u044d\u0442\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 0x20:<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/28a\/4de\/6c4\/28a4de6c42be4794a73efe77b9d4334d.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"primer-1\">\u041f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>  <\/p>\n<h4 id=\"poryadok-zapuska-1\">\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u0430\u043a\u043e\u0432\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 main.c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L12\">S2<\/a>]:<br \/> \n<pre><code class=\"cpp\">#define RUNTYPE    VECTOR<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"opisanie-programmy-i-konfiguracii-sistemy-1\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li>RTL \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438;<\/li>\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0444\u0430\u0439\u043b exceptions.S [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L54-L61\">S4<\/a>, <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L12-L20\">S5<\/a>] \u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L17-L27\">S0<\/a>];<\/li>\n<li>\n<p>\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L38-L47\">S11<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/vector mode, multiple handlers \/\/ Status.BEV  0 - place handlers in kseg0 (0x80000000) mips32_bicsr (SR_BEV); \/\/ Cause.IV,   1 - special int vector (offset 0x200),  \/\/                 where 0x200 - base for other vectors mips32_biscr (CR_IV); \/\/ get IntCtl reg value uint32_t intCtl = mips32_getintctl(); \/\/ set interrupt table vector spacing (0x20 in our case) \/\/ see exceptions.S for details mips32_setintctl(intCtl | INTCTL_VS_32); \/\/ interrupt enable, HW5 and SW0,SW1 - unmasked mips32_bissr (SR_IE | SR_HINT5 | SR_SINT0 | SR_SINT1);<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 (HW5) \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u043b\u0430\u0433\u043e\u0432 \u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u0430 \u0441\u0440\u0430\u0437\u0443 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 (SW0 \u0438 SW1), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L93-L104\">S12<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void __attribute__ ((interrupt, keep_interrupts_masked)) __mips_isr_hw5 () {     MFP_RED_LEDS = MFP_RED_LEDS | 0x4;      n++;     mipsTimerReset();      mips32_biscr(CR_SINT0);     \/\/request for software interrupt 0     mips32_biscr(CR_SINT1);     \/\/request for software interrupt 1      MFP_RED_LEDS = MFP_RED_LEDS &amp; ~0x4; }<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f SW0 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L84-L91\">S13<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void __attribute__ ((interrupt, keep_interrupts_masked)) __mips_isr_sw0 () {    MFP_RED_LEDS = MFP_RED_LEDS | 0x2;    mips32_biccr(CR_SINT0);     \/\/clear software interrupt 0 flag    MFP_RED_LEDS = MFP_RED_LEDS &amp; ~0x2; }<\/code><\/pre>\n<p>  <\/li>\n<li>\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 SW1 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0442\u0435\u043c \u0436\u0435 _mips_general_exception, \u0447\u0442\u043e \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u043e \u0441 \u0432\u0430\u0436\u043d\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c: \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441\u0440\u0430\u0437\u0443 \u0432\u044b\u0448\u0435\u043b \u043d\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 0x180. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 0x220, \u043d\u043e \u0442.\u043a. \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>mips_isr_sw1 \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430, \u0442\u043e \u0443\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 <\/strong>general_exception (\u044d\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438\u0437 exceptions.S, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u044b\u0448\u0435) [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L63-L67\">S14<\/a>].<\/li>\n<li>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439:<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/972\/a82\/ff9\/972a82ff9d49406b9292d6cef82218ca.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<h2 id=\"external-interrupt-controller-mode\">External Interrupt Controller mode<\/h2>\n<p>  <\/p>\n<h3 id=\"kontroller-vneshnih-preryvaniy\">\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f8f\/acc\/9d5\/f8facc9d504f481397a491f9f218826a.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 External Interrupt Controller, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u043c \u044f\u0434\u0440\u043e\u043c \u0438 \u0447\u0442\u043e \u043e\u043d \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442.<br \/>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430 \u0448\u0438\u043d\u0443 (Interrupt Interface) \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u043e\u043c \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><em>SI_EICPresent<\/em> \u2014 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439;<\/li>\n<li><em>SI_Int[7:0]<\/em> \u2014 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<li><em>SI_EISS[3:0]<\/em> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u043d\u0430\u0431\u043e\u0440\u0430 \u0442\u0435\u043d\u0435\u0432\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 (shadow set number), \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 MIPSfpga \u2014 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f;<\/li>\n<li><em>SI_EICVector<\/em> \u2014 \u043d\u043e\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<li><em>SI_Offset[17:1]<\/em> \u2014 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443:<\/p>\n<p>  <\/p>\n<ul>\n<li><em>SI_IAck<\/em> \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0439 \u0438\u043c\u043f\u0443\u043b\u044c\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<li><em>SI_IPL[7:0]<\/em> \u2014 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<li><em>SI_IVN[5:0]<\/em> \u2014 \u043d\u043e\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<li><em>SI_ION[17:0]<\/em> \u2014 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f;<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0422\u0438\u043f\u043e\u0432\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/88f\/073\/049\/88f073049d524ccfbefdbe74bdc4c7fc.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0435\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0442.\u043a. \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u043c \u044f\u0434\u0440\u043e\u043c, \u0442\u043e \u0432\u0441\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0438\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430: \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430 (\u0441\u0438\u0433\u043d\u0430\u043b <em>SI_TimerInt<\/em> \u0444\u043b\u0430\u0433 <strong>Cause.TI<\/strong>), \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f (\u0441\u0438\u0433\u043d\u0430\u043b\u044b <em>SI_SWInt[1:0]<\/em>, \u0444\u043b\u0430\u0433\u0438 <strong>Cause.IP1<\/strong>&#8212;<strong>IP0<\/strong>) \u0438 \u0434\u0440. \u2014 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u043e \u0432 [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>];<\/li>\n<li>\u0442\u043e, \u043a\u0430\u043a \u044f\u0434\u0440\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430: \u0431\u0435\u0440\u0435\u0442 \u0435\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 <em>SI_Offset[17:1]<\/em>, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 <em>SI_EICVector<\/em> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0435\u0439: &quot;Option 1 \u2014 Explicit Vector Number&quot; \u043b\u0438\u0431\u043e &quot;Option 2 \u2014 Explicit Vector Offset&quot;. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e 64 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 256\u041a \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043e\u0442 \u0431\u0430\u0437\u044b \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u0439 \u0441\u0432\u043e\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0447\u0435\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0439 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0438 \u044f\u0434\u0440\u0430 MIPS microAptiv \u0437\u0430\u0434\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0435. \u0412 MIPSfpga \u043e\u043d \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u043d\u043e \u0434\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 m14k_cpz_eicoffset_stub.v:84. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043d\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>eic_offset<\/em> \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443:<br \/> \n<pre><code>assign eic_offset = 1'b1;<\/code><\/pre>\n<\/li>\n<li>\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e-\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 (\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <strong>Status.IPL<\/strong>), \u0432\u0441\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043d\u0438\u0436\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u2014 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b;<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"kontroller-preryvaniy-mipsfpga-plus\">\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 MIPSfpga-plus<\/h3>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b MIPSfpga-plus [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\">L3<\/a>];<\/li>\n<li>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043e 64 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (mfp_eic_core.vh) [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.vh\">S15<\/a>];<\/li>\n<li>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0432\u0432\u043e\u0434\u0430: \u043f\u0440\u044f\u043c\u043e\u0439 (direct channel) \u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (sense channel). \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0414\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d: \u0444\u0440\u043e\u043d\u0442, \u0441\u043f\u0430\u0434, \u043d\u0438\u0437\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430;<\/li>\n<li>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0442\u0438\u043f\u0430 sense channel \u2014 32;<\/li>\n<li>\u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b;<\/li>\n<li>\u0432\u0441\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b;<\/li>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u0430\u043a \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 &quot;Option 1 \u2014 Explicit Vector Number &quot; \u0442\u0430\u043a \u0438 &quot;Option 2 \u2014 Explicit Vector Offset&quot;;<\/li>\n<li>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0447\u0430\u043b\u0435 \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u043c \u044f\u0434\u0440\u043e\u043c;<\/li>\n<li>\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0430 github \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f &quot;\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430&quot; \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430 [<a href=\"https:\/\/github.com\/zhelnio\/ahb_lite_eic\">L6<\/a>];<\/li>\n<li>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u043c\u0443 \u044f\u0434\u0440\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 MIPSfpga-plus (mfp_system.v), <em>EIC_input<\/em> \u2014 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0432\u043e\u0434\u044b-\u0432\u044b\u0432\u043e\u0434\u044b \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_system.v#L475-L486\">S21<\/a>]:<br \/> \n<pre><code>`ifdef MFP_USE_IRQ_EIC .EIC_input        (   EIC_input        ), .EIC_Offset       (   SI_Offset        ), .EIC_ShadowSet    (   SI_EISS          ), .EIC_Interrupt    (   SI_Int           ), .EIC_Vector       (   SI_EICVector     ), .EIC_Present      (   SI_EICPresent    ), .EIC_IAck         (   SI_IAck          ), .EIC_IPL          (   SI_IPL           ), .EIC_IVN          (   SI_IVN           ), .EIC_ION          (   SI_ION           ), `endif \/\/MFP_USE_IRQ_EIC<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u0441\u043e\u0441\u0442\u0430\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u0445\u043e\u0434\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>mfp_eic_core.v \u2014 \u044f\u0434\u0440\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.vh\">S17<\/a>];<\/li>\n<li>mfp_eic_core.vh \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (\u0441\u043c. \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438) [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.vh\">S15<\/a>];<\/li>\n<li>mfp_eic_handler.v \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\/\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e (\u0441\u043c. \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438) [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_handler.v\">S18<\/a>];<\/li>\n<li>mfp_eic_priority_encoder.v \u2014 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u0439 \u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440 \u0441 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0439 (\u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u043e\u0439) \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_priority_encoder.v\">S19<\/a>];<\/li>\n<li>mfp_ahb_lite_eic.v \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u0448\u0438\u043d\u043e\u0439 AHB-Lite [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_ahb_lite_eic.v\">S20<\/a>].<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c \u0435\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u0438\u0445 \u043f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432 [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D5_20170320_mfp_EIC.pdf\">D5<\/a>]. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u043a\u0440\u043e\u043c\u0435 <strong>EICR<\/strong>, <strong>EISMSK_0<\/strong> \u0438 <strong>EISMSK_1<\/strong> \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u043e\u043c\u0435\u0440 \u0431\u0438\u0442\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440\u0443 \u0432\u0445\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0422\u0430\u043a, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <strong>EIFR_0[3]<\/strong>=1 \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 3 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/69f\/a18\/a22\/69fa18a22fb543878ca2024f59a36be9.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<h3 id=\"primer-2\">\u041f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>  <\/p>\n<h4 id=\"poryadok-zapuska-2\">\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 mfp_ahb_lite_matrix_config.vh \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_ahb_lite_matrix_config.vh#L29-L41\">S1<\/a>]:<br \/> \n<pre><code>`define MFP_USE_IRQ_EIC `define MFP_USE_WORD_MEMORY<\/code><\/pre>\n<\/li>\n<li>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 m14k_cpz_eicoffset_stub.v \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440:<br \/> \n<pre><code>assign eic_offset = 1'b0;<\/code><\/pre>\n<\/li>\n<li>\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 mipsfpga-plus\/programs\/07_eic\/;<\/li>\n<li>\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435:<br \/> \n<pre><code>02_compile_and_link.bat 05_generate_verilog_readmemh_file.bat 06_simulate_with_modelsim.bat<\/code><\/pre>\n<\/li>\n<li>\u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0436\u0430\u0442\u044c &quot;\u043d\u0435\u0442&quot;, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430;<\/li>\n<\/ul>\n<p>  <\/p>\n<h4 id=\"opisanie-programmy-i-konfiguracii-sistemy-2\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 RTL \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_system.v#L372-L380\">S16<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code>wire  [ `EIC_CHANNELS - 1 : 0 ] EIC_input; assign EIC_input[`EIC_CHANNELS - 1:8] = {`EIC_CHANNELS - 6 {1'b0}}; assign EIC_input[7]   =  SI_TimerInt; assign EIC_input[6]   =  1'b0; assign EIC_input[5]   =  uart_interrupt; assign EIC_input[4:2] =  3'b0; assign EIC_input[1]   =  SI_SWInt[1]; assign EIC_input[0]   =  SI_SWInt[0]; assign SI_IPTI        =  3'h0;<\/code><\/pre>\n<p>  <\/li>\n<li>\u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0448\u0438\u043d\u044b Interrupt Interface \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c mfp_ahb_lite_eic, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435;<\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b exceptions.S \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0434\u0432\u0443\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430. \u0422\u0430\u043a, \u0441\u0430\u043c\u043e\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 HW63 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043d\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0438 0x9E0 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/exceptions.S#L621-L628\">S22<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code>    .org    0x9E0     .weak   __mips_isr_eic63 __isr_vec_eic63:     la      $k1, __mips_isr_eic63     beqz    $k1, __general_exception     nop     jr      $k1     nop<\/code><\/pre>\n<p>  <\/li>\n<li>\u0432\u0441\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b eic.h [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/eic.h\">S23<\/a>];<\/li>\n<li>\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0432 main.c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435;<\/li>\n<li>\n<p>\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/main.c#L26-L46\">S24<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/eic mode \/\/unmask interrupt MFP_EIC_EIMSK_0     = (1 &lt;&lt; IRQSW0) | (1 &lt;&lt; IRQSW1) | (1 &lt;&lt; IRQTIMER); MFP_EIC_EIMSK_1     = (1 &lt;&lt; IRQ63); \/\/enable auto clear   MFP_EIC_EIACM_0     = (1 &lt;&lt; IRQSW0) | (1 &lt;&lt; IRQSW1) | (1 &lt;&lt; IRQTIMER); \/\/set interrupt on rising edge of the signal MFP_EIC_EISMSK_0    = (SMSK_RIZE &lt;&lt; SMSKSW0) |                        (SMSK_RIZE &lt;&lt; SMSKSW1) |                        (SMSK_RIZE &lt;&lt; SMSKTIMER); \/\/ Status.BEV  0 - vector interrupt mode mips32_bicsr (SR_BEV); \/\/ Cause.IV,   1 - special int vector (0x200) \/\/ where 0x200 - base when Status.BEV = 0; mips32_biscr (CR_IV); \/\/ get IntCtl reg value uint32_t intCtl = mips32_getintctl(); \/\/ set interrupt table vector spacing (0x20 in our case) \/\/ see exceptions.S for details mips32_setintctl(intCtl | INTCTL_VS_32); \/\/ enable external interrupt controller \/\/ enable interrupts MFP_EIC_EICR = 0x1; mips32_bissr (SR_IE);<\/code><\/pre>\n<p>  <\/li>\n<li>\u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 RTL \u043c\u043e\u0434\u0443\u043b\u0438: interrupt_sence \u2014 \u0433\u0434\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0440\u0435\u0430\u043a\u0446\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0444\u0440\u043e\u043d\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.v#L305-L357\">S28<\/a>], interrupt_channel \u2014 \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u043b\u0430\u0433 \u0432 <strong>EIFR<\/strong> [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.v#L283-L303\">S29<\/a>]. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0444\u043b\u0430\u0433\u043e\u0432 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u0439 \u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440 priority_encoder \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0441 \u0441\u0430\u043c\u044b\u043c \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u2014 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u043e\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u0430 <em>EIC_input<\/em>, \u0442\u0435\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_priority_encoder.v\">S19<\/a>]. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c handler_params_encoder [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_handler.v\">S18<\/a>], \u0433\u0434\u0435 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\/\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435;<\/li>\n<li>\n<p>\u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f (Option 2 \u2014 Explicit Vector Offset), \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 (m14k_cpz_eicoffset_stub.v), \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 mfp_eic_core.vh [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.vh\">S15<\/a>] \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/p>\n<p>  <\/p>\n<pre><code>`define EIC_USE_EXPLICIT_VECTOR_OFFSET<\/code><\/pre>\n<p>  <\/li>\n<li>\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\/\u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0442.\u043a. \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 mfp_eic_handler.v \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0438 <strong>IntCtl.VS<\/strong> = 1 (32 \u0431\u0430\u0439\u0442\u0430) [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/main.c#L41-L42\">S25<\/a>];<\/li>\n<li>\n<p>\u0441\u0430\u043c\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435 [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/main.c#L67-L74\">S26<\/a>]:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">ISR(IH_SW0) {     MFP_RED_LEDS = MFP_RED_LEDS | 0x1;     mips32_biccr(CR_SINT0);         \/\/clear software interrupt 0 flag     MFP_RED_LEDS = MFP_RED_LEDS &amp; ~0x1; }<\/code><\/pre>\n<p>  <\/li>\n<li>\u043c\u0430\u043a\u0440\u043e\u0441\u044b ISR \u0438 EH_GENERAL \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 eic.h [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/eic.h#L61-L62\">S27<\/a>];<\/li>\n<li>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430:<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/38a\/0c0\/0bc\/38a0c00bc50d4e1daf43cb0520a356cf.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<ul>\n<li>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f:<\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8df\/f09\/780\/8dff09780fd94bc89c2aeae958d49d8c.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<h2 id=\"podderzhka-kompilyatorom\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432\u044b\u0448\u0435 \u043d\u0435 \u0430\u043a\u0446\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0445\u043e\u0434 \u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435, \u0442.\u043a. \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c [<a href=\"https:\/\/community.imgtec.com\/developers\/mips\/tools\/codescape-mips-sdk\/\">L7<\/a>]. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u0435\u0433\u043e \u0434\u043b\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.<br \/>  \u2003<br \/>  \u0412 [<a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D3_MIPS_Toolchain_Codescape_GNU_Tools_for_MIPS_Programmers_Guide_1.1.97.pdf\">D3<\/a>] \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d \u0440\u044f\u0434 \u043e\u043f\u0446\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void __attribute__ ((interrupt)) v0 ();  void __attribute__ ((interrupt, use_shadow_register_set)) v1 ();  void __attribute__ ((interrupt, keep_interrupts_masked)) v2 ();  void __attribute__ ((interrupt, use_debug_exception_return)) v3 ();  void __attribute__ ((interrupt, use_shadow_register_set, keep_interrupts_masked)) v4 ();  void __attribute__ ((interrupt, use_shadow_register_set, use_debug_exception_return)) v5 ();  void __attribute__ ((interrupt, keep_interrupts_masked, use_debug_exception_return)) v6 (); void __attribute__ ((interrupt, use_shadow_register_set, keep_interrupts_masked,  use_debug_exception_return)) v7 ();  void __attribute__ ((interrupt(&quot;eic&quot;))) v8 ();  void __attribute__ ((interrupt(&quot;vector=hw3&quot;))) v9 ();<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043e\u043f\u0446\u0438\u044f use_shadow_register_set \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430, \u0442.\u043a. \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u044f\u0434\u0440\u0435 MIPSfpga;<\/li>\n<li>\u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 interrupt(&quot;vector=hw3&quot;) \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438;<\/li>\n<li>\u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f (interrupt, keep_interrupts_masked), \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0432 \u0441\u0442\u0435\u043a \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043e\u043f\u0443\u0449\u0435\u043d\u043e:<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">(interrupt, keep_interrupts_masked)<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>void __attribute__ ((interrupt, keep_interrupts_masked)) __mips_isr_sw0 () { 80001544:   401b7000    mfc0    k1,c0_epc 80001548:   27bdfff0    addiu   sp,sp,-16 8000154c:   afbb000c    sw  k1,12(sp) 80001550:   401b6000    mfc0    k1,c0_status 80001554:   afbb0008    sw  k1,8(sp) \/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 k1 \u043d\u0443\u043b\u0438 \u043d\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 status.exl,.erl,.um, .ie; 80001558:   7c1b2004    ins k1,zero,0x0,0x5 \/\/\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c status 8000155c:   409b6000    mtc0    k1,c0_status 80001560:   afbe0004    sw  s8,4(sp) 80001564:   03a0f025    move    s8,sp ... } 80001568:   03c0e825    move    sp,s8 8000156c:   8fbe0004    lw  s8,4(sp) 80001570:   8fbb000c    lw  k1,12(sp) 80001574:   409b7000    mtc0    k1,c0_epc 80001578:   8fbb0008    lw  k1,8(sp) 8000157c:   27bd0010    addiu   sp,sp,16 80001580:   409b6000    mtc0    k1,c0_status 80001584:   42000018    eret<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<ul>\n<li>\u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f (interrupt), \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0432 \u0441\u0442\u0435\u043a \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043e\u043f\u0443\u0449\u0435\u043d\u043e:<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">(interrupt)<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>void __attribute__ ((interrupt)) __mips_isr_hw5 () { 80001588:   401a6800    mfc0    k0,c0_cause 8000158c:   401b7000    mfc0    k1,c0_epc 80001590:   27bdfff0    addiu   sp,sp,-16 80001594:   afbb000c    sw  k1,12(sp) 80001598:   401b6000    mfc0    k1,c0_status \/\/\u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e k0 \u0431\u0438\u0442\u044b cause.ip7-ip2 8000159c:   001ad282    srl k0,k0,0xa 800015a0:   afbb0008    sw  k1,8(sp) \/\/\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 k1 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f cause.ip6-ip2 \u043d\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 status.im7-im2 800015a4:   7f5b7a84    ins k1,k0,0xa,0x6 \/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 k1 \u043d\u0443\u043b\u0438 \u043d\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 status.exl,.erl,.um; \/\/  .ie \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f (\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f 1) 800015a8:   7c1b2044    ins k1,zero,0x1,0x4 \/\/\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c status 800015ac:   409b6000    mtc0    k1,c0_status 800015b0:   afbe0004    sw  s8,4(sp) 800015b4:   03a0f025    move    s8,sp ... } 800015b8:   03c0e825    move    sp,s8 800015bc:   8fbe0004    lw  s8,4(sp) \/\/disable interrupts (status.ie = 0) 800015c0:   41606000    di 800015c4:   000000c0    ehb 800015c8:   8fbb000c    lw  k1,12(sp) \/\/\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c epc 800015cc:   409b7000    mtc0    k1,c0_epc 800015d0:   8fbb0008    lw  k1,8(sp) 800015d4:   27bd0010    addiu   sp,sp,16 \/\/\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c status \u0438\u0437 \u0441\u0442\u0435\u043a\u0430 800015d8:   409b6000    mtc0    k1,c0_status 800015dc:   42000018    eret<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<ul>\n<li>\u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c keep_interrupts_masked, \u0442\u043e \u0434\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0443\u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u044b \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e. \u0414\u043b\u044f \u0440\u0435\u0436\u0438\u043c\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0441 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"blagodarnosti\">\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>  <\/p>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/habrahabr.ru\/post\/259505\/\">\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u043e\u0432<\/a> \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430 \u0414\u044d\u0432\u0438\u0434\u0430 \u0425\u0430\u0440\u0440\u0438\u0441\u0430 \u0438 \u0421\u0430\u0440\u044b \u0425\u0430\u0440\u0440\u0438\u0441 \u00ab\u0426\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u00bb, \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <a href=\"https:\/\/www.imgtec.com\/\">Imagination Technologies<\/a> \u0437\u0430 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u044f\u0434\u0440\u043e \u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u042e\u0440\u0438\u044e \u041f\u0430\u043d\u0447\u0443\u043b\u0443 <a href=\"https:\/\/habrahabr.ru\/users\/yuripanchul\/\" class=\"user_link\">YuriPanchul<\/a> \u0437\u0430 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u0438 MIPSfpga.<\/p>\n<p>  <\/p>\n<h2 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>[L1] \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/259505\/\">\u0426\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/a>;<br \/>  [L2] \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/275215\/\">\u041a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 MIPSfpga<\/a>;<br \/>  [L3] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\">\u041f\u0440\u043e\u0435\u043a\u0442 MIPSfpga-plus \u043d\u0430 github<\/a>;<br \/>  [L4] \u2014 <a href=\"http:\/\/de10-lite.terasic.com\/\">FPGA \u043f\u043b\u0430\u0442\u0430 Terasic DE10-Lite<\/a>;<br \/>  [L5] \u2014 <a href=\"https:\/\/pixhawk.ethz.ch\/_media\/dev\/literature\/embedded_linux_system_design_and_development.pdf\">Embedded Linux System Design and Development P. Raghavan, Amol Lad, Sriram Neelakandan<\/a> (<a href=\"http:\/\/rus-linux.net\/MyLDP\/BOOKS\/Embedded_Linux_system_design_and_development_ru.pdf\">\u043f\u0435\u0440\u0435\u0432\u043e\u0434<\/a>);<br \/>  [L6] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/ahb_lite_eic\">\u041f\u0440\u043e\u0435\u043a\u0442 ahb_lite_eic \u043d\u0430 github<\/a>;<br \/>  [L7] \u2014 <a href=\"https:\/\/community.imgtec.com\/developers\/mips\/tools\/codescape-mips-sdk\/\">Codescape MIPS SDK<\/a>;<\/p>\n<p>  <\/p>\n<h2 id=\"dokumentaciya\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>[D1] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D1_MicroAptiv_UP_Integrators_Guide_MD00941.pdf\">MIPS32 microAptiv UP Processor Core Family Integrator\u2019s Guide<\/a>;<br \/>  [D2] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">MIPS32 microAptiv UP Processor Core Family Software User\u2019s Manual<\/a>;<br \/>  [D3] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D3_MIPS_Toolchain_Codescape_GNU_Tools_for_MIPS_Programmers_Guide_1.1.97.pdf\">Codescape GNU Tools for MIPS Programmer&#8217;s Guide<\/a>;<br \/>  [D4] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D4_MIPS32_r1_Vol3.pdf\">MIPS32 Architecture For Programmers Volume III: The MIPS32 Privileged Resource Architecture<\/a>;<br \/>  [D5] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D5_20170320_mfp_EIC.pdf\">MIPSfpga+ External Interrupt Controller<\/a>;<br \/>  [D6] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D6_MicroAptiv_UP_Datasheet_MD00939.pdf\">MIPS32 microAptiv UP Processor Core Family Datasheet<\/a>;<\/p>\n<p>  <\/p>\n<h2 id=\"izobrazheniya-i-tablicy\">\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h2>\n<p>  <\/p>\n<p>[P0] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P0_core.png\">MIPS 32 microAptiv UP Core Block Diagram<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D6_MicroAptiv_UP_Datasheet_MD00939.pdf\">D6<\/a>);<br \/>  [P1] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P1_modes.png\">\u0420\u0435\u0436\u0438\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430 \u0441 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438<\/a>;<br \/>  [P2] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P2_timer_signals.png\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430 MIPS. \u0421\u0438\u0433\u043d\u0430\u043b\u044b<\/a> (\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442);<br \/>  [P3] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P3_tree_connection.png\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u043c\u0443 \u044f\u0434\u0440\u0443<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/pixhawk.ethz.ch\/_media\/dev\/literature\/embedded_linux_system_design_and_development.pdf\">L5<\/a>);<br \/>  [P4] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P4_compat_signals.png\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438. \u0421\u0438\u0433\u043d\u0430\u043b\u044b<\/a> (\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442);<br \/>  [P5] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P5_vector.png\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>);<br \/>  [P6] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P6_vector_priority.png\">\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>);<br \/>  [P7] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P7_vector_offset.png\">\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>);<br \/>  [P8] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P8_vector_signals.png\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0421\u0438\u0433\u043d\u0430\u043b\u044b<\/a> (\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442);<br \/>  [P9] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P9_eic.png\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D2_MicroAptiv_UP_Software_Users_Manual_MD00942.pdf\">D2<\/a>);<br \/>  [P10] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P10_eic_interface.png\">\u0421\u0438\u0433\u043d\u0430\u043b\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/D1_MicroAptiv_UP_Integrators_Guide_MD00941.pdf\">D1<\/a>);<br \/>  [P11] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P11_eic_registers.png\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a> (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/github.com\/zhelnio\/ahb_lite_eic\">L6<\/a>);<br \/>  [P12] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P12_eic_signals_vector.png\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430<\/a> (\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442);<br \/>  [P13] \u2014 <a href=\"https:\/\/github.com\/zhelnio\/memos\/blob\/master\/public\/01_mips_interrupts\/doc\/P13_eic_signals_offset.png\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f<\/a> (\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442).<\/p>\n<p>  <\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<br \/>  [S0] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L17-L27\">\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0441\u0431\u0440\u043e\u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430<\/a>;<br \/>  [S1] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_ahb_lite_matrix_config.vh#L29-L41\">\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b mipsfpga-plus<\/a>;<br \/>  [S2] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L12\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0435\u0436\u0438\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u0430 06_timer_irq<\/a>;<br \/>  [S3] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_system.v#L382-L389\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f mipsfpga-plus \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S4] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L54-L61\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/a>;<br \/>  [S5] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L12-L20\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/a>;<br \/>  [S6] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L32-L35\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/a>;<br \/>  [S7] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L59-L79\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/a>;<br \/>  [S8] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L66-L69\">\u041f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/a>;<br \/>  [S9] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L76\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/a>;<br \/>  [S10] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L112-L113\">\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0438\u043a\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main \u043f\u0440\u0438\u043c\u0435\u0440\u0430 06_timer_irq<\/a>;<br \/>  [S11] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L38-L47\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435<\/a>;<br \/>  [S12] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L93-L104\">\u041f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435<\/a>;<br \/>  [S13] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/main.c#L84-L91\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435<\/a>;<br \/>  [S14] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/06_timer_irq\/exceptions.S#L63-L67\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/a>;<br \/>  [S15] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.vh\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 mipsfpga-plus<\/a>;<br \/>  [S16] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_system.v#L372-L380\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f mipsfpga-plus \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S17] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.vh\">\u042f\u0434\u0440\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S18] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_handler.v\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S19] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_priority_encoder.v\">\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u0439 \u0448\u0438\u0444\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S20] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_ahb_lite_eic.v\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0438 \u0448\u0438\u043d\u044b AHB-Lite<\/a>;<br \/>  [S21] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_system.v#L475-L486\">\u0421\u0438\u0433\u043d\u0430\u043b\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c<\/a>\u043c;<br \/>  [S22] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/exceptions.S#L621-L628\">\u0412\u043d\u0435\u0448\u043d\u0435\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 HW63<\/a>;<br \/>  [S23] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/eic.h\">\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c<\/a>;<br \/>  [S24] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/main.c#L26-L46\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S25] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/main.c#L41-L42\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S26] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/main.c#L67-L74\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439<\/a>;<br \/>  [S27] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/programs\/07_eic\/eic.h#L61-L62\">\u041c\u0430\u043a\u0440\u043e\u0441\u044b ISR \u0438 EH_GENERAL<\/a>;<br \/>  [S28] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.v#L305-L357\">\u041c\u043e\u0434\u0443\u043b\u044c interrupt_sence<\/a>;<br \/>  [S29] \u2014 <a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\/blob\/de22adeead0211de812f9b5b7868f161c03f07fb\/mfp_eic_core.v#L283-L303\">\u041c\u043e\u0434\u0443\u043b\u044c interrupt_channel<\/a>.<\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/324900\/\"> https:\/\/habrahabr.ru\/post\/324900\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 MIPS32 Release 2, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439.<br \/>  \u0412\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 github \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 mipsfpga-plus [<a href=\"https:\/\/github.com\/MIPSfpga\/mipsfpga-plus\">L3<\/a>].<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f3a\/b48\/538\/f3ab4853852145308ccc31bc3ac0e9d2.png\" alt=\"image\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283969","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283969"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283969\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}