{"id":1394,"date":"2020-03-13T19:55:46","date_gmt":"2020-03-13T19:55:46","guid":{"rendered":"http:\/\/retroramblings.net\/?p=1394"},"modified":"2020-03-13T19:55:46","modified_gmt":"2020-03-13T19:55:46","slug":"always-check-the-simple-things","status":"publish","type":"post","link":"https:\/\/retroramblings.net\/?p=1394","title":{"rendered":"Always check the simple things!"},"content":{"rendered":"\n<p><strong>2020-03-13<\/strong><\/p>\n\n\n\n<p>Long story short: I&#8217;ve just spent way too much debugging a problem that turned out simply to be an SDRAM chip&#8217;s CKE line not connected in the toplevel design file!<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>A while back I discovered the Next186_SoC FPGA core, by Nicolae Dumitrache.  When I first learned of this excellent core&#8217;s existence I could&#8217;t find any ports to Altera devices &#8211; the main target device was a Nexys board that had DDR SDRAM, and porting the core to the boards in my possession (Altera FPGAs, single data rate SDRAM) was beyond my skill level at the time.  A few months back, however, it was pointed out to me that the original author had ported the core to the Turbo Chameleon 64 V2 &#8211; but not the V1 hardware.<\/p>\n\n\n\n<p>I set out to backport this great core to the older hardware, and &#8211; as so often happens &#8211; found myself wanting to build multiple targets from a single source tree.<\/p>\n\n\n\n<p>I also found, quite quickly, that setting up an SD card for use with the core is a royal pain.  Because extracting the size information from a non-high-capacity SD card is so absurdly convoluted, the core&#8217;s boot ROM only supports SDHC cards.  It requires an 8k BIOS image to be written to the last 8k of the card &#8211; which is not an easy thing to arrange &#8211; and it requires a FAT16 boot partition on the card.<\/p>\n\n\n\n<p>So began my quest to improve the core, by adding a new bootstrap module with an extra CPU (originally ZPU, but I&#8217;m in the process of replacing this with EightThirtyTwo) and floppy-disk image support and support for a wider range of SD cards.<\/p>\n\n\n\n<p>The biggest problem I faced was that, while there&#8217;s plenty of logic elements left from the 25,000-odd available in the target devices, there&#8217;s next to no block RAM left, which makes debugging problems by way of SignalTap very difficult.<\/p>\n\n\n\n<p>To address this problem, I&#8217;ve just bought a de10-lite devboard, which has a MAX10 FPGA with about 50,000 logic elements (drool!) but better yet, well over 1.6 million bits of block RAM &#8211; all using similar enough techology to the Cyclone III \/ Cylone 10LP chips that IP megafunctions translate directly.  The memory blocks are even still M9Ks!<\/p>\n\n\n\n<p>So I&#8217;ve ported the core to the de10-lite, hooked up an SD card module to the Arduino headers, and tried it out for the first time&#8230;<\/p>\n\n\n\n<p>Nothing.<\/p>\n\n\n\n<p>After checking many, many things, from the polarity of reset signals to timing constraints, I was pretty sure the problem was SD-RAM related &#8211; then it finally dawned on me: neither version of the Turbo Chameleon hardware connects the SDRAM chip&#8217;s CKE signal to the FPGA &#8211; there wasn&#8217;t a spare IO pin &#8211; so instead CKE is tied high.  I&#8217;d neglected to account for this in my port!<\/p>\n\n\n\n<p>So having tied the signal high in the toplevel design file, well&#8230;. OK &#8211; it still doesn&#8217;t fully work, but it now not works a lot less than it didn&#8217;t work before.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2020-03-13 Long story short: I&#8217;ve just spent way too much debugging a problem that turned out simply to be an SDRAM chip&#8217;s CKE line not connected in the toplevel design file!<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[],"class_list":["post-1394","post","type-post","status-publish","format-standard","hentry","category-fpga","category-hardware"],"_links":{"self":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/1394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"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=1394"}],"version-history":[{"count":2,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/1394\/revisions"}],"predecessor-version":[{"id":1396,"href":"https:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/1394\/revisions\/1396"}],"wp:attachment":[{"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}