<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://blog.yurimartins.com.br/en/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.yurimartins.com.br/en/" rel="alternate" type="text/html" hreflang="pt-BR" /><updated>2026-04-21T19:52:52-03:00</updated><id>https://blog.yurimartins.com.br/feed.xml</id><title type="html">Notas do Yuri</title><subtitle>Um espaço para estudar em público, compartilhar conhecimento e escrever sobre engenharia, computação, embarcados, IoT, microeletrônica e telecom.</subtitle><author><name>Yuri Martins</name></author><entry xml:lang="pt-BR"><title type="html">Quando a lógica encontra a física</title><link href="https://blog.yurimartins.com.br/en/2026/04/21/quando-a-logica-encontra-a-fisica/" rel="alternate" type="text/html" title="Quando a lógica encontra a física" /><published>2026-04-21T19:31:00-03:00</published><updated>2026-04-21T19:31:00-03:00</updated><id>https://blog.yurimartins.com.br/2026/04/21/quando-a-logica-encontra-a-fisica</id><content type="html" xml:base="https://blog.yurimartins.com.br/2026/04/21/quando-a-logica-encontra-a-fisica/"><![CDATA[<p>Este texto nasce como um registro dessa primeira fase do <strong>Champion Chip Experience</strong>, mas o que mais tem me interessado nela não é exatamente o processador final. É o caminho até ele.</p>

<p>Eu já conhecia vários blocos de hardware de forma isolada, ULA, flip-flops, SRAM, Flash, barramentos, MUX, DEMUX, mas essa etapa tem deixado mais evidente uma diferença que eu ainda subestimava: conhecer os blocos não é o mesmo que entender o sistema. E, em hardware, essa distância fica ainda maior quando a lógica deixa de existir apenas no diagrama e começa a enfrentar temporização, consumo, implementação física e fabricação.</p>

<p>O campeonato reúne equipes na tarefa de desenvolver um processador baseado na <strong>ISA RISC-V</strong> para uma disputa em nível nacional. Ao final, a equipe vencedora poderá realizar o <strong>tape-out</strong> em uma foundry internacional, isto é, enviar o projeto final para fabricação.</p>

<p>O ponto importante, porém, é que a competição não começa no processador completo. Ela começa antes, numa fase de capacitação em microeletrônica. E isso faz bastante sentido: antes de discutir o core, é preciso voltar aos blocos que o tornam possível. É justamente nessa etapa que estou agora, construindo circuitos e estudando os elementos fundamentais que mais adiante servirão de base para as etapas seguintes.</p>

<p>Tenho gostado desse processo porque ele vem corrigindo uma limitação que eu já percebia em mim há algum tempo. Parte do que eu conhecia antes estava correta, mas estava fragmentada demais. Faltava continuidade entre os componentes, faltava fluxo. E acho que o ganho principal até aqui tem sido justamente esse: começar a enxergar como as peças se condicionam mutuamente quando deixam de ser assunto de aula e passam a existir como projeto.</p>

<p>Uma das primeiras mudanças de perspectiva veio do <strong>Verilog</strong>. Não exatamente por ser possível descrever hardware em uma linguagem de descrição de hardware, mas pelo peso que a palavra <strong>sintetizável</strong> ganha quando o circuito deixa de ser apenas um exercício de lógica e passa a carregar compromissos com implementação, temporização e verificabilidade. Em algum momento, escrever o módulo deixa de ser apenas “representar um circuito” e passa a significar “assumir responsabilidade pelo que esse circuito terá de sustentar quando sair do papel”.</p>

<p>A pergunta que apareceu logo em seguida foi inevitável: <strong>como saber se o hardware realmente faz o que imaginamos que ele faz?</strong></p>

<p>A resposta passa pelos <strong>testbenches</strong>, ambientes de simulação usados para aplicar estímulos ao circuito e observar suas saídas ao longo do tempo. É por meio deles que começamos a validar o comportamento do projeto antes de qualquer implementação física. Em software, testar já é obrigação básica; em hardware, isso ganha outro peso. O custo de descobrir um erro tarde demais muda completamente de escala.</p>

<p>Essa foi, inclusive, uma das diferenças mais marcantes que encontrei nesse início. Em software, muitos erros ainda podem ser corrigidos depois com uma atualização, um patch ou algum contorno relativamente barato. Em hardware, a situação é bem menos confortável. Quando um problema atravessa síntese, implementação e fabricação, o espaço para correção diminui drasticamente, e não raro a saída acaba sendo algum tipo de workaround em firmware. Isso coloca a verificação num lugar muito mais central do que eu costumava imaginar.</p>

<p>Outro tema que apareceu com bastante força foi a <strong>arbitragem de barramento</strong>. A formulação geral do problema é simples: quando mais de um agente tenta acessar um recurso compartilhado ao mesmo tempo, alguém precisa decidir prioridade, ordem e controle de acesso. Mas, como costuma acontecer em sistemas digitais, o que parece um detalhe operacional logo revela impacto arquitetural. Esses mecanismos afetam diretamente a qualidade final de um <strong>SoC</strong>, interferindo em previsibilidade, estabilidade e eficiência.</p>

