{"id":627,"date":"2013-08-07T00:25:16","date_gmt":"2013-08-07T00:25:16","guid":{"rendered":"http:\/\/retroramblings.net\/?page_id=627"},"modified":"2020-02-01T15:33:50","modified_gmt":"2020-02-01T15:33:50","slug":"the-zpu-processor","status":"publish","type":"page","link":"https:\/\/retroramblings.net\/?page_id=627","title":{"rendered":"ZPUFlex"},"content":{"rendered":"<p>The ZPU or <a href=\"http:\/\/opensource.zylin.com\/zpu.htm\">Zylin Processing Unit<\/a> is a compact microprocessor architecture suitable for use in FPGA projects. Its main claim to fame is that despite being tiny compared with most 32-bit RISC CPU cores, there is a full GCC toolchain available &#8211; in fact the OpenCores page says <a href=\"the ZPU is the world's smallest 32-bit CPU with GCC toolchain\">the ZPU is the world&#8217;s smallest 32-bit CPU with GCC toolchain<\/a>.<\/p>\n<p>Rather than being a specific single processor design, the ZPU is more of a specification which defines a set of instructions (some of which are mandatory, some of which can be emulated), and there are a number of different cores which implement this instruction set.<\/p>\n<p>Despite the maintainers&#8217; obvious desire to reduce the number of ZPU variants and offer just a few definitive cores, I&#8217;ve ended up creating yet another variant, which I&#8217;ve come to call <a href=\"https:\/\/github.com\/robinsonb5\/ZPUFlex\">ZPUFlex<\/a>.<\/p>\n<p>ZPUFlex is based on the zpu_small core, but as its name might suggest, adds flexibility.&nbsp; Compared with the vanilla zpu_small core this version:<\/p>\n<ul>\n<li>Moves the dual-port block RAM containing the stack and initial program out of the core itself and instead specifies an interface to the same.&nbsp; This makes it possible to use more than one ZPU core in a single project, and have each one executing different firmware.<\/li>\n<li>Makes the size of the stack \/ boot ROM selectable through Generics.&nbsp; Again, this helps if you want to use multiple instances with different sized ROMs in a single project.<\/li>\n<li>Includes selectable hardware implementations of enough of the optional instructions that it&#8217;s possible to omit the emulation exceptions from the ROM, thus allowing the user to trade resource usage against speed and code size.<\/li>\n<li>Can remap the stack to a user-selectable address, leaving the low address space clear for &#8220;real&#8221; RAM.<\/li>\n<li>Is optionally capable of running code from external RAM rather than just the boot ROM, making it possible to bootstrap from SD card or Flash a program too large to fit in the boot ROM.<\/li>\n<\/ul>\n<p>The ZPU is not a particularly fast CPU &#8211; its beauty is in its simplicity and flexibility.&nbsp; The simplicity of design makes it an ideal candidate for anyone who wants to study and experiment with the operation of a CPU.<\/p>\n<p>On an Altera FPGA, the ZPUFlex takes up roughly 1,000 logic elements when all the bells and whistles are enabled, and a little over half that when cut to the bone.<\/p>\n<p>Full source for the ZPUFlex can be found on <a href=\"https:\/\/github.com\/robinsonb5\/ZPUFlex\">my GitHub pages.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ZPU or Zylin Processing Unit is a compact microprocessor architecture suitable for use in FPGA projects. Its main claim to fame is that despite being tiny compared with most 32-bit RISC CPU cores, there is a full GCC toolchain &hellip; <a href=\"https:\/\/retroramblings.net\/?page_id=627\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1344,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-627","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=627"}],"version-history":[{"count":9,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/627\/revisions"}],"predecessor-version":[{"id":1346,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/627\/revisions\/1346"}],"up":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/1344"}],"wp:attachment":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}