{"id":453,"date":"2013-04-26T00:14:03","date_gmt":"2013-04-26T00:14:03","guid":{"rendered":"http:\/\/retroramblings.net\/?p=453"},"modified":"2013-05-05T23:17:32","modified_gmt":"2013-05-05T23:17:32","slug":"speed-size-tradeoffs","status":"publish","type":"post","link":"http:\/\/retroramblings.net\/?p=453","title":{"rendered":"Speed \/ size tradeoffs"},"content":{"rendered":"<p>I&#8217;ve been playing some more with the small version of the ZPU core, and have successfully integrated it into a cut-down version of my previous MiniSOC project.  The &#8220;official&#8221; small core only supports BlockRAM access, with external access reserved for IO.  I&#8217;ve reversed this so that only the stack is in the CPU core&#8217;s internal BlockRAM, and program data comes from external RAM.<\/p>\n<p>In addition, I&#8217;ve added optional hardware implementations of a few of the emulated instructions, namely mult (the Cyclone II has hardware multipliers, so why not use them?), eq, eqbranch and neqbranch.  I think I can add the comparison instructions without bloating the core too much, as well.<\/p>\n<p>By way of a benchmark, I&#8217;ve written a simple framebuffer test which simply writes a pattern of ascending longwords into the framebuffer.  With the optional instructions disabled, this achieves about 1.9 frames per second, and the CPU takes up 621 logic elements.<br \/>\nWith eq and eqbranch\/neqbranch in hardware, the frame rate goes up to about 5.25, and the core takes 781 logic elements.<\/p>\n<p>There&#8217;s lots still to do &#8211; reading from SDRAM is untested, and writes are currently always 32-bit &#8211; but the project <a href=\"https:\/\/github.com\/robinsonb5\/ZPUTest\">is available here<\/a> (currently DE1 toplevel only) for anyone who might be interested.<\/p>\n<p><a href=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2013\/04\/ZPUFramebufferTest.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2013\/04\/ZPUFramebufferTest.jpg\" alt=\"ZPUFramebufferTest\" width=\"651\" height=\"500\" class=\"alignnone size-full wp-image-454\" srcset=\"http:\/\/retroramblings.net\/wp-content\/uploads\/2013\/04\/ZPUFramebufferTest.jpg 651w, http:\/\/retroramblings.net\/wp-content\/uploads\/2013\/04\/ZPUFramebufferTest-300x230.jpg 300w, http:\/\/retroramblings.net\/wp-content\/uploads\/2013\/04\/ZPUFramebufferTest-390x300.jpg 390w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been playing some more with the small version of the ZPU core, and have successfully integrated it into a cut-down version of my previous MiniSOC project. The &#8220;official&#8221; small core only supports BlockRAM access, with external access reserved for &hellip; <a href=\"http:\/\/retroramblings.net\/?p=453\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-fpga"],"_links":{"self":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=453"}],"version-history":[{"count":3,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":481,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions\/481"}],"wp:attachment":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}