<p>Também comecei a ter contato mais direto com o fluxo mais amplo de criação de um chip, desde a descrição lógica até a fabricação. E talvez essa tenha sido uma das partes mais valiosas dessa formação: perceber que projetar hardware não é apenas escrever módulos corretos e conectá-los adequadamente, mas entender a travessia inteira entre lógica, validação, implementação física e produção. No meio desse caminho, voltamos também à base microscópica de tudo isso, como os <strong>transistores MOSFET</strong> fabricados em tecnologia <strong>CMOS</strong>, que são, em última instância, o substrato sobre o qual toda essa abstração se sustenta.</p>

<p>Mas a distinção que mais reorganizou minha compreensão até agora apareceu quando saímos da lógica ideal e começamos a olhar para algo mais próximo do circuito como ele existe no mundo real.</p>

<p>É aí que entra o <strong>OpenLane</strong>, um fluxo automatizado de projeto digital open source que encadeia etapas como síntese, <em>floorplanning</em>, <em>placement</em>, <em>routing</em> e verificações físicas. O efeito prático disso é simples de descrever, embora bem mais profundo do que parece: o Verilog deixa de ser apenas uma descrição abstrata e passa a ser tratado como algo que precisa caber em uma tecnologia de fabricação real.</p>

<p>Junto com isso, entra também o <strong>PDK</strong> (<em>Process Design Kit</em>), que é o conjunto de arquivos, modelos, bibliotecas e regras de fabricação associados a uma determinada tecnologia. Em outras palavras, ele define o terreno em que o projeto pode existir: quais células estão disponíveis, quais limites geométricos e elétricos precisam ser respeitados, quais restrições físicas entram na conta. No nosso caso, estamos usando o <strong>SkyWater 130 nm</strong>, um PDK aberto bastante conhecido no ecossistema de hardware livre.</p>

<p>Foi nesse ponto que uma diferença importante ficou muito mais concreta para mim: uma coisa é verificar se a lógica funciona em termos ideais; outra é verificar se ela continua funcionando quando os atrasos físicos deixam de ser abstração.</p>

<p>Com esse fluxo, passamos a obter artefatos como o <strong>SDF</strong> (<em>Standard Delay Format</em>), um formato padronizado para representar atrasos e informações temporais do circuito após síntese e implementação. Isso permite rodar novamente o testbench já levando em conta uma aproximação muito mais realista do comportamento temporal do projeto. A pergunta, então, deixa de ser apenas “a lógica está certa?” e passa a ser também “ela continua certa quando a física começa a cobrar a conta?”.</p>

<p>Essa parte me surpreendeu bastante, porque ela expõe uma diferença que, no diagrama, é fácil subestimar. Existe uma distância considerável entre um circuito que funciona numa simulação idealizada e um circuito que continua funcionando quando interconexões, capacitâncias parasitas, fanout e delays reais entram em cena. Em hardware, muita coisa não falha na lógica pura; ela falha justamente quando o mundo físico finalmente participa da conversa.</p>

<p>E não é só temporização que entra nessa conta. O mesmo fluxo também permite observar métricas como <strong>consumo de energia</strong>, tanto quando o circuito está ativo quanto quando está em repouso, além de área ocupada e integridade geral do projeto. Em algum ponto, o circuito deixa de ser apenas função lógica e passa a ser, de forma incontornável, um objeto de engenharia: ele ocupa área, dissipa energia, sofre atraso, precisa respeitar margens.</p>

<p>Há também uma mudança de percepção muito concreta quando o projeto começa a adquirir forma física. Células, roteamento, trilhas de alimentação, pinos, interconexões, organização espacial, tudo aquilo que a HDL comprime numa abstração relativamente limpa reaparece como materialidade, compromisso e restrição. Foi uma das primeiras vezes em que senti com mais clareza essa passagem do circuito como descrição para o circuito como coisa implementável.</p>

<p>Abaixo está uma visualização física de um <strong>full adder de 4 bits</strong> já depois dessa travessia do lógico para o implementável:</p>

<p><img src="/assets/img/posts/fulladder-gds.png" alt="Visualização física de um full adder de 4 bits." /></p>

<p>Depois que essas etapas convergem, o fluxo caminha para o <strong>GDSII</strong>, arquivo final que representa o layout geométrico usado pela foundry no processo de fabricação do chip.</p>

<p>A fabricação em si já renderia um texto à parte. Entre o projeto digital e o circuito pronto para uso existe uma sequência longa de etapas, wafer, formação dos dies, corte, encapsulamento, testes, e cada uma delas impõe seus próprios critérios de validação. Quanto mais contato tenho com esse fluxo, mais evidente fica que projetar hardware é, em larga medida, projetar também um processo de verificação suficientemente rigoroso para que os problemas não só apareçam tarde demais.</p>

<p>Se eu tivesse que resumir o que essa primeira fase tem me dado até agora, não seria apenas “mais conceitos”. Acho que o ganho principal foi começar a substituir uma familiaridade fragmentada por uma visão mais contínua da arquitetura. Não porque as peças tenham ficado mais simples, mas porque o encadeamento entre elas começou finalmente a aparecer.</p>

