{"id":346,"date":"2018-03-02T13:35:06","date_gmt":"2018-03-02T13:35:06","guid":{"rendered":"http:\/\/fpganow.com\/?p=346"},"modified":"2018-03-02T13:44:13","modified_gmt":"2018-03-02T13:44:13","slug":"30000-foot-view","status":"publish","type":"post","link":"https:\/\/fpganow.com\/index.php\/2018\/03\/02\/30000-foot-view\/","title":{"rendered":"30,000 Foot View"},"content":{"rendered":"<p>I normally avoid shop words or &#8220;corporate speak&#8221; because I feel it dehumanizes us, but sometimes these phrases are necessary.\u00a0 So here is the &#8220;30,000 foot&#8221; view.\u00a0 And please pardon the appearance of my flow charts and diagrams, I am not a graphic designer&#8230;<\/p>\n<p>All images open in a new tab, so just click on them with ease until I figure out how to make this WordPress theme wider.<\/p>\n<p>Take\u00a0 look at this:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/30000-Foot-Overview.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-349 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/30000-Foot-Overview.png\" alt=\"\" width=\"1531\" height=\"873\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/30000-Foot-Overview.png 1531w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/30000-Foot-Overview-300x171.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/30000-Foot-Overview-768x438.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/30000-Foot-Overview-1024x584.png 1024w\" sizes=\"auto, (max-width: 1531px) 100vw, 1531px\" \/><\/a><\/p>\n<ul class=\"ili-indent\">\n<li>There are four (4) 10 Gigabit ports available on this device, but I am using only one of them for this design.<\/li>\n<li>The FPGA design contains a MicroBlaze soft-core Processor<\/li>\n<li>This MicroBlaze soft-core Processor is connected to a LabVIEW for Windows Executable, which is the same thing as a standard .exe file.<\/li>\n<\/ul>\n<p>Now some more details:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/More-Details.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-350 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/More-Details.png\" alt=\"\" width=\"1546\" height=\"838\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/More-Details.png 1546w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/More-Details-300x163.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/More-Details-768x416.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/More-Details-1024x555.png 1024w\" sizes=\"auto, (max-width: 1546px) 100vw, 1546px\" \/><\/a><\/p>\n<ul class=\"ili-indent\">\n<li>Any type of Ethernet Frame can enter the 10 Gigabit PHY, as shown in the diagram:\n<ul>\n<li>An Ethernet Frame with an ARP Request<\/li>\n<li>An Ethernet Frame with an IPv4 Packet containing an ICMP packet, otherwise known as a &#8220;Ping&#8221; message<\/li>\n<li>An Ethernet Frame with an IPv4 Packet containing a UDP packet.\u00a0 You may known this as &#8220;multicast&#8221; or &#8220;broadcast&#8221; messages.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>And finally, everything, the full shebang:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Full-shebang.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-351 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Full-shebang.png\" alt=\"\" width=\"1556\" height=\"879\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Full-shebang.png 1556w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Full-shebang-300x169.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Full-shebang-768x434.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Full-shebang-1024x578.png 1024w\" sizes=\"auto, (max-width: 1556px) 100vw, 1556px\" \/><\/a>I have broken out the details of the hardware comprising the 10 Gigabit connection.\u00a0 Technically it consists of 4 SFP+ connectors going to a Multi-Gigabit Transceiver.\u00a0 Now normally I would think that there is some sort of chip in between the SFP+ and the FPGA, but I believe that National Instruments has used some Xilinx IP that handles this for us.\u00a0 <em>See, I don&#8217;t even know what hardware is being used, but I am able to use it and make an FPGA-based Network Card!<\/em><\/p>\n<h2><\/h2>\n<p>The data from the Multi-Gigabit Transceiver then goes to the 10 GE MAC Core, which sends all received packets<\/p>\n<p><strong>First, a Definition<\/strong><\/p>\n<p>CLIP &#8211; Stands for Component Level IP and is a method of bringing in non-LabVIEW FPGA code in to LabVIEW.\u00a0 Basically you take a synthesized design, wrap it up in some VHDL and import this VHDL file to LabVIEW.\u00a0 In this case an instance of the OpenCores 10 GE Mac is being brought in to the the design.<\/p>\n<p>See the top-level wrapper VHDL file here:<\/p>\n<p><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/CLIP\/TenGbEClip.vhd\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/CLIP\/TenGbEClip.vhd<\/a><\/p>\n<p>See the source code of this core here:<\/p>\n<p><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/tree\/master\/07_10_Gigabit_CLIP\/CLIP\/xge_mac_opencore\/source\/xge_mac_opencore\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/tree\/master\/07_10_Gigabit_CLIP\/CLIP\/xge_mac_opencore\/source\/xge_mac_opencore<\/a><\/p>\n<p>See the official project website for this core here:<\/p>\n<p><a href=\"https:\/\/opencores.org\/project,xge_mac\" target=\"_blank\" rel=\"noopener\">https:\/\/opencores.org\/project,xge_mac<\/a><\/p>\n<p><strong>Now the Descriptions<\/strong><\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Everything-with-Annotations.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-353 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Everything-with-Annotations.png\" alt=\"\" width=\"1554\" height=\"860\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Everything-with-Annotations.png 1554w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Everything-with-Annotations-300x166.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Everything-with-Annotations-768x425.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/Everything-with-Annotations-1024x567.png 1024w\" sizes=\"auto, (max-width: 1554px) 100vw, 1554px\" \/><\/a><\/p>\n<p><span style=\"font-size: 24pt;\"><strong>A<\/strong><\/span> &#8211; The reading of incoming frames is wrapped up in to a nice library by National Instruments, that even includes some IP to respond to ARP messages.\u00a0 I have stripped all of this usage out for this design because I wanted simplicity for learning.\u00a0 Anyway, on each clock cycle you have the following variables:<\/p>\n<ul class=\"ili-indent\">\n<li>data valid [boolean]<\/li>\n<li>data [64 bit WORD]<\/li>\n<li>byte enables [array of 8 booleans]<\/li>\n<li>End of Good Frame [boolean]<\/li>\n<li>End of Bad Frame [boolean]<\/li>\n<\/ul>\n<p>Here is a screenshot of the usage for this, it should be very easy to understand once you have an idea of what LabVIEW is and how it works.<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/CLIP-Incoming.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-355 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/CLIP-Incoming.png\" alt=\"\" width=\"301\" height=\"329\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/CLIP-Incoming.png 301w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/CLIP-Incoming-274x300.png 274w\" sizes=\"auto, (max-width: 301px) 100vw, 301px\" \/><\/a><\/p>\n<p><span style=\"font-size: 24pt;\"><strong>B<\/strong><\/span> &#8211; Now the data coming from the 10 Gigabit PHY contains 64-bit WORDs, and 2 booleans, one for a good frame, and one for a bad frame.\u00a0 Now I do not know how to configure and properly use a 64-bit AXI-Data Stream FIFO with a MicroBlaze processor, so I had to convert this data manually myself.\u00a0 It did not take long, in fact I documented this in my log where it took me 1 hour and 15 minutes to do this following the LabVIEW FPGA State Machine paradigm.\u00a0 Think of the LabVIEW FPGA State Machine paradigm or pattern as the absolute best of both worlds in terms of VHDL\/Verilog and LabVIEW.<\/p>\n<p>So, we have data coming in what I call &#8220;AXI-64bit format&#8221; and we have to convert it\/write it to a LabVIEW FIFO.\u00a0 Here is a close-up of this code:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/B-AXI-64-to-LabVIEW-FIFO.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-356 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/B-AXI-64-to-LabVIEW-FIFO.png\" alt=\"\" width=\"1011\" height=\"456\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/B-AXI-64-to-LabVIEW-FIFO.png 1011w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/B-AXI-64-to-LabVIEW-FIFO-300x135.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/B-AXI-64-to-LabVIEW-FIFO-768x346.png 768w\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" \/><\/a><\/p>\n<p>The code above is running inside a loop clocked at 156.25 MHz, and on the left is how we get the data from the 10 GE MAC.\u00a0 If &#8220;data valid&#8221;, or &#8220;End of Good Frame&#8221; or &#8220;End of Bad Frame&#8221; are true, we enter the self explanatory Case Structure, which is the same thing as an if statement.\u00a0 Inside this case we package all the data in to a custom &#8220;Cluster type&#8221;, which is the same thing as a C structure and write it in to a LabVIEW FIFO.<\/p>\n<p><span style=\"font-size: 24pt;\"><strong>C<\/strong><\/span> &#8211; Now we read one element on each clock cycle of the custom LabVIEW Cluster defined in step B, and convert this in to a 32-bit AXI Data Stream to be read by the MicroBlaze.<\/p>\n<p>Here is a screenshot of the entire loop, which runs at 100MHz, because I clocked my MicroBlaze to that speed.\u00a0 I could probably increase my MicroBlaze to 156.25MHz, but that will decrease my productivity in terms of longer synthesis times.<a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Whole-Loop.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-357 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Whole-Loop.png\" alt=\"\" width=\"1411\" height=\"536\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Whole-Loop.png 1411w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Whole-Loop-300x114.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Whole-Loop-768x292.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Whole-Loop-1024x389.png 1024w\" sizes=\"auto, (max-width: 1411px) 100vw, 1411px\" \/><\/a><\/p>\n<p>I zoomed out a bit further for this screenshot and included the clock specifier, which is 100 MHz.\u00a0 Also notice how there is another &#8220;Case Structure&#8221; inside this loop, but the case is not &#8220;True&#8221;, but it is a State Machine with the &#8220;Read-Top&#8221; case showing as the default state.\u00a0 This state checks if the incoming data is valid, and if so writes the upper 32 bits of the 64-bit data WORD in to the AXI-Data Stream FIFO that is connected to the MicroBlaze.<\/p>\n<p>Here is a close-up of the &#8220;Read-Top&#8221; state:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Top.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-360 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Top.png\" alt=\"\" width=\"479\" height=\"332\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Top.png 479w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Top-300x208.png 300w\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" \/><\/a><\/p>\n<p>Here is the other state:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Bottom.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-358 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Bottom.png\" alt=\"\" width=\"470\" height=\"340\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Bottom.png 470w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Read-Bottom-300x217.png 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/a><\/p>\n<p>The &#8220;Read-Bottom&#8221; state.\u00a0 This state will write the lower half of the 64-bit WORD and will check if this is the final element in the Ethernet Frame.\u00a0 If this is the final element, it will enter the &#8220;Append-Size&#8221; state, which is incorrectly named, will fix that later &#8220;TODO: Rename Append-Size&#8221;. haha.\u00a0 Anyway, it will append some metadata indicating if this frame should be dropped or kept.<\/p>\n<p>The final state &#8211; &#8220;Append-Size&#8221;:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Append-Size.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-359 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Append-Size.png\" alt=\"\" width=\"492\" height=\"358\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Append-Size.png 492w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/C-Append-Size-300x218.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/p>\n<p>This code is very simple.\u00a0 I set TKEEP to all one&#8217;s, or 0b1111, and I set the first 2 bits of the 32-bit WORD to contain &#8220;End of Good Frame&#8221; and &#8220;End of Bad Frame&#8221;.\u00a0 Now why am I setting TKEEP to all 1&#8217;s? Well, simple, because I haven&#8217;t implemented this part yet, however, by setting it to all 1&#8217;s my code will still work because most TCP\/IP stacks just ignore all padded 0&#8217;s.<\/p>\n<p><span style=\"font-size: 24pt;\"><strong>D<\/strong><\/span> &#8211; Now the MicroBlaze has been programmed with a function that reads an incoming frame from AXI-Data Stream FIFO #0 and writes its contents to AXI-Data Stream FIFO #1.\u00a0 It also reads an incoming frame from AXI-Data Stream FIFO #1 and writes its contents to AXI-Data Stream FIFO #0.\u00a0 This is a simple passthrough that exercises my implementation of the FIFOs.<\/p>\n<p>A direct link to the source code of this C code that is running in the MicroBlaze:<\/p>\n<p><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/mb_lwip\/mb_lwip.sdk\/mb_lwip\/src\/helpers.c#L83\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/mb_lwip\/mb_lwip.sdk\/mb_lwip\/src\/helpers.c#L83<\/a><\/p>\n<p>And a screenshot:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/D-Source-Code.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-361 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/D-Source-Code.png\" alt=\"\" width=\"622\" height=\"986\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/D-Source-Code.png 622w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/D-Source-Code-189x300.png 189w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/a><\/p>\n<p><span style=\"font-size: 24pt;\"><strong>E<\/strong><\/span> &#8211; Now what happens after the source code above executes? Well, data is read from the 10 Gigabit PHY and read on the first AXI-Data Stream FIFO and written out back to the rest of the FPGA via the second AXI-Data Stream FIFO.\u00a0 So we want to read this ethernet frame and write it up to the Host application running on normal\/regular Windows.\u00a0 This is very simple, read data, write data to a Target-to-Host LabVIEW FIFO, and if tlast is equal to true, include this in the metadata, which for now is simply the upper half of the 64-bit WORD.<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/E-ToHost.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-363 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/E-ToHost.png\" alt=\"\" width=\"970\" height=\"319\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/E-ToHost.png 970w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/E-ToHost-300x99.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/E-ToHost-768x253.png 768w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a><\/p>\n<p><span style=\"font-size: 24pt;\"><strong>F<\/strong><\/span> &#8211; Now how do you read this data on the host? Well, if you are familiar with LabVIEW, the code would look like this:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-Read-from-Target.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-364 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-Read-from-Target.png\" alt=\"\" width=\"407\" height=\"169\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-Read-from-Target.png 407w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-Read-from-Target-300x125.png 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/a><\/p>\n<p>The green box contains a reference to the running FPGA.\u00a0 The first box on the left polls the FIFO to see if any elements are available, and if the number of elements available is greater than 0 it reads that number of elements.<\/p>\n<p>If you wanted to do this from C++, you could use LabWindows CVI to read from the FPGA interface as such:<\/p>\n<p>\/* read the DMA FIFO *\/<br \/>\nNiFpga_MergeStatus(&amp;status, NiFpga_ReadFifoI16 (session,<br \/>\nNiFpga_fpga_TargetToHostFifoI16_AIFIFO,<br \/>\ndata, numSamples, timeout, &amp;r));<\/p>\n<p>(See: <a href=\"http:\/\/www.ni.com\/tutorial\/8638\/en\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.ni.com\/tutorial\/8638\/en\/<\/a>)<\/p>\n<p>Please note that you can also link to the LabWindows CVI library and use it from your existing C++ applications.\u00a0 Drivers for this specific board are only available for Windows, but if you are a big bank or financial firm with deep pockets, I&#8217;m sure you can set up some sort of agreement with National Instruments to port this code and drivers to &lt;Operating System of your Choice&gt;.<\/p>\n<p>Okay, that is great, now what about writing data from the Host application back to the FPGA for sending out of the 10 Gigabit PHY? Well, you do the opposite, you enter the codes in reverse. (Spies Like Us).<\/p>\n<p>Instead of a &#8220;Target-to-Host&#8221; FIFO, use a\u00a0 &#8220;Host-to-Target&#8221; FIFO, and in my case, I prepend the size in WORDs to the packet to be sent.<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-ToTarget.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-365 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-ToTarget.png\" alt=\"\" width=\"610\" height=\"149\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-ToTarget.png 610w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/F-ToTarget-300x73.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Again, the green box is a reference to the running FPGA.\u00a0 The square light green colored box is a function, also known as a &#8220;sub-VI&#8221; that I wrote that generates a UDP packet (or is it a UDP datagram? I forget).\u00a0 The output of this UDP packet is converted in to 32-bit WORDS by the box with a white background, and then the size is prepended to this array and written in to the &#8220;HT_WRITE&#8221; LabVIEW Host-to-Target FIFO.<\/p>\n<p><span style=\"font-size: 24pt;\"><strong>G<\/strong><\/span> &#8211; So we are receiving data in the following format from the host:<\/p>\n<p>&lt;size&gt;<\/p>\n<p>&lt;WORD1&gt;<\/p>\n<p>&lt;WORD2&gt;<\/p>\n<p>&#8230;<\/p>\n<p>&lt;WORDN&gt;<\/p>\n<p>We read the size and then the rest of the elements from the FIFO and write them to the 2nd AXI-Data Stream FIFO that is connected to the MicroBlaze.\u00a0 Again note that I have not yet fully implemented the proper usage of the TKEEP signals, so in this case the TKEEP signal can be dynamically set from the Host application for testing purposes.<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/G-Convert-LabVIEW-AXI-32.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-366 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/G-Convert-LabVIEW-AXI-32.png\" alt=\"\" width=\"1265\" height=\"540\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/G-Convert-LabVIEW-AXI-32.png 1265w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/G-Convert-LabVIEW-AXI-32-300x128.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/G-Convert-LabVIEW-AXI-32-768x328.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/G-Convert-LabVIEW-AXI-32-1024x437.png 1024w\" sizes=\"auto, (max-width: 1265px) 100vw, 1265px\" \/><\/a><\/p>\n<p><span style=\"font-size: 24pt;\"><strong>H<\/strong><\/span> &#8211; Now that the MicroBlaze has read our outgoing ethernet frame on Fifo #1 and has written the same outgoing frame on FIFO #0, we have to convert this 32-bit AXI Data Stream in to 64-bit words that are suitable for our 10 Gigabit Ethernet PHY.<\/p>\n<p>This time however, I used a proper state machine and named all of the states correctly.<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Convert-AXI-to-LabVIEW-FIFO.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-367 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Convert-AXI-to-LabVIEW-FIFO.png\" alt=\"\" width=\"1332\" height=\"514\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Convert-AXI-to-LabVIEW-FIFO.png 1332w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Convert-AXI-to-LabVIEW-FIFO-300x116.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Convert-AXI-to-LabVIEW-FIFO-768x296.png 768w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Convert-AXI-to-LabVIEW-FIFO-1024x395.png 1024w\" sizes=\"auto, (max-width: 1332px) 100vw, 1332px\" \/><\/a><\/p>\n<p>The left-most box connects the signals from the MicroBlaze to LabVIEW and wires them in to the state machine.\u00a0 If the data is valid and it is not the last element, the top half is stored in to a shift-register and the next state is &#8220;Read-Bottom&#8221;.\u00a0 Here is a close-up of the &#8220;Read-Top&#8221; state:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Top.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-368 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Top.png\" alt=\"\" width=\"338\" height=\"363\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Top.png 338w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Top-279x300.png 279w\" sizes=\"auto, (max-width: 338px) 100vw, 338px\" \/><\/a><\/p>\n<p>And here is a close-up of the &#8220;Read-Bottom&#8221; state:<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Bottom.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-369 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Bottom.png\" alt=\"\" width=\"337\" height=\"355\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Bottom.png 337w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/H-Read-Bottom-285x300.png 285w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/a><\/p>\n<p><span style=\"font-size: 24pt;\"><strong>I<\/strong><\/span> &#8211; Now we have written the 32-bit data coming from the MicroBlaze in to a LabVIEW FIFO with 64-bit data WORDS and we have to write this out using the CLIP, via the National Instruments provided wrapper.<\/p>\n<p><a href=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/I-Outgoing.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-370 size-full\" src=\"http:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/I-Outgoing.png\" alt=\"\" width=\"996\" height=\"342\" srcset=\"https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/I-Outgoing.png 996w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/I-Outgoing-300x103.png 300w, https:\/\/fpganow.com\/wp-content\/uploads\/2018\/03\/I-Outgoing-768x264.png 768w\" sizes=\"auto, (max-width: 996px) 100vw, 996px\" \/><\/a><\/p>\n<p>Look at how simple and beautiful this code is!<\/p>\n<p>You can look at the source code here: (you must clone the repository to your local machine to see it easier, just clone it and open the 2nd file &#8211; the html file)<\/p>\n<ul class=\"ili-indent\">\n<li>FPGA top level\n<ul>\n<li><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/FPGA\/FPGANic\/Fpga-FPGANic-Top.vi\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/FPGA\/FPGANic\/Fpga-FPGANic-Top.vi<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/ScreenShots\/Fpga-FPGANic-Top.html\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/blob\/master\/07_10_Gigabit_CLIP\/ScreenShots\/Fpga-FPGANic-Top.html<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>If you do now know git, you can also download a zip file of the entire repository:<\/p>\n<p><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/archive\/master.zip\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/archive\/master.zip<\/a><\/p>\n<p>If you somewhat know git, you can:<\/p>\n<p>git clone\u00a0git@github.com:JohnStratoudakis\/LabVIEW_Fpga.git<\/p>\n<p>And finally, browse the documentation, which is probably outdated here:<\/p>\n<p><a href=\"https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/tree\/master\/07_10_Gigabit_CLIP\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/JohnStratoudakis\/LabVIEW_Fpga\/tree\/master\/07_10_Gigabit_CLIP<\/a><\/p>\n<p><strong>Up Next<\/strong><\/p>\n<p>So what now? Do I continue cleaning up the code and updating documentation? Do I make a youtube video demonstrating this?\u00a0 Do I modify the MicroBlaze code to no longer just be a &#8220;passthrough&#8221; but instead to send all data through the lwIP TCP\/IP stack? If I do this, I will have to modify the elf file (compiled binary) that is embedded in to my design, breaking this design, so I can make multiple Xilinx checkpoints and it will work, but that will confuse all of my readers&#8230; Man decisions, decisions.<\/p>\n<p>How about this, I finalize this project, make a new sub-directory in the source code and make a brand new LabVIEW FPGA project and this time I will use the lwIP version of the source code and I will make sure that everything is reproducible.\u00a0 It is raining now anyway and I want to stay inside and code&#8230;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I normally avoid shop words or &#8220;corporate speak&#8221; because I feel it dehumanizes us, but sometimes these phrases are necessary.\u00a0 So here is the &#8220;30,000 foot&#8221; view.\u00a0 And please pardon the appearance of my flow charts and diagrams, I am not a graphic designer&#8230; All images open in a new tab, so just click on &#8230; <a title=\"30,000 Foot View\" class=\"read-more\" href=\"https:\/\/fpganow.com\/index.php\/2018\/03\/02\/30000-foot-view\/\" aria-label=\"Read more about 30,000 Foot View\">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":[11,7,6,8],"tags":[],"class_list":["post-346","post","type-post","status-publish","format-standard","hentry","category-clip","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\/346","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=346"}],"version-history":[{"count":8,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/posts\/346\/revisions"}],"predecessor-version":[{"id":374,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/posts\/346\/revisions\/374"}],"wp:attachment":[{"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/media?parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/categories?post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fpganow.com\/index.php\/wp-json\/wp\/v2\/tags?post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}