{"id":387942,"date":"2024-06-29T07:38:10","date_gmt":"2024-06-29T07:38:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=387942"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=387942","title":{"rendered":"<span>Simics: RISC-\u043d\u0451\u043c?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0430\u043d\u0435\u0435 \u0432 \u0441\u0435\u0440\u0438\u0430\u043b\u0435\u2026 \u0410\u0445, \u0434\u0430, \u043d\u0435 \u0432\u0441\u0435 \u0442\u0435\u0445\u043d\u0430\u0440\u0438 \u0443\u0432\u0430\u0436\u0430\u044e\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u044b. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0441\u043b\u043e\u0432\u043e Simics \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0438 \u043c\u043d\u0435 \u043d\u0435 \u043e\u0442\u0432\u0435\u0440\u0442\u0435\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/auriga\/blog\/504086\/\">\u00ab\u0421\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u2013 \u043f\u043e\u0445\u043e\u0436\u0438 \u043b\u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u00bb<\/a> \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438 <a href=\"https:\/\/habr.com\/ru\/users\/alex_dzen\/\">@alex_dzen<\/a>.         <\/p>\n<p>\u0418\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u044b \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0435 \u0434\u044f\u0434\u044c\u043a\u0438 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043c\u0435\u043d\u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043a \u044d\u0442\u0438\u043c \u00ab\u0434\u044f\u0434\u044c\u043a\u0430\u043c\u00bb, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u0441\u0442\u044c \u2014 \u043d\u0430 \u0434\u043e\u0441\u0443\u0433\u0435 \u044f \u043b\u044e\u0431\u043b\u044e \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0430\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u00ab\u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0443\u044e\u00bb \u0441\u0440\u0435\u0434\u0443 Arduino, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u00ab\u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445\u00bb Atmel-ARM \u0438\u043b\u0438 ESP32-RISC. \u0418 \u0438\u043d\u0442\u0440\u0438\u0433\u0430 \u0432 \u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Simics \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438 \u0445\u043e\u0431\u0431\u0438-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a1f\/884\/463\/a1f884463b2d45edefce7a012233ec48.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1f\/884\/463\/a1f884463b2d45edefce7a012233ec48.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0427\u0430\u0441\u0442\u044c 1. 1+1<\/h3>\n<p>\u0422\u0438\u0445\u043e, \u0438 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0448\u0443\u043c\u0430 Intel \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u043e\u043b\u043d\u043e\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 Simics. <a href=\"https:\/\/software.intel.com\/content\/www\/us\/en\/develop\/articles\/simics-simulator.html\">\u041f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0412 \u043d\u0435\u0433\u043e \u0432\u0445\u043e\u0434\u044f\u0442: \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440, \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 Intel \u0441 \u044f\u0434\u0440\u043e\u043c Nehalem<a href=\"#sdfootnote1sym\"><sup>1<\/sup><\/a>, \u0447\u0438\u043f\u0441\u0435\u0442\u0430 X58, \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 x86 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432, \u043f\u0430\u043a\u0435\u0442 \u0441 Clear Linux (\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0432 Simics) \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432. \u0412 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0435 \u0432\u043e\u0448\u0435\u043b \u043f\u0430\u043a\u0435\u0442 Simics Eclipse. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0441\u0442\u0438 \u0438 \u0432 Visual Studio, \u0432 Notepad++, \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u00ab\u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u00bb Simics \u043a Qt Creator. \u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u043e\u0431\u0440\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u043e\u043c Intel, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0442\u0430\u043c \u0436\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438, \u0434\u043e\u0447\u0438\u0442\u0430\u0432 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0432\u044b \u0443\u0436\u0435 \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043b\u044f \u0432\u0430\u0441, \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u0430\u0436\u0443\u0449\u0438\u0439\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u00ab\u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435\u00bb \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u0435\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0448\u0438\u043d\u0435 PCI, USB1\/2\/3, I2C\/I3C \u0438 \u0442.\u00a0\u0434. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c Xtensa SDK, \u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a Simics \u043b\u044e\u0431\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 Xtensa. \u0410 \u0435\u0441\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0448\u0430\u0440\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 RISC-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432. \u0412\u043e\u0442 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u044f \u0438 \u0438\u0441\u043a\u0430\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f. \u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u043c\u043d\u043e\u0439 \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u0431\u0430\u0437\u0435 RISC-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u041f\u0417\u0423, \u041e\u0417\u0423. \u041f\u043e \u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0438 \u043f\u0430\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u0432 \u0438\u0445 \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0436 \u0441 \u043d\u0443\u043b\u044f (\u0447\u0442\u043e, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0432 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438) \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 sample-risc \u0438\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0435 \u0441\u0435\u0431\u0435 \u0432 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Simics<\/p>\n<pre><code class=\"bash\">$> .\/bin\/project-setup --copy-module sample-risc<\/code><\/pre>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c<\/p>\n<pre><code class=\"bash\">$> make sample-risc<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u041e\u0417\u0423:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f36\/a17\/2b4\/f36a172b4f5be16470412cea82d9f9ae.png\" width=\"1000\" height=\"600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f36\/a17\/2b4\/f36a172b4f5be16470412cea82d9f9ae.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 Simics:<\/p>\n<pre><code>simics> load-module sample-risc simics> @import simics_common simics> @MEMORY_SIZE = 0x10000000 simics> @cpu = simics_common.pre_conf_object(\"cpu\",\"sample-risc\") simics> @cpu.freq_mhz = 40 simics> @cpu_core = simics_common.pre_conf_object(\"cpu_core\",\"sample-risc-core\") simics> @cpu.current_risc_core = cpu_core simics> @phys_mem = simics_common.pre_conf_object(\"phys_mem\",\"memory-space\") simics> @cpu_core.physical_memory_space = phys_mem simics> @mem = simics_common.pre_conf_object(\"ram\", \"ram\") simics> @mem_image = simics_common.pre_conf_object(\"mem_image\", \"image\") simics> @mem_image.size = MEMORY_SIZE simics> @mem.image = mem_image simics> @phys_mem.map = [[0x00000000, mem, 0, 0, MEMORY_SIZE]] simics> @cpu_core.sample_risc = cpu simics> @simics.SIM_add_configuration([cpu,cpu_core,phys_mem,mem,mem_image], None)<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442, \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Simics \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c:<\/p>\n<pre><code>simics> phys_mem.write(0x100, 0xDEADBEEF) simics> phys_mem.read(0x100) 3735928559 (BE)<\/code><\/pre>\n<p>BE \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0443 \u043d\u0430\u0441 \u00abbig-endian\u00bb, \u043a\u0430\u043a \u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435\u043c\u0443 RISC \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 Python-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>pre_conf_object()<\/em>, \u0441\u0442\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Simics. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435 16-\u0442\u0438 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 \u0438 \u0447\u0438\u043f\u043e\u0432:<\/p>\n<pre><code>simics> output-radix 16 simics> phys_mem.read(0x100) 0xdeadbeef (BE)<\/code><\/pre>\n<p>\u041f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \ud83d\ude09<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9c9\/0bf\/56a\/9c90bf56a0ec23f71f7d65f7803c40c8.png\" width=\"300\" height=\"303\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c9\/0bf\/56a\/9c90bf56a0ec23f71f7d65f7803c40c8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c sample-risc. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b <em>s-add.py<\/em> \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <em>add r1, r2<\/em>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432 \u043d\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<p>\u0412 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Simics, \u0432 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <em>modules <\/em>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <em>myrisc-comp.<\/em><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/436\/9a9\/7ed\/4369a97edda35aec693ab7f17d569f50.png\" width=\"624\" height=\"409\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/436\/9a9\/7ed\/4369a97edda35aec693ab7f17d569f50.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b\u044b. \u0424\u0430\u0439\u043b<em> Makefile:<\/em><\/p>\n<pre><code class=\"cmake\">#                                                              -*- Makefile -*- # Simics module makefile #  MODULE_COMPONENTS := RISC_controller  PYTHON_FILES = myrisc_comp.py module_load.py  THREAD_SAFE=yes SIMICS_API := latest  include $(MODULE_MAKEFILE)<\/code><\/pre>\n<p> \u0424\u0430\u0439\u043b <em>module_load.py:<\/em><\/p>\n<pre><code class=\"python\">from . import myrisc_comp myrisc_comp.RISC_controller.register()<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <em>load-module &lt;module><\/em>. \u0412 \u043d\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041c\u044b \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a <em>module_load.py<\/em> \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0424\u0430\u0439\u043b <em>myrisc_comp.py:<\/em><\/p>\n<pre><code class=\"python\">import simics import simics_common from comp import *  class RISC_controller(StandardConnectorComponent):     \"\"\"Base class for RISC controller.\"\"\"      def setup(self):         super().setup()         if not self.instantiated.val:             self.add_objects()      class basename(StandardConnectorComponent.basename):         val = \"controller\"      class freq_mhz(SimpleConfigAttribute(40, 'i')):         \"\"\"Processor frequency in MHz, default is 40 MHz.\"\"\"         def setter(self, val):             if val &lt;= 0:                 raise CompException('Illegal processor frequency %d' % val)             self.val = val      class mem_size(SimpleConfigAttribute(0x10000000, 'i')):         \"\"\"Contoller RAM size, default is 0x10000000 bytes.\"\"\"         def setter(self, val):             if val &lt;= 0:                 raise CompException('Illegal controller memory size %d' % val)             self.val = val      class component_queue(StandardComponent.component_queue):         def getter(self):             return self._up.get_clock()      def get_clock(self):         sub_cmps = [x for x in self.obj.iface.component.get_slot_objects() if (             isinstance(x, simics.conf_object_t) and hasattr(x.iface, 'component'))]         clocks = []         for c in sub_cmps:             if hasattr(c, 'component_queue'):                 q = c.component_queue                 if q:                     clocks.append(q)         if len(clocks) > 0:             return clocks[0]      def add_objects(self):         cpu_core = self.add_pre_obj('cpu_core', 'sample-risc-core')         cpu = self.add_pre_obj('cpu', 'sample-risc')         cpu.freq_mhz = self.freq_mhz.val         cpu.current_risc_core = cpu_core         cpu_core.sample_risc = cpu         phys_mem = self.add_pre_obj('phys_mem', 'memory-space')         cpu_core.physical_memory_space = phys_mem         mem = self.add_pre_obj('ram', 'ram')         mem_image = self.add_pre_obj('mem_image', 'image')         mem_image.size = self.mem_size.val         mem.image = mem_image         phys_mem.map = [[0x00000000, mem, 0, 0, self.mem_size.val]]      def get_processors(self):         ret = [self.get_slot('cpu')]         return list(set(ret))      class top_level(StandardComponent.top_level):         def _initialize(self):             self.val = True      class cpu_list(StandardComponent.cpu_list):         def getter(self):             return self._up.get_processors()<\/code><\/pre>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u043d\u0430\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0435 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <em>pre_conf_object()<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <em>add_pre_obj()<\/em> \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 <em>StandardComponent<\/em>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e. \u041c\u044b \u044d\u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. \u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">$> make sample-risc<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 Simics \u0442\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<pre><code>simics> load-module myrisc-comp simics> $controller=(create-RISC-controller name=\"controller\") simics> instantiate-components<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:<\/p>\n<pre><code>simics> list-objects namespace=controller -tree \u2510 \u251c cell \u2510 \u2502      \u2514 ps  \u251c cpu \u2510 \u2502     \u2514 vtime \u2510 \u2502             \u251c cycles  \u2502             \u2514 ps  \u251c cpu_core  \u251c mem_image  \u251c phys_mem  \u2514 ram \u2510       \u2514 port \u2510              \u2514 tags <\/code><\/pre>\n<p>\u041d\u043e \u0438 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043d\u043e\u0433\u043e \ud83d\ude09 \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Simics, \u0432 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <em>targets<\/em>, \u0444\u0430\u0439\u043b <em>myrisc.simics<\/em>:<\/p>\n<pre><code>load-module myrisc-comp $controller=(create-RISC-controller name=\"controller\") instantiate-components controller.status<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>simics> run-command-file \"%simics%\/targets\/myrisc.simics\" Status of controller [class RISC_controller] ============================================  Setup:     Top component : controller      Instantiated : True       System Info :   Attributes:          freq_mhz : 40          mem_size : 268435456  Connections:<\/code><\/pre>\n<h3> \u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435? 1+1=2?<\/h3>\n<p>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0438\u0442\u043e\u0433 \u043d\u0430\u0448\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u041c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0430\u0436\u043d\u0430 \u0441 \u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0446\u0435\u043b\u044c\u044e. \u0426\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438, \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438) \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u0430\u0436\u0435 \u0434\u043e\u043b\u0433\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043c\u0435\u043d\u044b \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u0436\u0435\u043b\u0435\u0437\u0435.  <\/p>\n<p> \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u0448 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e:<\/p>\n<pre><code>simics> controller.phys_mem.write(0x100, 0xDEADBEEF) simics> controller.phys_mem.read(0x100) 3735928559 (BE)<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0442\u043e\u0438\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u043e\u0445\u043d\u0443\u0442\u044c\u2026 \u041d\u043e \u043c\u044b \u0432\u0435\u0434\u044c \u0441 \u0432\u0430\u043c\u0438 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438. \u0412\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u0435? \u041d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442, \u0435\u0449\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u041f\u0417\u0423, \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442. <a href=\"https:\/\/habr.com\/ru\/company\/auriga\/blog\/585180\/\">\u041d\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435\u0441\u044c<\/a>.<\/p>\n<p><sup>[<\/sup><a href=\"#sdfootnote1anc\"><sup>1<\/sup><\/a><sup>]<\/sup> <sup>Intel Core i7\u00a9, Intel Xeon 5500\u00a9, 5530, Intel Atom\u00a9<\/sup><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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:\/\/habr.com\/ru\/articles\/582350\/\"> https:\/\/habr.com\/ru\/articles\/582350\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0430\u043d\u0435\u0435 \u0432 \u0441\u0435\u0440\u0438\u0430\u043b\u0435\u2026 \u0410\u0445, \u0434\u0430, \u043d\u0435 \u0432\u0441\u0435 \u0442\u0435\u0445\u043d\u0430\u0440\u0438 \u0443\u0432\u0430\u0436\u0430\u044e\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u044b. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0441\u043b\u043e\u0432\u043e Simics \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0438 \u043c\u043d\u0435 \u043d\u0435 \u043e\u0442\u0432\u0435\u0440\u0442\u0435\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 <a href=\"https:\/\/habr.com\/ru\/company\/auriga\/blog\/504086\/\">\u00ab\u0421\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u2013 \u043f\u043e\u0445\u043e\u0436\u0438 \u043b\u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u00bb<\/a> \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438 <a href=\"https:\/\/habr.com\/ru\/users\/alex_dzen\/\">@alex_dzen<\/a>.         <\/p>\n<p>\u0418\u0437 \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u044b \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0435 \u0434\u044f\u0434\u044c\u043a\u0438 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043c\u0435\u043d\u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043a \u044d\u0442\u0438\u043c \u00ab\u0434\u044f\u0434\u044c\u043a\u0430\u043c\u00bb, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u0441\u0442\u044c \u2014 \u043d\u0430 \u0434\u043e\u0441\u0443\u0433\u0435 \u044f \u043b\u044e\u0431\u043b\u044e \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0430\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u00ab\u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0443\u044e\u00bb \u0441\u0440\u0435\u0434\u0443 Arduino, \u0433\u0434\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u00ab\u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445\u00bb Atmel-ARM \u0438\u043b\u0438 ESP32-RISC. \u0418 \u0438\u043d\u0442\u0440\u0438\u0433\u0430 \u0432 \u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Simics \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438 \u0445\u043e\u0431\u0431\u0438-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432?<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0427\u0430\u0441\u0442\u044c 1. 1+1<\/h3>\n<p>\u0422\u0438\u0445\u043e, \u0438 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0448\u0443\u043c\u0430 Intel \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u043e\u043b\u043d\u043e\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 Simics. <a href=\"https:\/\/software.intel.com\/content\/www\/us\/en\/develop\/articles\/simics-simulator.html\">\u041f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0412 \u043d\u0435\u0433\u043e \u0432\u0445\u043e\u0434\u044f\u0442: \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440, \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 Intel \u0441 \u044f\u0434\u0440\u043e\u043c Nehalem<a href=\"#sdfootnote1sym\"><sup>1<\/sup><\/a>, \u0447\u0438\u043f\u0441\u0435\u0442\u0430 X58, \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 x86 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432, \u043f\u0430\u043a\u0435\u0442 \u0441 Clear Linux (\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0432 Simics) \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432. \u0412 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0435 \u0432\u043e\u0448\u0435\u043b \u043f\u0430\u043a\u0435\u0442 Simics Eclipse. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0441\u0442\u0438 \u0438 \u0432 Visual Studio, \u0432 Notepad++, \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u00ab\u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c\u00bb Simics \u043a Qt Creator. \u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u043e\u0431\u0440\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u043e\u043c Intel, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0442\u0430\u043c \u0436\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438, \u0434\u043e\u0447\u0438\u0442\u0430\u0432 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0432\u044b \u0443\u0436\u0435 \u0440\u0435\u0448\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043b\u044f \u0432\u0430\u0441, \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u0430\u0436\u0443\u0449\u0438\u0439\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u00ab\u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435\u00bb \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u0435\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0448\u0438\u043d\u0435 PCI, USB1\/2\/3, I2C\/I3C \u0438 \u0442.\u00a0\u0434. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c Xtensa SDK, \u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a Simics \u043b\u044e\u0431\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 Xtensa. \u0410 \u0435\u0441\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0448\u0430\u0440\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 RISC-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432. \u0412\u043e\u0442 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u044f \u0438 \u0438\u0441\u043a\u0430\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f. \u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u043c\u043d\u043e\u0439 \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u0431\u0430\u0437\u0435 RISC-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u041f\u0417\u0423, \u041e\u0417\u0423. \u041f\u043e \u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0438 \u043f\u0430\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u0432 \u0438\u0445 \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0436 \u0441 \u043d\u0443\u043b\u044f (\u0447\u0442\u043e, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0432 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438) \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 sample-risc \u0438\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0435 \u0441\u0435\u0431\u0435 \u0432 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 Simics<\/p>\n<pre><code class=\"bash\">$> .\/bin\/project-setup --copy-module sample-risc<\/code><\/pre>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c<\/p>\n<pre><code class=\"bash\">$> make sample-risc<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u041e\u0417\u0423:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 Simics:<\/p>\n<pre><code>simics> load-module sample-risc simics> @import simics_common simics> @MEMORY_SIZE = 0x10000000 simics> @cpu = simics_common.pre_conf_object(\"cpu\",\"sample-risc\") simics> @cpu.freq_mhz = 40 simics> @cpu_core = simics_common.pre_conf_object(\"cpu_core\",\"sample-risc-core\") simics> @cpu.current_risc_core = cpu_core simics> @phys_mem = simics_common.pre_conf_object(\"phys_mem\",\"memory-space\") simics> @cpu_core.physical_memory_space = phys_mem simics> @mem = simics_common.pre_conf_object(\"ram\", \"ram\") simics> @mem_image = simics_common.pre_conf_object(\"mem_image\", \"image\") simics> @mem_image.size = MEMORY_SIZE simics> @mem.image = mem_image simics> @phys_mem.map = [[0x00000000, mem, 0, 0, MEMORY_SIZE]] simics> @cpu_core.sample_risc = cpu simics> @simics.SIM_add_configuration([cpu,cpu_core,phys_mem,mem,mem_image], None)<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442, \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Simics \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c:<\/p>\n<pre><code>simics> phys_mem.write(0x100, 0xDEADBEEF) simics> phys_mem.read(0x100) 3735928559 (BE)<\/code><\/pre>\n<p>BE \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0443 \u043d\u0430\u0441 \u00abbig-endian\u00bb, \u043a\u0430\u043a \u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435\u043c\u0443 RISC \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 Python-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>pre_conf_object()<\/em>, \u0441\u0442\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Simics. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435 16-\u0442\u0438 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 \u0438 \u0447\u0438\u043f\u043e\u0432:<\/p>\n<pre><code>simics> output-radix 16 simics> phys_mem.read(0x100) 0xdeadbeef (BE)<\/code><\/pre>\n<p>\u041f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \ud83d\ude09<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c sample-risc. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b <em>s-add.py<\/em> \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <em>add r1, r2<\/em>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432 \u043d\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<p>\u0412 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Simics, \u0432 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <em>modules <\/em>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <em>myrisc-comp.<\/em><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b\u044b. \u0424\u0430\u0439\u043b<em> Makefile:<\/em><\/p>\n<pre><code class=\"cmake\">#                                                              -*- Makefile -*- # Simics module makefile #  MODULE_COMPONENTS := RISC_controller  PYTHON_FILES = myrisc_comp.py module_load.py  THREAD_SAFE=yes SIMICS_API := latest  include $(MODULE_MAKEFILE)<\/code><\/pre>\n<p> \u0424\u0430\u0439\u043b <em>module_load.py:<\/em><\/p>\n<pre><code class=\"python\">from . import myrisc_comp myrisc_comp.RISC_controller.register()<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <em>load-module &lt;module><\/em>. \u0412 \u043d\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041c\u044b \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a <em>module_load.py<\/em> \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0424\u0430\u0439\u043b <em>myrisc_comp.py:<\/em><\/p>\n<pre><code class=\"python\">import simics import simics_common from comp import *  class RISC_controller(StandardConnectorComponent):     \"\"\"Base class for RISC controller.\"\"\"      def setup(self):         super().setup()         if not self.instantiated.val:             self.add_objects()      class basename(StandardConnectorComponent.basename):         val = \"controller\"      class freq_mhz(SimpleConfigAttribute(40, 'i')):         \"\"\"Processor frequency in MHz, default is 40 MHz.\"\"\"         def setter(self, val):             if val &lt;= 0:                 raise CompException('Illegal processor frequency %d' % val)             self.val = val      class mem_size(SimpleConfigAttribute(0x10000000, 'i')):         \"\"\"Contoller RAM size, default is 0x10000000 bytes.\"\"\"         def setter(self, val):             if val &lt;= 0:                 raise CompException('Illegal controller memory size %d' % val)             self.val = val      class component_queue(StandardComponent.component_queue):         def getter(self):             return self._up.get_clock()      def get_clock(self):         sub_cmps = [x for x in self.obj.iface.component.get_slot_objects() if (             isinstance(x, simics.conf_object_t) and hasattr(x.iface, 'component'))]         clocks = []         for c in sub_cmps:             if hasattr(c, 'component_queue'):                 q = c.component_queue                 if q:                     clocks.append(q)         if len(clocks) > 0:             return clocks[0]      def add_objects(self):         cpu_core = self.add_pre_obj('cpu_core', 'sample-risc-core')         cpu = self.add_pre_obj('cpu', 'sample-risc')         cpu.freq_mhz = self.freq_mhz.val         cpu.current_risc_core = cpu_core         cpu_core.sample_risc = cpu         phys_mem = self.add_pre_obj('phys_mem', 'memory-space')         cpu_core.physical_memory_space = phys_mem         mem = self.add_pre_obj('ram', 'ram')         mem_image = self.add_pre_obj('mem_image', 'image')         mem_image.size = self.mem_size.val         mem.image = mem_image         phys_mem.map = [[0x00000000, mem, 0, 0, self.mem_size.val]]      def get_processors(self):         ret = [self.get_slot('cpu')]         return list(set(ret))      class top_level(StandardComponent.top_level):         def _initialize(self):             self.val = True      class cpu_list(StandardComponent.cpu_list):         def getter(self):             return self._up.get_processors()<\/code><\/pre>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u043d\u0430\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0435 \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <em>pre_conf_object()<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <em>add_pre_obj()<\/em> \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 <em>StandardComponent<\/em>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e. \u041c\u044b \u044d\u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. \u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">$> make sample-risc<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 Simics \u0442\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<pre><code>simics> load-module myrisc-comp simics> $controller=(create-RISC-controller name=\"controller\") simics> instantiate-components<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:<\/p>\n<pre><code>simics> list-objects namespace=controller -tree \u2510 \u251c cell \u2510 \u2502      \u2514 ps  \u251c cpu \u2510 \u2502     \u2514 vtime \u2510 \u2502             \u251c cycles  \u2502             \u2514 ps  \u251c cpu_core  \u251c mem_image  \u251c phys_mem  \u2514 ram \u2510       \u2514 port \u2510              \u2514 tags <\/code><\/pre>\n<p>\u041d\u043e \u0438 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043d\u043e\u0433\u043e \ud83d\ude09 \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 Simics, \u0432 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <em>targets<\/em>, \u0444\u0430\u0439\u043b <em>myrisc.simics<\/em>:<\/p>\n<pre><code>load-module myrisc-comp $controller=(create-RISC-controller name=\"controller\") instantiate-components controller.status<\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>simics> run-command-file \"%simics%\/targets\/myrisc.simics\" Status of controller [class RISC_controller] ============================================  Setup:     Top component : controller      Instantiated : True       System Info :   Attributes:          freq_mhz : 40          mem_size : 268435456  Connections:<\/code><\/pre>\n<h3> \u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435? 1+1=2?<\/h3>\n<p>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0438\u0442\u043e\u0433 \u043d\u0430\u0448\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u041c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0430\u0436\u043d\u0430 \u0441 \u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0446\u0435\u043b\u044c\u044e. \u0426\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438, \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438) \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u0430\u0436\u0435 \u0434\u043e\u043b\u0433\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043c\u0435\u043d\u044b \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u0436\u0435\u043b\u0435\u0437\u0435.  <\/p>\n<p> \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u0448 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e:<\/p>\n<pre><code>simics> controller.phys_mem.write(0x100, 0xDEADBEEF) simics> controller.phys_mem.read(0x100) 3735928559 (BE)<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0442\u043e\u0438\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0438<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-387942","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/387942","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=387942"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/387942\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=387942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=387942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}