<p>No próximo texto, quero comentar um pouco sobre o desenvolvimento de um processador <strong>RISC-V</strong> simples implementando o <strong>RV32I</strong>, a base inteira de 32 bits da ISA. Aqui vale uma distinção importante. A <strong>ISA</strong> (<em>Instruction Set Architecture</em>) define a interface visível ao software: o conjunto de instruções, os registradores, os formatos e as regras que o processador expõe para quem programa. Já a <strong>microarquitetura</strong> é a forma concreta de implementar essa ISA em hardware: pipeline, unidade de controle, caches, forwarding, tratamento de hazards e assim por diante. É por isso que processadores diferentes podem implementar a mesma ISA e, ainda assim, terem organizações internas bastante distintas. Quando se diz informalmente que um processador tem “arquitetura RISC-V”, o que normalmente se quer dizer é que ele implementa a ISA RISC-V; a microarquitetura, por sua vez, é a forma específica escolhida para realizar isso em silício.</p>

<p>Mesmo sendo o subconjunto mais enxuto, o <strong>RV32I</strong> já expõe várias das decisões que tornam um processador legível não apenas como coleção de blocos, mas como sistema.</p>

<p>Por enquanto, a parte mais valiosa desse campeonato tem sido justamente essa: sair da convivência com componentes isolados e começar, enfim, a acompanhar com mais clareza o caminho inteiro que vai da lógica ao silício.</p>]]></content><author><name>Yuri Martins</name></author><category term="Hardware" /><category term="Microelectronics" /><category term="RISC-V" /><category term="Verilog" /><category term="OpenLane" /><category term="CMOS" /><summary type="html"><![CDATA[Este texto nasce como um registro dessa primeira fase do Champion Chip Experience, mas o que mais tem me interessado nela não é exatamente o processador final. É o caminho até ele.]]></summary></entry><entry xml:lang="en"><title type="html">When Logic Meets Physics</title><link href="https://blog.yurimartins.com.br/en/2026/04/21/when-logic-meets-physics/" rel="alternate" type="text/html" title="When Logic Meets Physics" /><published>2026-04-21T19:31:00-03:00</published><updated>2026-04-21T19:31:00-03:00</updated><id>https://blog.yurimartins.com.br/2026/04/21/when-logic-meets-physics</id><content type="html" xml:base="https://blog.yurimartins.com.br/2026/04/21/when-logic-meets-physics/"><![CDATA[<p>This text begins as a record of this first phase of <strong>Champion Chip Experience</strong>, but what has interested me most about it is not exactly the final processor. It is the path to get there.</p>

<p>I already knew several hardware blocks in isolation — ALU, flip-flops, SRAM, Flash, buses, MUX, DEMUX — but this phase has made one difference even clearer, one I had been underestimating: knowing the blocks is not the same as understanding the system. And in hardware, that gap grows even wider when logic stops existing only in diagrams and begins facing timing, power consumption, physical implementation, and fabrication.</p>

<p>The competition gathers teams in the task of developing a processor based on the <strong>RISC-V ISA</strong> for a national-level competition. At the end, the winning team may perform a <strong>tape-out</strong> at an international foundry — that is, send the final design for fabrication.</p>

<p>The important point, however, is that the competition does not start with the complete processor. It starts before that, in a microelectronics training phase. And that makes a lot of sense: before discussing the core, you need to go back to the blocks that make it possible. It is precisely at that stage that I am now, building circuits and studying the fundamental elements that will later serve as the foundation for subsequent phases.</p>

<p>I have enjoyed this process because it has been correcting a limitation I had noticed in myself for some time. Part of what I knew before was correct, but it was too fragmented. There was a lack of continuity between components, a lack of flow. And I think the main gain so far has been exactly that: starting to see how the pieces condition each other when they stop being classroom subjects and begin to exist as designs.</p>

<p>One of the first shifts in perspective came from <strong>Verilog</strong>. Not exactly because it is possible to describe hardware in a hardware description language, but because of the weight the word <strong>synthesisable</strong> gains when the circuit stops being just a logic exercise and begins carrying commitments to implementation, timing, and verifiability. At some point, writing the module stops being just “representing a circuit” and starts meaning “taking responsibility for what that circuit will have to sustain when it leaves the page.”</p>

<p>The question that came right after was inevitable: <strong>how do you know if the hardware actually does what you imagine it does?</strong></p>

<p>The answer involves <strong>testbenches</strong>, simulation environments used to apply stimuli to the circuit and observe its outputs over time. Through them, we begin validating the design’s behaviour before any physical implementation. In software, testing is already a basic obligation; in hardware, it takes on another weight. The cost of discovering an error too late changes scale completely.</p>

<p>This was, in fact, one of the most striking differences I found in this beginning. In software, many errors can still be corrected after the fact with an update, a patch, or some relatively inexpensive workaround. In hardware, the situation is far less comfortable. When a problem survives synthesis, implementation, and fabrication, the room for correction shrinks drastically — and not rarely the way out ends up being some kind of firmware workaround. This puts verification in a much more central place than I used to imagine.</p>

