<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vincent Claes on Medium]]></title>
        <description><![CDATA[Stories by Vincent Claes on Medium]]></description>
        <link>https://medium.com/@cteqeu?source=rss-3b7654a2c1b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*CprHAmfLMhJHRtd3</url>
            <title>Stories by Vincent Claes on Medium</title>
            <link>https://medium.com/@cteqeu?source=rss-3b7654a2c1b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:48:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cteqeu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Custom AXI IP Cores in VHDL]]></title>
            <link>https://medium.com/@cteqeu/building-custom-axi-ip-cores-in-vhdl-e7e6532aac59?source=rss-3b7654a2c1b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7e6532aac59</guid>
            <category><![CDATA[custom]]></category>
            <category><![CDATA[vhdl]]></category>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[fpga]]></category>
            <category><![CDATA[arm]]></category>
            <dc:creator><![CDATA[Vincent Claes]]></dc:creator>
            <pubDate>Fri, 07 Mar 2025 14:54:15 GMT</pubDate>
            <atom:updated>2025-03-10T13:36:55.770Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ObYui8dk2linTtcAUZfBw.png" /><figcaption>Custom AXI IP Integration Block Design</figcaption></figure><p>In this article we are showing you how you could build your own custom AXI IP cores using <a href="http://www.vhdl.eu/">VHDL </a>for using it in an FPGA. We are using a <a href="http://www.tulembedded.com/">tulembedded </a>Xilinx (<a href="http://www.amd.com/">AMD</a>) Pynq-Z2 board with a zynq FPGA onboard for the practical implementation of this core. In this FPGA there is an <a href="http://www.arm.com/">ARM </a>Cortex-A9 hardcore processor available, we can attach our own custom IP to this processor using the AXI bus. For this tutorial we are going to use the AXI Lite version (Memory Mapped I/O) of this AXI specification.</p><p>The IP core we are going to build (<strong>CustomAXICore_0</strong>) is going to have 2 external connections:</p><ul><li>getal2 which will be connected to the BTNS of the board</li><li>resultaat which will be connected to the LEDS of the board.</li></ul><p>Our core will calculate the sum of 2 numbers, one number is moved from c code over the axi bus and the other readed in using the btns. The result will be shown on the LEDS of the board but you could also read it in use a slave register of the IP Core (transfer over AXI bus).</p><p>The integration system we are going to build includes:</p><p>The <strong>Zynq Processing System (PS)</strong> block which represents the ARM Cortex-A9 processing system in the <strong>FPGA</strong>. It includes interfaces such as:</p><ul><li><strong>M_AXI_GPO</strong> (General-Purpose AXI Master Interface) — used to communicate with (custom) peripherals on the AXI bus.</li><li><strong>DDR &amp; FIXED_IO</strong> — external memory and I/O connections.</li></ul><p><strong>AXI Interconnect </strong>(ps7_0_axi_periph)</p><ul><li>The <strong>AXI Interconnect</strong> block acts as a bridge between the Zynq Processing System and custom AXI peripherals.</li><li><strong>S00_AXI</strong> — The Slave interface, receiving commands from the PS.</li><li><strong>M00_AXI</strong> — The Master interface, passing transactions to the custom IP core.</li></ul><p><strong>Processor System Reset</strong> (rst_ps7_0_100M) handles various reset signals:</p><ul><li><strong>aux_reset_in</strong>, <strong>dcm_locked</strong>, <strong>mb_debug_sys_rst</strong> — Ensure proper reset conditions.</li><li><strong>peripheral_aresetn</strong> — Resets the custom peripherals (Custom AXI IP Core in this case).</li></ul><h3>Xilinx Vivado 2024.1 (Hardware Platform)</h3><p>We are using AMD / Xilinx Vivado 2024.1 for developing the Custom AXI IP Core but the concept should work in other versions.</p><p>First Start Vivado and Create a New Project, this project is the implementation project for the IP Core, the development of the Custom IP Core will be done in another project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*tj1negG4h88Nsh0F4dcJyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xmi_w17PPdSULxTCm4_lCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wz-8ikIg6SvLr2Z_SgOMBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjvifdUpIDrORvjzCA5D3w.png" /></figure><p>If the pynq-z2 board is not visible you can use the “Refresh” button, this takes some time but normally you should find the pynq-z2 board when doing this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Am3JIrLGoIyMBJH4P7ygug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LrD4P8s979G1qxfnDOo5nQ.png" /></figure><p>When this “<strong>CoreImplementation</strong>” project is opened, click on “<strong>Tools</strong>” and “<strong>Create and Package New IP</strong>”. This will start a new wizard and a new project (don’t close the CoreImplementation project now because we need this after the creation of the Custom AXI IP Core).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*-67BfV93NttfJfx_IReDVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*4aFEreH_Z1XSPJXNqAASpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*fNSEUFRGegda7cD6e2QrUA.png" /></figure><p>The name of our core is “<strong>CustomAXICore</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*DlvHINRXoXf8cZN1fc_0qw.png" /></figure><p>We just add 1 <strong>AXI Lite Slave</strong> interface to this IP Core, the minimal amount of registers is 4 and the data width is 32bits. You can add more slave interfaces if you want but this is out of scope for this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*LRk9uaEtNtMxFgIz-jgAOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*pz985v8R9DSWjLljKgqiWw.png" /></figure><p>We are adding an already prepared vhdl component to this AXI block. Be aware the wizard generated 2 files the AXI Slave Interface and the AXI Core top level vhdl file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7mC6DHFpvdqMWIx2WrziNQ.png" /></figure><p>Click on the “<strong>Add Sources</strong>” button by this way we will add the already developed vhdl code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmQRCaPZIfr8xERoG6JMVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*6B_t22-ZScZ9u984AVe42g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEF888X36QnOtutBazE6OQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*vP2Binx8dy8c1G8rEwPcWA.png" /></figure><p>The following is the contents of the <strong>eFPGA_Core1.vhd</strong> file. It just adds 2 numbers consisting of 4 bit std_logic_vectors in VHDL.</p><pre>library IEEE;<br>use IEEE.STD_LOGIC_1164.ALL;<br><br>-- Uncomment the following library declaration if using<br>-- arithmetic functions with Signed or Unsigned values<br>use IEEE.NUMERIC_STD.ALL;<br><br>-- Uncomment the following library declaration if instantiating<br>-- any Xilinx leaf cells in this code.<br>--library UNISIM;<br>--use UNISIM.VComponents.all;<br><br>entity eFPGA_Core1 is<br>  Port ( <br>            getal1:     in  std_logic_vector(3 downto 0);<br>            getal2:     in  std_logic_vector(3 downto 0);<br>            resultaat:  out std_logic_vector(3 downto 0)<br>  <br>  );<br>end eFPGA_Core1;<br><br>architecture Behavioral of eFPGA_Core1 is<br><br>begin<br>    <br>resultaat &lt;= std_logic_vector(unsigned(getal1)+unsigned(getal2));<br><br>end Behavioral;</pre><p>The state machines in this design manage (of the Xilinx/AMD Vivado template for AXI Lite IP Cores) AXI transactions by handling read and write requests in separate processes. The write state machine transitions through <strong>Idle, Waddr and Wdata</strong> states to capture address and data before signaling a response. The read state machine moves through <strong>Idle</strong>, <strong>Raddr </strong>and <strong>Rdata </strong>states, responding when data is requested.</p><p>The “<strong>eFPGA_Core1</strong>” component takes input from the internal register <strong>slv_reg0</strong> and an external input (<strong>getal_2</strong>). It processes these inputs and outputs “<strong>resultaat</strong>”, which is then assigned to <strong>resultaat_i.</strong> This output is used by another part of the design for further processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMOYTffM_c7dTtx3SrDkWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmWV2x7hKv0hIUqKSHlipw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IORv8VyxgS74OCBKpuQndQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qj_4rZCkSLjpJbwHuCMh5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuB7ffvLKlAAFKVp09gZ4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHVzvz8j0evSa6cdL6CtuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*czANWG7eUwvOhEep069r4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*trzxqmnVYZnwHhS4ACqJXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBpUqirW_sEBgiZST1m_aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*BoEY8ORnlssZatoXXfC9sQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUhsWVkaFvy5Ar-0XZO1QA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*k3AC9XuoT01uJHftBztZLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uD7v34dGz6NlMjJyrooYEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*QANLkr73EcggWaX5uw_kVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CVr4evKotdAzHeXEymf3Dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O13_F_xazFBacYAWcIyVGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JN5UDYaSIZmvL4vIXwWY4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*6WpSRUi6TvP-gfIDry01Mg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqwEfq4VkvxqaX-ZUQGcXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjRW81Rn-UZd2XBaRiLQaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQj63ROSChN6rzgQYYBtmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*0c7sQf15ONQAYy6InXpaqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHH84KlsBMqn_05mTXgkFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Juj1XFh2hpsPN5oMLoefeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAgSphRKq-IZ8fm0Ma1abA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-nW1CkPs6IR6ZEgf7Z39g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUz9Q3k3G1s-GTMvevr_FQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*OMM8fTQbqyYzjVly-gJ3-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*SqokN3ZYV2iDjwgETUQfJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLPvI1I4JCyADXUwGDPX9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*TtNsC0eNACDUwTEoTbRJpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*4Lsvx8y1wNkw4hFqrT8e0Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*N1xHR5bBjkmKP39W8jJAhQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*6mkv-d0huWSRCG2Y6T1tCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*9Rk4-Thq1omIM0oQnKogtQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*tanmv6PjrRl-snyEOS9W4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*AKQmuRgUvSMrw7e55WL3rw.png" /></figure><p>This will export the XSA file (Xilinx Shell Archive). This file is need for developing the bare metal embedded C code. We are going to write the software in Xilinx Vitis Classic.</p><h3>Xilinx Vitis 2024.1 (Embedded Software)</h3><p>We are using the Classic edition of Xilinx Vitis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*6ZiEhdvv0M3ISEBuyt0tog.png" /></figure><p>Create a New workspace, be sure to not start with a number, don’t use strange characters and don’t place your workspace in a directory with a space in the name. I always put this file in the directory where I started my hardware design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Ty7BPwpgKlsjIMaQDmJaBw.png" /></figure><p>Create a “<strong>New Application Project</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-uLSYMFRDmfpozam-el_YQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*_RgDdX65pT5zr3LxLN-M9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTi545SCSdWT50xeIVQArw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*TFee7Y1c5ZI02gwBWXh6Uw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*yC5K2pxV2A-DX_jI0jWBOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*2gw3yC4QaqMG8N2u1o8BqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*bImAZxtbOnLbm-8oyGExaQ.png" /></figure><p>Ok, now there is a major bug in the Vitis tools, when we want to generate the bsp (green project) we get several errors, this is because vivado generates the wrong makefiles. Replace the makefiles in the following directories with my makefile:</p><pre>DRIVER_LIB_VERSION = 1.0<br>COMPILER=<br>ARCHIVER=<br>CP=cp<br>COMPILER_FLAGS=<br>EXTRA_COMPILER_FLAGS=<br>LIB=libxil.a<br><br>CC_FLAGS = $(COMPILER_FLAGS)<br>ECC_FLAGS = $(EXTRA_COMPILER_FLAGS)<br><br>RELEASEDIR=../../../lib/<br>INCLUDEDIR=../../../include/<br>INCLUDES=-I./. -I$(INCLUDEDIR)<br><br>SRCFILES:=$(wildcard *.c)<br><br>OBJECTS = $(addprefix $(RELEASEDIR), $(addsuffix .o, $(basename $(wildcard *.c))))<br><br>libs: $(OBJECTS)<br><br>DEPFILES := $(SRCFILES:%.c=$(RELEASEDIR)%.d)<br><br>include $(wildcard $(DEPFILES))<br><br>include $(wildcard ../../../../dep.mk)<br><br>$(RELEASEDIR)%.o: %.c<br> ${COMPILER} $(CC_FLAGS) $(ECC_FLAGS) $(INCLUDES) $(DEPENDENCY_FLAGS) $&lt; -o $@<br><br>.PHONY: include<br>include: $(addprefix $(INCLUDEDIR),$(wildcard *.h))<br><br>$(INCLUDEDIR)%.h: %.h<br> $(CP) $&lt; $@<br><br>clean:<br> rm -rf ${OBJECTS}<br> rm -rf $(DEPFILES)</pre><p>The 3 Locations where you have to replace the makefile:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ds5h-ywi-NMr1ZH8K_uLsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cx1q3vJ4FlCmZTEWRGDK7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*py9D8lTulrIceKEn81OtsA.png" /></figure><p>Build <strong>BSP </strong>Project (<strong>Green project</strong>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*6QPDOAnVQm-aITbrPRF8QA.png" /></figure><p>There shouldn’t be an errors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OGWo8m7yUiMpafQX2M1XlA.png" /></figure><p>Don’t change a thing on this green project, otherwise you have to replace the makefiles again because the wizards in the background will replace the good makefiles with the wrong files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9j4ui6ha0Z8OR1xAiBBNmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzgnOzvqKguCLeH68E5Shw.png" /></figure><pre>#include &lt;stdio.h&gt;<br>#include &quot;platform.h&quot;<br>#include &quot;xil_printf.h&quot;<br>#include &quot;CustomAXICore.h&quot;<br>#include &quot;sleep.h&quot;<br>// www.cteq.eu<br><br><br>int main()<br>{<br> init_platform();<br><br> for(;;){<br>  CUSTOMAXICORE_mWriteReg(XPAR_CUSTOMAXICORE_0_S00_AXI_BASEADDR,CUSTOMAXICORE_S00_AXI_SLV_REG2_OFFSET,0b011);<br>  u32 result = CUSTOMAXICORE_mReadReg(XPAR_CUSTOMAXICORE_0_S00_AXI_BASEADDR,CUSTOMAXICORE_S00_AXI_SLV_REG3_OFFSET);<br>  printf(&quot;Result: %d\n\r&quot;, (int)result);<br>  sleep_A9(1);<br> };<br><br>    cleanup_platform();<br>    return 0;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*qvCwHUd7SlL4LgE7ak1ZdQ.png" /></figure><p>If you then hit the green arrow in the debug view of this vitis classic the code will start running, you will see the result of the value you push on the buttons added with 0b0011. Have fun developing your own custom VHDL IP Cores now…</p><p><em>More information</em></p><p><a href="http://www.cteq.eu/">www.cteq.eu</a></p><p><a href="https://www.linkedin.com/in/vincentclaes/">https://www.linkedin.com/in/vincentclaes/</a></p><p><a href="https://www.youtube.com/fpgabe">https://www.youtube.com/fpgabe</a></p><p><a href="https://github.com/cteqeu/SoC">https://github.com/cteqeu/SoC</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7e6532aac59" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>