{"id":23,"date":"2026-04-02T22:31:34","date_gmt":"2026-04-02T22:31:34","guid":{"rendered":"https:\/\/llama.gs\/blog\/?p=23"},"modified":"2026-04-02T22:31:34","modified_gmt":"2026-04-02T22:31:34","slug":"from-dsl-to-fpga-closing-the-loop","status":"publish","type":"post","link":"https:\/\/llama.gs\/blog\/index.php\/2026\/04\/02\/from-dsl-to-fpga-closing-the-loop\/","title":{"rendered":"From DSL to FPGA: Closing the Loop"},"content":{"rendered":"<p>This quarter, <a href=\"https:\/\/www.theregister.com\/2026\/01\/20\/pwc_ai_ceo_survey\/\">4,500 CEOs told PwC<\/a> their AI investments produced nothing. Separately, someone <a href=\"https:\/\/www.theregister.com\/2026\/03\/17\/ai_businesses_faking_it_reckoning_coming_codestrap\/\">used AI to rewrite SQLite in Rust<\/a> \u2014 2,000 times slower. I have a cunning plan: what if we used computers to do actual computing?<\/p>\n<p>Last week I said I was building a toolchain that goes from formal logic to real hardware. That post was a manifesto. This one is a receipt.<\/p>\n<p>Seven days later: a full ALU \u2014 add, subtract, multiply, divide, integer factorization \u2014 running at 100MHz on a $150 <a href=\"https:\/\/gitlab.llama.gs\/fpga\/llogic_basys3\">Basys3 FPGA<\/a>. UART command line with tab completion and history. No manual Verilog. No hand-optimized netlists. No venture capital. No pitch deck.<\/p>\n<p>The arithmetic circuits are generated programmatically in <a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic\">llogic<\/a>, translated to synthesizable Verilog by <a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic2verilog\">llogic2verilog<\/a>, and deployed on a MicroBlaze soft processor over AXI4-Lite. The entire path from logical specification to working silicon is automated. One person, one week, open source.<\/p>\n<div style=\"width: 1200px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-23-1\" width=\"1200\" height=\"600\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/llama.gs\/blog\/wp-content\/uploads\/2026\/04\/llogic_basys3.mp4?_=1\" \/><a href=\"https:\/\/llama.gs\/blog\/wp-content\/uploads\/2026\/04\/llogic_basys3.mp4\">https:\/\/llama.gs\/blog\/wp-content\/uploads\/2026\/04\/llogic_basys3.mp4<\/a><\/video><\/div>\n<p>The <code class=\"\" data-line=\"\">factor<\/code> command brute-forces integer factorization by driving the multiplier at clock speed \u2014 100 million candidates per second on a hobby board. Not a simulation. Not a testbench. Electrons moving through gates on a Xilinx Artix-7.<\/p>\n<h2>Nobody wrote this Verilog<\/h2>\n<p>That&#8217;s the point. Not the ALU \u2014 any undergraduate can write an adder. The point is that no human touched the HDL.<\/p>\n<p>The circuit specifications live in <a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic\">llogic<\/a>&#8216;s DSL \u2014 a formal representation that spans Boolean formulas, CNF, circuits, and reversible\/quantum circuits under one roof. <a href=\"https:\/\/gitlab.llama.gs\/logic\/lcfgen\">lcfgen<\/a> generates parameterized circuit families from that representation. <a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic2verilog\">llogic2verilog<\/a> translates them to synthesizable Verilog. Vivado takes it the rest of the way.<\/p>\n<p><strong><a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic\">llogic<\/a> DSL \u2192 <a href=\"https:\/\/gitlab.llama.gs\/logic\/lcfgen\">lcfgen<\/a> \u2192 <a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic2verilog\">llogic2verilog<\/a> \u2192 Vivado \u2192 <a href=\"https:\/\/gitlab.llama.gs\/fpga\/llogic_basys3\">FPGA<\/a><\/strong><\/p>\n<p>Every step automated. Every component open source. No license fees, no NDAs, no EDA vendor lock-in.<\/p>\n<h2>What&#8217;s next<\/h2>\n<p>If you work on synthesis, hardware, or you&#8217;re funding research \u2014 the code is open and the board costs $150.<\/p>\n<p>Next post: cryptographic circuit generators for DES and SHA, synthesized from the DSL, deployed to the FPGA. After that: an open-source architecture for SHA-1 collision hunting that makes Bitcoin&#8217;s address space look rather less comfortable. All designs public \u2014 because if the vulnerability exists, pretending otherwise is just poor manners. Any coins found can fund something useful. Clean energy. Quantum computing. Not <a href=\"https:\/\/www.theregister.com\/2026\/01\/09\/ces_worstinshow_fatuous_ai_overlycomplex\/\">espresso machines with a subscription model<\/a>.<\/p>\n<p><em>Ceterum censeo slopem esse delendam.<\/em><\/p>\n<p>(Cato the Elder ended every speech in the Roman Senate with &#8220;Carthage must be destroyed&#8221; \u2014 regardless of the topic. This is that, but for AI slop.)<\/p>\n<p><strong>Repositories:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic\">llogic<\/a> \u2014 Logic representations<\/li>\n<li><a href=\"https:\/\/gitlab.llama.gs\/logic\/lcfgen\">lcfgen<\/a> \u2014 Circuit family generator<\/li>\n<li><a href=\"https:\/\/gitlab.llama.gs\/logic\/llogic2verilog\">llogic2verilog<\/a> \u2014 Circuit to Verilog<\/li>\n<li><a href=\"https:\/\/gitlab.llama.gs\/logic\/lverilog\">lverilog<\/a> \u2014 Verilog parser<\/li>\n<li><a href=\"https:\/\/gitlab.llama.gs\/fpga\/llogic_basys3\">llogic_basys3<\/a> \u2014 FPGA demo<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This quarter, 4,500 CEOs told PwC their AI investments produced nothing. Separately, someone used AI to rewrite SQLite in Rust \u2014 2,000 times slower. I have a cunning plan: what if we used computers to do actual computing? Last week I said I was building a toolchain that goes from formal logic to real hardware. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":1,"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":26,"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions\/26"}],"wp:attachment":[{"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/llama.gs\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}