<p>Another topic that appeared with great force was <strong>bus arbitration</strong>. The general formulation of the problem is simple: when more than one agent tries to access a shared resource at the same time, someone has to decide priority, order, and access control. But, as often happens in digital systems, what seems like an operational detail soon reveals architectural impact. These mechanisms directly affect the final quality of a <strong>SoC</strong>, interfering with predictability, stability, and efficiency.</p>

<p>I also started to have more direct contact with the broader flow of chip creation, from logical description to fabrication. And perhaps this was one of the most valuable parts of this training: realising that designing hardware is not just about writing correct modules and connecting them properly, but understanding the entire traversal between logic, validation, physical implementation, and production. Along the way, we also returned to the microscopic foundation of it all — like <strong>MOSFET transistors</strong> fabricated in <strong>CMOS</strong> technology, which are, ultimately, the substrate on which all this abstraction rests.</p>

<p>But the distinction that most reorganised my understanding so far appeared when we moved from ideal logic and began looking at something closer to the circuit as it exists in the real world.</p>

<p>That is where <strong>OpenLane</strong> enters — an automated open-source digital design flow that chains steps such as synthesis, <em>floorplanning</em>, <em>placement</em>, <em>routing</em>, and physical verifications. The practical effect of this is simple to describe, though far deeper than it appears: Verilog stops being just an abstract description and begins to be treated as something that needs to fit within a real fabrication technology.</p>

<p>Along with that, the <strong>PDK</strong> (<em>Process Design Kit</em>) also enters — a set of files, models, libraries, and fabrication rules associated with a particular technology. In other words, it defines the ground on which the design can exist: which cells are available, which geometric and electrical boundaries must be respected, which physical constraints are factored in. In our case, we are using <strong>SkyWater 130 nm</strong>, a well-known open PDK in the open-hardware ecosystem.</p>

<p>It was at this point that an important difference became much more concrete for me: one thing is verifying whether logic works in ideal terms; another is verifying whether it continues to work when physical delays stop being abstraction.</p>

<p>With this flow, we start obtaining artefacts like the <strong>SDF</strong> (<em>Standard Delay Format</em>), a standardised format for representing delays and timing information of the circuit after synthesis and implementation. This allows running the testbench again, now accounting for a much more realistic approximation of the design’s temporal behaviour. The question then stops being just “is the logic correct?” and becomes also “does it stay correct when physics starts charging its fee?”</p>

<p>This part surprised me quite a bit, because it exposes a gap that is easy to underestimate on a diagram. There is a considerable distance between a circuit that works in an idealised simulation and a circuit that keeps working when interconnections, parasitic capacitances, fanout, and real delays enter the scene. In hardware, much does not fail at the pure logic level — it fails precisely when the physical world finally joins the conversation.</p>

<p>And it is not only timing that enters this account. The same flow also allows observing metrics like <strong>power consumption</strong>, both when the circuit is active and when it is at rest, along with occupied area and overall design integrity. At some point, the circuit stops being just logical function and becomes, inescapably, an engineering object: it occupies area, dissipates energy, suffers delay, must respect margins.</p>

<p>There is also a very concrete perceptual shift when the design begins to take physical form. Cells, routing, power rails, pins, interconnections, spatial organisation — everything that HDL compresses into a relatively clean abstraction reappears as materiality, commitment, and constraint. It was one of the first times I felt more clearly this passage from circuit as description to circuit as implementable thing.</p>

<p>Below is a physical visualisation of a <strong>4-bit full adder</strong> after this traversal from logical to implementable:</p>

<p><img src="/assets/img/posts/fulladder-gds.png" alt="Physical visualisation of a 4-bit full adder." /></p>

<p>After these steps converge, the flow moves toward <strong>GDSII</strong>, the final file representing the geometric layout used by the foundry in the chip fabrication process.</p>

<p>The fabrication itself could fill a separate text. Between the digital design and the circuit ready for use, there is a long sequence of steps — wafer, die formation, cutting, packaging, testing — and each imposes its own validation criteria. The more contact I have with this flow, the more evident it becomes that designing hardware is, in large part, also designing a verification process rigorous enough that problems do not only appear too late.</p>

<p>If I had to summarise what this first phase has given me so far, it would not just be “more concepts.” I think the main gain was starting to replace a fragmented familiarity with a more continuous view of the architecture. Not because the pieces became simpler, but because the chain between them finally began to appear.</p>]]></content><author><name>Yuri Martins</name></author><category term="Hardware" /><category term="Microelectronics" /><category term="RISC-V" /><category term="Verilog" /><category term="OpenLane" /><category term="CMOS" /><summary type="html"><![CDATA[Notes from the first phase of Champion Chip Experience — microelectronics, Verilog, testbenches, OpenLane, and the distance between ideal logic and physical implementation.]]></summary></entry><entry xml:lang="en"><title type="html">DRM Xe and the Computational Nightmare</title><link href="https://blog.yurimartins.com.br/en/2026/04/12/drm-xe-and-the-computational-nightmare/" rel="alternate" type="text/html" title="DRM Xe and the Computational Nightmare" /><published>2026-04-12T00:54:00-03:00</published><updated>2026-04-12T00:54:00-03:00</updated><id>https://blog.yurimartins.com.br/2026/04/12/drm-xe-and-the-computational-nightmare</id><content type="html" xml:base="https://blog.yurimartins.com.br/2026/04/12/drm-xe-and-the-computational-nightmare/"><![CDATA[<p>This text begins as an investigation note. I am still learning about <code class="language-plaintext highlighter-rouge">DRM Xe</code>, so I prefer to publish the process as it happens rather than waiting for a definitive write-up.</p>

