{"id":249,"date":"2026-10-23T21:08:18","date_gmt":"2026-10-23T15:38:18","guid":{"rendered":"https:\/\/www.sushantmondal.com\/blog\/?p=249"},"modified":"2026-11-01T21:56:30","modified_gmt":"2026-11-01T16:26:30","slug":"renvatek-quartz-1-gets-a-uart-and-an-axi4-lite-bus-part-1-the-soft-ip","status":"publish","type":"post","link":"https:\/\/www.sushantmondal.com\/blog\/2026\/10\/23\/renvatek-quartz-1-gets-a-uart-and-an-axi4-lite-bus-part-1-the-soft-ip\/","title":{"rendered":"Renvatek Quartz-1 gets a UART and an AXI4-Lite bus (Part 1: the soft IP)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">As you all already know, <a href=\"\/blog\/2026\/08\/12\/renvatek-quartz-1-passes-all-39-risc-v-act4-architectural-compliance-tests\/\">Renvatek Quartz-1 passed all 39 RISC-V ACT4 compliance tests<\/a>. That proves the ISA behavior. It does not prove the core can do useful work with the outside world. For that, it needs a peripheral and a way to reach it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"461\" src=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/sushant-and-prashant-standing-in-front-of-fpga-quartz-1-running-ping-pong-with-uart-1024x461.jpeg\" alt=\"Sushant Mondal (left) and Prashant Mondal (right) stand in their basement office holding up a small FPGA board, with a monitor on the right showing a black-screen ping-pong game. Red arrows and labels point to the board (\u201cRV32I core on this FPGA\u201d) and the game on screen (\u201cis running THIS ping-pong\u201d).\" class=\"wp-image-294\" srcset=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/sushant-and-prashant-standing-in-front-of-fpga-quartz-1-running-ping-pong-with-uart-1024x461.jpeg 1024w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/sushant-and-prashant-standing-in-front-of-fpga-quartz-1-running-ping-pong-with-uart-300x135.jpeg 300w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/sushant-and-prashant-standing-in-front-of-fpga-quartz-1-running-ping-pong-with-uart-767x345.jpeg 767w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/sushant-and-prashant-standing-in-front-of-fpga-quartz-1-running-ping-pong-with-uart-1536x691.jpeg 1536w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/sushant-and-prashant-standing-in-front-of-fpga-quartz-1-running-ping-pong-with-uart-2048x922.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So we split the next step in two. I built the soft IP: the bus and the UART around the core. My twin brother, Prashant, took it onto a real FPGA and wrote the application. This post covers my half. His post picks up where mine ends.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Top-level architecture<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Data flows from the core to the UART through the AXI4-Lite bus:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2304\" height=\"544\" src=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/renvatek-quartz-1-uart-axi4-lite-block-diagram.svg\" alt=\"Block diagram of the Renvatek Quartz-1 UART wrapper with AXI4-Lite, showing the stall adapter, memories and MMIO decoder\" class=\"wp-image-251\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Core<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Renvatek Quartz-1<\/strong> is a single-hart RV32I core. Its memories are not inside it. I spent a week or so removing my hard-coded RTL memory arrays and exposing real memory ports this time. The module boundary exposes the instruction and data ports. The integrator decides what sits behind them, such as block RAM, an SRAM macro, or a cache.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This keeps the core portable. On an FPGA, the wrapper connects to block RAM. In an ASIC flow, it can connect to something else. The core does not change.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Bus (AXI4-Lite)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Peripherals are reached through memory-mapped I\/O. A load or store to an address in the MMIO window becomes an AXI4-Lite transaction. Three blocks handle this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>AXI4-Lite master:<\/strong> an FSM that turns a core load or store into AXI4-Lite read and write channel handshakes. The FSM concept comes from the eChipHub RTL bootcamp.<\/li>\n\n\n\n<li><strong>MMIO address range decoder:<\/strong> looks at the address and selects the slave. Right now, there is only one slave, the UART, in the range <code>0x10000000<\/code> to <code>0x1000000B<\/code>.<\/li>\n\n\n\n<li><strong>Stall adapter:<\/strong> The core has no wait state for data accesses. Its only stall input is <code>imem_valid_i<\/code>, which holds the PC while low. A second input, <code>dmem_valid_i<\/code>, enables the register write-back. An AXI4-Lite access takes eight or more cycles, and more when the UART transmitter is busy. When the bridge pulses its ready output, the adapter sets <code>core_imem_valid_o<\/code> high for one cycle, so the PC advances. In that same cycle it sets <code>core_dmem_valid_o<\/code> high, so the load result is written back. The adapter also selects the master&#8217;s read data in place of the memory&#8217;s read data for that access. Outside the MMIO window, the memory&#8217;s <code>dmem_valid_i<\/code> and read data pass through unchanged.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">UART (an AXI4-Lite slave)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The UART peripheral has three registers:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Address range<\/th><th>Name<\/th><th>Access<\/th><th>Function<\/th><\/tr><\/thead><tbody><tr><td><code>0x10000000<\/code> to <code>0x10000003<\/code><\/td><td><code>TXDATA<\/code><\/td><td>Write<\/td><td>Queue one byte for transmission.<\/td><\/tr><tr><td><code>0x10000004<\/code> to <code>0x10000007<\/code><\/td><td><code>RXDATA<\/code><\/td><td>Read<\/td><td>Read the last received byte.<\/td><\/tr><tr><td><code>0x10000008<\/code> to <code>0x1000000B<\/code><\/td><td><code>STATUS<\/code><\/td><td>Read<\/td><td>Bit 1: TX ready.<br>Bit 0: RX pending.<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><em>Use word loads and stores (<code>lw<\/code> and <code>sw<\/code>) to access these registers.<\/em><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The frame format is <code>8N1<\/code>: one start bit, eight data bits sent LSB first, no parity, one stop bit. The baud rate and clock frequency are module parameters. In our build, they are 19200 baud and 12 MHz, so one bit lasts 625 clock cycles.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The receiver synchronizes the RX line, detects the start bit&#8217;s falling edge, waits half a bit period to confirm it, and then samples each data bit once per bit period. The transmitter is a similar FSM running in the opposite direction. Both are FSMs built from an <code>enum<\/code> state type and a counter, so they are easy to read in one pass.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To use the UART, software polls <code>STATUS<\/code>, then reads <code>RXDATA<\/code> or writes <code>TXDATA<\/code>. That is the entire programming model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why this split works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The core knows only loads and stores. It has no idea a UART exists. Adding a second peripheral means adding a slave and extending the decoder range. The core and the bus master stay untouched.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The ping-pong game uses exactly this path. It is a bare-metal program that polls <code>STATUS<\/code>, reads a key byte, and writes a reply. No game-specific hardware exists.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What this post does <em>not<\/em> cover<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Prashant&#8217;s work covers the clock source, power-on reset, block RAM timing, pin assignment, bitstream build, and the game itself. I wrote the ports and left a note in the top file about what to connect. His post has what he did with them.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#ffefc2\"><strong>Part 2: <\/strong><a href=\"https:\/\/www.prashantmondal.com\/blog\/2026\/10\/30\/renvatek-quartz-1-runs-a-ping-pong-game-on-an-fpga-using-a-uart-and-an-axi4-lite-bus-part-2-the-game\/\" target=\"_blank\" rel=\"noopener\">Renvatek Quartz-1 runs a ping-pong game on an FPGA using a UART and an AXI4-Lite bus (Part 2: the game)<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Next milestone<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The next soft IP is a <strong><em>framebuffer<\/em><\/strong>. It will let Renvatek Quartz-1 run graphical apps without a laptop drawing the screen. Today the core sends game state over the UART, and the laptop does all the drawing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I expect to add the framebuffer as another peripheral on the same AXI4-Lite bus, with its own address range in the decoder. The research on memory size, pixel format, and how the display is driven is on the priority list. I will write about the results once the interface is settled.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How Renvatek Quartz-1 reaches the outside world: a stall adapter, an AXI4-Lite bus, and a UART, written as soft IP.<\/p>\n","protected":false},"author":1,"featured_media":268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":true},"categories":[9],"tags":[43,45,31,34,44,29,36,30,13,10,11,42],"class_list":["post-249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hardware","tag-axi4-lite","tag-bus","tag-core","tag-hdl","tag-mmio","tag-renvatek","tag-renvatek-qe001001rv32in0","tag-renvatek-quartz-1","tag-risc-v","tag-rtl","tag-systemverilog","tag-uart"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/10\/renvatek-quartz-1-uart-axi4-lite-featured.png","_links":{"self":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":32,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":295,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions\/295"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/media\/268"}],"wp:attachment":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/categories?post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/tags?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}