{"id":675,"date":"2013-09-01T19:40:09","date_gmt":"2013-09-01T19:40:09","guid":{"rendered":"http:\/\/retroramblings.net\/?page_id=675"},"modified":"2026-08-14T12:54:51","modified_gmt":"2026-08-14T12:54:51","slug":"dhrystone-fast","status":"publish","type":"page","link":"https:\/\/retroramblings.net\/?page_id=675","title":{"rendered":"Dhrystone Fast"},"content":{"rendered":"<p>The Dhrystone_fast project demonstrates increasing the ZPU&#8217;s speed by enabling optional hardware instructions, at the cost of increasing the CPU&#8217;s footprint. The firmware is identical to that used by the Dhrystone_min project, except for some CFLAGS.\u00a0 Because we have hardware implementations of some instructions available, for performance reasons it&#8217;s useful to tell the compiler to prefer those instructions and avoid the ones that are still emualted.<\/p>\n<p>The ZPU is configured like so:<\/p>\n<pre>generic map (\r\n\tIMPL_MULTIPLY =&gt; true,\r\n\tIMPL_COMPARISON_SUB =&gt; true,\r\n\tIMPL_EQBRANCH =&gt; true,\r\n\tIMPL_STOREBH =&gt; false,\r\n\tIMPL_LOADBH =&gt; false,\r\n\tIMPL_CALL =&gt; true,\r\n\tIMPL_SHIFT =&gt; true,\r\n\tIMPL_XOR =&gt; true,\r\n\tREMAP_STACK =&gt; false,\r\n\tEXECUTE_RAM =&gt; false,\r\n\tmaxAddrBitBRAM =&gt; 13\r\n)<\/pre>\n<p>Notice that we leave STOREBH and LOADBH set to false. The reason for this is simply that those instructions aren&#8217;t yet fully implemented in my ZPUFlex variant of the ZPU processor. While they work for external RAM access, they don&#8217;t currently do anything for Block RAM access. It&#8217;s possible to specify compiler flags in the Makefile (-mno-byteop -mno-shortop) which will make the compiler emit load\/shift\/mask\/store code to replace those instructions &#8211; this allows, for example, a Boot ROM to load a program into SDRAM, and the bootstrapped program to benefit from hardware loadb\/storeb without breaking the Boot ROM.<\/p>\n<p>Even with emulated loadb\/storeb, the fast version of the project turns in 5.6 DMIPS, the whole project being 1135 logic elements on the DE1, and the ZPU itself taking up 926.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Dhrystone_fast project demonstrates increasing the ZPU&#8217;s speed by enabling optional hardware instructions, at the cost of increasing the CPU&#8217;s footprint. The firmware is identical to that used by the Dhrystone_min project, except for some CFLAGS.\u00a0 Because we have hardware &hellip; <a href=\"https:\/\/retroramblings.net\/?page_id=675\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":648,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-675","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/675","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=675"}],"version-history":[{"count":5,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/675\/revisions"}],"predecessor-version":[{"id":2091,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/675\/revisions\/2091"}],"up":[{"embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/pages\/648"}],"wp:attachment":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}