<p>I have always been interested in understanding the internals of software, but that kind of curiosity demands time beyond willingness. Last year, I bought an <strong>Asus Zenbook S14</strong> for work, equipped with an <code class="language-plaintext highlighter-rouge">Intel Core Ultra 7 258V</code> and 32 GB of integrated RAM. Since the machine came with Windows 11, I quickly set up dual boot with <code class="language-plaintext highlighter-rouge">Fedora</code> to closely follow kernel and driver updates.</p>

<p>The peace did not last long: under heavy CPU usage, the laptop would completely freeze, requiring forced reboots. It was that inconvenience that pushed me toward the low level. What began as a search for the cause of the freezes quickly became something more interesting: understanding how recent hardware and software meet in the kernel and, perhaps, how to contribute to the maturation of that platform.</p>

<p>Along the way, I found <a href="https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe">DRM Xe</a>, Intel’s newest <em>Direct Rendering Manager</em>. It is the successor to <code class="language-plaintext highlighter-rouge">i915</code> on recent architectures and is expected to centralise support for Intel’s next GPU generations on Linux. Although development started in 2021, it already shows itself as a mature driver, built by Intel engineers who actively contribute to the Open Source ecosystem.</p>

<p>Diving into <code class="language-plaintext highlighter-rouge">Xe</code> made me realise that managing a modern <code class="language-plaintext highlighter-rouge">iGPU</code> (integrated) imposes enormous challenges, especially in memory management and power states (<code class="language-plaintext highlighter-rouge">D-states</code>). Unlike <code class="language-plaintext highlighter-rouge">i915</code>, which carried years of “legacy,” <code class="language-plaintext highlighter-rouge">Xe</code> proposes a clean codebase but introduces complex abstractions like the <strong>GuC</strong> (<em>Graphics Microcontroller</em>) and the <strong>HuC</strong>.</p>

<p>The <strong>GuC</strong>, in particular, is its own universe I did not even know existed. It is a microcontroller integrated into the SoC responsible for orchestrating command submission and GPU scheduling. For this purpose, it uses the <code class="language-plaintext highlighter-rouge">GGTT</code> (<em>Global Graphics Translation Table</em>), a table that allows the microcontroller to map and access system RAM. The biggest surprise, however, was discovering that some <code class="language-plaintext highlighter-rouge">GuC</code> units use <strong>ARM or RISC-V</strong> architectures. It makes perfect sense: these are far more energy-efficient architectures for that function than <code class="language-plaintext highlighter-rouge">x86</code> would be.</p>

<p>This discovery of a “computer inside the computer” managing resources made several questions surface:</p>

<h4 id="1-if-user-processes-use-the-gpu-who-controls-the-memory-vram-they-use">1. If user processes use the GPU, who controls the memory (VRAM) they use?</h4>
<p><strong>A:</strong> The driver itself. It maintains internal structures and virtual address spaces that ensure isolation between contexts. The driver knows exactly who “owns” each allocation to guarantee one process cannot access another’s data, but it is agnostic to the content — to the driver, it matters little whether those bits are a texture or a mathematical computation.</p>

<h4 id="2-and-how-does-the-driver-use-dram-in-a-shared-way-to-create-vram">2. And how does the driver use DRAM in a shared way to create VRAM?</h4>
<p><strong>A:</strong> In integrated GPUs, we use <code class="language-plaintext highlighter-rouge">UMA</code> (<em>Unified Memory Architecture</em>). There is a complex mapping system so the GPU sees parts of the system RAM as if it were its own local memory. This dynamic mapping is a dense topic I intend to detail in future posts.</p>

<h4 id="3-how-is-a-programs-interface-transformed-into-pixels-on-screen">3. How is a program’s interface transformed into pixels on screen?</h4>
<p><strong>A:</strong> This is a point I am still studying in depth, but it involves resources inherited and shared with <code class="language-plaintext highlighter-rouge">i915</code>. The driver is responsible for managing <code class="language-plaintext highlighter-rouge">BOs</code> (<em>Buffer Objects</em>), chunks of memory containing raw data, and orchestrating their display through <code class="language-plaintext highlighter-rouge">KMS</code> (<em>Kernel Mode Setting</em>), controlling which monitor to update and at what frequency.</p>

<p>Answering those questions led me to another conclusion: if there are mappings for processes, there are execution contexts. And who controls the switching of those contexts at the software level is, again, the driver.</p>

