{"id":325,"date":"2018-02-13T13:26:24","date_gmt":"2018-02-13T13:26:24","guid":{"rendered":"http:\/\/fpganow.com\/?p=325"},"modified":"2018-02-13T14:14:16","modified_gmt":"2018-02-13T14:14:16","slug":"axi4-microblaze-64-bit","status":"publish","type":"post","link":"https:\/\/fpganow.com\/index.php\/2018\/02\/13\/axi4-microblaze-64-bit\/","title":{"rendered":"AXI4 + MicroBlaze != 64-bit"},"content":{"rendered":"<p>The 10 Gigabit MAC\/transceiver gives me 64 bit data words.\u00a0 I currently think I am giving and getting\u00a0 64 bit data words, but I am really only using 32 bits.\u00a0 I came to this conclusion after I tried reading a 64 bit word and saw the data was simply two repeated 32 bit words.\u00a0 Additionally some random person on the internet said that the MicroBlaze data bus is 32-bit and you have to use some sort of data width converter ip.<\/p>\n<p>Out of luck&#8230; I don&#8217;t know how to use the converter, but I am sure there is a way to properly convert this by using LabVIEW FPGA.\u00a0 So for starters, this means I can remove my AXI4 Stream Data FIFOs and keep the two 32-bit versions.\u00a0 I&#8217;ll also throw in support for TKEEP while I am at it.<\/p>\n<p>So the &#8220;Receive Ethernet Frame&#8221; code from the 10 Gigabit transceiver\/MAC looks like this:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/10Gigabit-Receive.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-326 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/10Gigabit-Receive.png\" alt=\"\" width=\"1008\" height=\"480\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/10Gigabit-Receive.png 1008w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/10Gigabit-Receive-300x143.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/10Gigabit-Receive-768x366.png 768w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/a><\/p>\n<p>I have to convert this 64-bit data stream in to a 32-bit data stream before I send it in to the MicroBlaze.\u00a0 Here is the current\/erroneous implementation:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/MicroBlaze-Receive-64-bit-implementation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-327 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/MicroBlaze-Receive-64-bit-implementation.png\" alt=\"\" width=\"1175\" height=\"448\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/MicroBlaze-Receive-64-bit-implementation.png 1175w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/MicroBlaze-Receive-64-bit-implementation-300x114.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/MicroBlaze-Receive-64-bit-implementation-768x293.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/MicroBlaze-Receive-64-bit-implementation-1024x390.png 1024w\" sizes=\"auto, (max-width: 1175px) 100vw, 1175px\" \/><\/a><\/p>\n<p>So what do I have to do? I have to read one element from the LabVIEW FIFO &#8211; the FIFO on the left, write the upper half of the 32 bit word in one cycle, and not read from the LabVIEW FIFO for the next clock cycle and to write the lower half of the 32 bit word.\u00a0 Want to see the power of LabVIEW? It is 7:22 AM right now&#8230; [elevator music\/jeopardy music starts playing in the background]<\/p>\n<p>Now it is 8:07 AM and I have finished re-factoring this loop.\u00a0 I am writing the upper half of each 64 bit word in one cycle, and am writing the bottom half during the next clock cycle.\u00a0 I am also keeping the logic that appends an extra word which contains the &#8220;EndOfGoodFrame&#8221;, and &#8220;EndOfBadFrame&#8221; boolean values.\u00a0 Since I am writing 32-bit words now, I am only appending one word.<\/p>\n<p>Here is the full loop:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U64-toAXI-U32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-329 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U64-toAXI-U32.png\" alt=\"\" width=\"1560\" height=\"465\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U64-toAXI-U32.png 1560w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U64-toAXI-U32-300x89.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U64-toAXI-U32-768x229.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U64-toAXI-U32-1024x305.png 1024w\" sizes=\"auto, (max-width: 1560px) 100vw, 1560px\" \/><\/a><\/p>\n<p>And a close up of Case 0 of the innermost Case Structure:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-330\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-0.png\" alt=\"\" width=\"1000\" height=\"566\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-0.png 663w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-0-300x170.png 300w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p>And a close up of Case 1:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-331\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-1.png\" alt=\"\" width=\"1000\" height=\"569\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-1.png 666w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Close-Up-Case-1-300x171.png 300w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p>I now have to do this for the other direction &#8211; convert a LabVIEW FIFO packet to an AXI 32-bit stream. Here is the current implementation:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U32-AXI-U64-FIFO.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-333 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U32-AXI-U64-FIFO.png\" alt=\"\" width=\"1153\" height=\"442\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U32-AXI-U64-FIFO.png 1153w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U32-AXI-U64-FIFO-300x115.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U32-AXI-U64-FIFO-768x294.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/Convert-U32-AXI-U64-FIFO-1024x393.png 1024w\" sizes=\"auto, (max-width: 1153px) 100vw, 1153px\" \/><\/a><\/p>\n<p>The signal on AXI_STR_TXD_data is a U32 and I have to collect 2 of these values and insert them in to the FIFO on the right side.\u00a0 I am going to have to think about this for a bit, but I have to get ready and go to work.\u00a0 So I may not finish this before leaving.<\/p>\n<p>Thanks and have a nice day!<\/p>\n<p><strong>Update:<\/strong> Okay, this is not that pretty, but here is my first-cut &#8220;20 minutes&#8221; version:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/First-cut.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-336 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/First-cut.png\" alt=\"\" width=\"1592\" height=\"538\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/First-cut.png 1592w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/First-cut-300x101.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/First-cut-768x260.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/02\/First-cut-1024x346.png 1024w\" sizes=\"auto, (max-width: 1592px) 100vw, 1592px\" \/><\/a><\/p>\n<p>Now I have to go and get ready! But I&#8217;ll be sure to set everything to synthesize before I leave&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The 10 Gigabit MAC\/transceiver gives me 64 bit data words.\u00a0 I currently think I am giving and getting\u00a0 64 bit data words, but I am really only using 32 bits.\u00a0 I came to this conclusion after I tried reading a 64 bit word and saw the data was simply two repeated 32 bit words.\u00a0 Additionally &#8230; <a title=\"AXI4 + MicroBlaze != 64-bit\" class=\"read-more\" href=\"https:\/\/fpganow.com\/index.php\/2018\/02\/13\/axi4-microblaze-64-bit\/\" aria-label=\"Read more about AXI4 + MicroBlaze != 64-bit\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[7,6,8],"tags":[],"class_list":["post-325","post","type-post","status-publish","format-standard","hentry","category-fpga","category-labview","category-microblaze","masonry-post","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":6,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"predecessor-version":[{"id":338,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/posts\/325\/revisions\/338"}],"wp:attachment":[{"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}