<p>To better visualise where <code class="language-plaintext highlighter-rouge">DRM Xe</code> fits into this flow, I drew this macro pipeline:</p>

<p><img src="/assets/img/posts/macro-pipeline-drm-xe.png" alt="Basic rendering pipeline, showing the location of DRM Xe between User Space and Hardware." /></p>

<p>Interestingly, although the system sees the <code class="language-plaintext highlighter-rouge">iGPU</code> as a <code class="language-plaintext highlighter-rouge">PCI</code> device, in <em>Lunar Lake</em> this communication bypasses the physical <code class="language-plaintext highlighter-rouge">PCIe</code> wires and runs through an internal silicon fabric (<em>Fabric</em>), which explains why a bug here brings the system down so quickly: we are sharing the same main data highway as the CPU.</p>

<p>It is important to remember that this “resource manager” role of the driver is vital not just for video, but for multiprocessing via GPU <em>kernels</em> — an essential feature for Machine Learning models, for example.</p>

<h3 id="the-path-to-contribution">The path to contribution</h3>

<p>But how do you enter this game? I found that development for new contributors happens in a branch focused on integration: <a href="https://cgit.freedesktop.org/drm-tip">drm-tip</a>. Although there are internal processes that keep the main kernel in parity with this branch, it is in <code class="language-plaintext highlighter-rouge">drm-tip</code> that new features are validated.</p>

<p>Intel’s own engineers review patches and suggest improvements. To ensure stability, there is a massive test suite (like <a href="https://gitlab.freedesktop.org/drm/igt-gpu-tools">IGT GPU Tools</a>) and a repository for running automated <em>live tests</em> on real hardware, validating each change before it is even merged into the main code.</p>

<p>I know this is only the first post on this topic and that much remains to be explained. My biggest challenge right now is exactly this vastness of details, but the goal is clear: document everything until I land my first patch in <code class="language-plaintext highlighter-rouge">DRM</code>.</p>

<p>Follow along this journey.</p>]]></content><author><name>Yuri Martins</name></author><category term="Kernel" /><category term="Drivers" /><category term="Intel" /><category term="Lunar Lake" /><category term="DRM" /><category term="Linux" /><summary type="html"><![CDATA[An investigation note on the DRM Xe driver — Intel's GPU driver for recent architectures on Linux — and the journey toward understanding and contributing to it.]]></summary></entry><entry xml:lang="pt-BR"><title type="html">DRM Xe e o pesadelo computacional</title><link href="https://blog.yurimartins.com.br/en/2026/04/12/drm-xe-e-o-pesadelo-computacional/" rel="alternate" type="text/html" title="DRM Xe e o pesadelo computacional" /><published>2026-04-12T00:54:00-03:00</published><updated>2026-04-12T00:54:00-03:00</updated><id>https://blog.yurimartins.com.br/2026/04/12/drm-xe-e-o-pesadelo-computacional</id><content type="html" xml:base="https://blog.yurimartins.com.br/2026/04/12/drm-xe-e-o-pesadelo-computacional/"><![CDATA[<p>Este texto nasce como uma nota de investigação. Ainda estou aprendendo sobre o <code class="language-plaintext highlighter-rouge">DRM Xe</code>, então prefiro publicar o processo enquanto ele acontece em vez de esperar um texto definitivo.</p>

<p>Sempre tive interesse em entender as entranhas do software, mas esse tipo de curiosidade exige tempo além da vontade. No ano passado, comprei um <strong>Asus Zenbook S14</strong> para trabalho, equipado com um <code class="language-plaintext highlighter-rouge">Intel Core Ultra 7 258V</code> e 32 GB de RAM integrados. Como a máquina veio com Windows 11, logo fiz o dual boot com <code class="language-plaintext highlighter-rouge">Fedora</code> para acompanhar de perto as atualizações de kernel e drivers.</p>

<p>A paz durou pouco: em uso pesado de CPU, o laptop congelava completamente, exigindo reinicializações forçadas. Foi esse incômodo que me empurrou para o baixo nível. O que começou como uma busca pela causa dos travamentos logo se tornou algo mais interessante: entender como o hardware recente e o software se encontram no kernel e, quem sabe, como contribuir para o amadurecimento dessa plataforma.</p>

<p>Nesse caminho, encontrei o <a href="https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/xe">DRM Xe</a>, o <em>Direct Rendering Manager</em> mais novo da Intel. Ele é o sucessor do <code class="language-plaintext highlighter-rouge">i915</code> nas arquiteturas recentes e deve concentrar o suporte às próximas gerações de GPU da Intel no Linux. Embora o desenvolvimento tenha começado em 2021, ele já se mostra um driver maduro, construído por engenheiros da Intel que contribuem ativamente no ecossistema <em>Open Source</em>.</p>

<p>Mergulhar no <code class="language-plaintext highlighter-rouge">Xe</code> me fez perceber que gerenciar uma <code class="language-plaintext highlighter-rouge">iGPU</code> (integrada) moderna impõe desafios imensos, especialmente no gerenciamento de memória e nos estados de energia (<code class="language-plaintext highlighter-rouge">D-states</code>). Diferente do <code class="language-plaintext highlighter-rouge">i915</code>, que carregava anos de “legado”, o <code class="language-plaintext highlighter-rouge">Xe</code> propõe uma base de código limpa, mas que introduz abstrações complexas como o <strong>GuC</strong> (<em>Graphics Microcontroller</em>) e o <strong>HuC</strong>.</p>

<p>O <strong>GuC</strong>, inclusive, é um universo à parte que eu sequer sabia que existia. Ele é um microcontrolador integrado ao SoC responsável por orquestrar a submissão de comandos e o escalonamento (<em>scheduling</em>) da GPU. Para isso, ele utiliza o <code class="language-plaintext highlighter-rouge">GGTT</code> (<em>Global Graphics Translation Table</em>), uma tabela que permite ao microcontrolador mapear e acessar a memória RAM do sistema. A maior surpresa, porém, foi descobrir que alguns <code class="language-plaintext highlighter-rouge">GuC</code> utilizam arquiteturas <strong>ARM ou RISC-V</strong>. Faz total sentido: são arquiteturas muito mais eficientes energeticamente para essa função do que o <code class="language-plaintext highlighter-rouge">x86</code> seria.</p>

<p>Essa descoberta de que existe “um computador dentro do computador” gerenciando recursos fez várias perguntas borbulharem na minha mente:</p>

<h4 id="1-se-os-processos-de-usuário-usam-a-gpu-quem-controla-a-memória-vram-usada-por-eles">1. Se os processos de usuário usam a GPU, quem controla a memória (VRAM) usada por eles?</h4>
<p><strong>R:</strong> O próprio driver. Ele mantém estruturas internas e espaços de endereçamento virtual que garantem o isolamento entre contextos. O driver sabe exatamente quem é o “dono” de cada alocação para garantir que um processo não acesse os dados de outro, mas ele é agnóstico ao conteúdo, para o driver, pouco importa se aqueles bits são uma textura ou um cálculo matemático.</p>

<h4 id="2-e-como-o-driver-usa-a-dram-de-forma-compartilhada-para-criar-uma-vram">2. E como o driver usa a DRAM de forma compartilhada para criar uma VRAM?</h4>
<p><strong>R:</strong> Em GPUs integradas, utilizamos a <code class="language-plaintext highlighter-rouge">UMA</code> (<em>Unified Memory Architecture</em>). Existe um complexo sistema de mapeamento para que a GPU enxergue partes da memória RAM do sistema como se fosse sua própria memória local. Esse mapeamento dinâmico é um tema denso que pretendo detalhar nos próximos posts.</p>

<h4 id="3-como-a-interface-de-um-programa-é-transformada-em-pixels-na-tela">3. Como a interface de um programa é transformada em pixels na tela?</h4>
<p><strong>R:</strong> Este é um ponto que ainda estou estudando a fundo, mas envolve recursos herdados e compartilhados com o <code class="language-plaintext highlighter-rouge">i915</code>. O driver é responsável por gerenciar os <code class="language-plaintext highlighter-rouge">BOs</code> (<em>Buffer Objects</em>), pedaços de memória contendo os dados brutos, e orquestrar sua exibição através do <code class="language-plaintext highlighter-rouge">KMS</code> (<em>Kernel Mode Setting</em>), controlando qual monitor atualizar e com qual frequência.</p>

<p>Responder a essas dúvidas me levou a outra conclusão: se existem mapeamentos para processos, existem contextos de execução. E quem controla a troca desses contextos a nível de software é, novamente, o driver.</p>

<p>Para visualizar melhor onde o <code class="language-plaintext highlighter-rouge">DRM Xe</code> se encaixa nesse fluxo, desenhei este macro-pipeline:</p>

<p><img src="/assets/img/posts/macro-pipeline-drm-xe.png" alt="Pipeline de Renderização básico, mostrando a localização do DRM Xe entre o User Space e o Hardware." /></p>

<p>Curiosamente, embora o sistema enxergue a <code class="language-plaintext highlighter-rouge">iGPU</code> como um dispositivo <code class="language-plaintext highlighter-rouge">PCI</code>, no <em>Lunar Lake</em> essa comunicação ignora os fios físicos do <code class="language-plaintext highlighter-rouge">PCIe</code> e corre por uma malha de silício interna (<em>Fabric</em>), o que explica por que um bug aqui derruba o sistema tão rápido: estamos compartilhando a mesma estrada principal de dados da CPU.</p>

<p>É importante lembrar que esse papel de “gerente de recursos” do driver é vital não só para vídeo, mas para o multiprocessamento via <em>kernels</em> de GPU, recurso essencial para modelos de <em>Machine Learning</em>, por exemplo.</p>

<h3 id="o-caminho-para-a-contribuição">O caminho para a contribuição</h3>

<p>Mas como se entra nesse jogo? Descobri que o desenvolvimento para novos contribuintes acontece em um ramo (<em>branch</em>) focado em integração: o <a href="https://cgit.freedesktop.org/drm-tip">drm-tip</a>. Embora existam processos internos que mantêm o kernel principal em paridade com esse ramo, é no <code class="language-plaintext highlighter-rouge">drm-tip</code> que as novas funcionalidades são validadas.</p>

<p>Os próprios engenheiros da Intel analisam os <em>patches</em> e sugerem melhorias. Para garantir a estabilidade, existe uma suíte de testes gigantesca (como o <a href="https://gitlab.freedesktop.org/drm/igt-gpu-tools">IGT GPU Tools</a>) e um repositório para execução de <em>live tests</em> automatizados em hardware real, validando cada alteração antes mesmo de ela ser fundida ao código principal.</p>

<p>Sei que este é apenas o primeiro post e que ainda falta muita coisa para ser explicada. A minha maior dor agora é justamente essa vastidão de detalhes, mas a meta é clara: documentar tudo até conseguir lançar meu primeiro patch no <code class="language-plaintext highlighter-rouge">DRM</code>.</p>

<p>Me acompanhem nessa jornada.</p>]]></content><author><name>Yuri Martins</name></author><category term="Kernel" /><category term="Drivers" /><category term="Intel" /><category term="Lunar Lake" /><category term="DRM" /><category term="Linux" /><summary type="html"><![CDATA[Este texto nasce como uma nota de investigação. Ainda estou aprendendo sobre o DRM Xe, então prefiro publicar o processo enquanto ele acontece em vez de esperar um texto definitivo.]]></summary></entry><entry xml:lang="pt-BR"><title type="html">Caderno aberto</title><link href="https://blog.yurimartins.com.br/en/2026/04/08/caderno-aberto/" rel="alternate" type="text/html" title="Caderno aberto" /><published>2026-04-08T23:17:22-03:00</published><updated>2026-04-08T23:17:22-03:00</updated><id>https://blog.yurimartins.com.br/2026/04/08/caderno-aberto</id><content type="html" xml:base="https://blog.yurimartins.com.br/2026/04/08/caderno-aberto/"><![CDATA[<p>Há muito material técnico que some porque fica preso em abas abertas, rascunhos ou memória curta. A proposta deste blog é simples: transformar parte do estudo em texto utilizável.</p>

<p>Quero usar este espaço para três coisas.</p>

<ol>
  <li>Registrar conceitos novos antes que eles evaporem.</li>
  <li>Organizar investigações que deram trabalho e merecem referência futura.</li>
  <li>Publicar artigos mais completos quando um assunto pede contexto, exemplos e trade-offs.</li>
</ol>

<p>Os temas devem variar, mas o eixo é relativamente estável: engenharia de software, computação, embarcados, IoT, microeletrônica, telecom e qualquer assunto em que teoria e implementação real se encontrem.</p>

<p>Não espero uma linha editorial rígida. Algumas publicações vão ser curtas, quase como notas de laboratório. Outras vão exigir mais elaboração, especialmente quando envolverem arquitetura, protocolos, hardware, depuração ou explicações que eu gostaria de encontrar prontas quando comecei a estudar o tema.</p>

<p>Se funcionar como espero, o blog vira menos vitrine e mais arquivo vivo de estudo e prática. Esse é o tipo de texto que eu mesmo gostaria de revisitar daqui a alguns meses.</p>]]></content><author><name>Yuri Martins</name></author><category term="blog" /><category term="processo" /><summary type="html"><![CDATA[Por que este blog existe e como pretendo usar este espaço para registrar estudo, projeto e raciocínio técnico.]]></summary></entry><entry xml:lang="en"><title type="html">Open Notebook</title><link href="https://blog.yurimartins.com.br/en/2026/04/08/open-notebook/" rel="alternate" type="text/html" title="Open Notebook" /><published>2026-04-08T23:17:22-03:00</published><updated>2026-04-08T23:17:22-03:00</updated><id>https://blog.yurimartins.com.br/2026/04/08/open-notebook</id><content type="html" xml:base="https://blog.yurimartins.com.br/2026/04/08/open-notebook/"><![CDATA[<p>A lot of technical material disappears because it gets trapped in open browser tabs, drafts, or short-term memory. The premise of this blog is simple: turn part of my studying into usable text.</p>

<p>I want to use this space for three things.</p>

<ol>
  <li>Record new concepts before they evaporate.</li>
  <li>Organise investigations that took effort and deserve a future reference.</li>
  <li>Publish more complete articles when a topic calls for context, examples, and trade-offs.</li>
</ol>

<p>The subjects will vary, but the axis is relatively stable: software engineering, computing, embedded systems, IoT, microelectronics, telecom, and any topic where theory and real implementation meet.</p>

<p>I do not expect a rigid editorial line. Some posts will be short, almost like lab notes. Others will require more elaboration, especially when they involve architecture, protocols, hardware, debugging, or explanations I would have liked to find ready-made when I started studying the topic.</p>

<p>If it works as I hope, the blog becomes less of a showcase and more of a living study and practice archive. That is the kind of text I would like to revisit myself a few months from now.</p>]]></content><author><name>Yuri Martins</name></author><category term="blog" /><category term="process" /><summary type="html"><![CDATA[Why this blog exists and how I plan to use this space to record study, projects, and technical reasoning.]]></summary></entry></feed>