Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    The Top 25 Best Pokemon Games of All Time, Ranked

    Turns Out Perplexity Might Be the Sleeper Feature on Samsung’s Galaxy S26

    Today’s NYT Mini Crossword Answers for Thursday, Feb. 26

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Tensions between the Pentagon and AI giant Anthropic reach a boiling point

      February 21, 2026

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026
    • Business

      How Smarsh built an AI front door for regulated industries — and drove 59% self-service adoption

      February 24, 2026

      Where MENA CIOs draw the line on AI sovereignty

      February 24, 2026

      Ex-President’s shift away from Xbox consoles to cloud gaming reportedly caused friction

      February 24, 2026

      Gartner: Why neoclouds are the future of GPU-as-a-Service

      February 21, 2026

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026
    • Crypto

      Crypto Market Rebound Wipes Out Nearly $500 Million in Short Positions

      February 26, 2026

      Ethereum Climbs Above $2000: Investors Step In With Fresh Accumulation

      February 26, 2026

      Mutuum Finance (MUTM) Prepares New Feature Expansion for V1 Protocol

      February 26, 2026

      Bitcoin Rebounds Toward $70,000, But Is It a Momentary Relief or Slow Bull Run Signal?

      February 26, 2026

      IMF: US Inflation Won’t Hit Fed Target Until 2027, Delaying Rate Cuts

      February 26, 2026
    • Technology

      The Top 25 Best Pokemon Games of All Time, Ranked

      February 26, 2026

      Turns Out Perplexity Might Be the Sleeper Feature on Samsung’s Galaxy S26

      February 26, 2026

      Today’s NYT Mini Crossword Answers for Thursday, Feb. 26

      February 26, 2026

      Today’s NYT Connections: Sports Edition Hints and Answers for Feb. 26, #521

      February 26, 2026

      New York Times Debuts the Midi Crossword, Its In-Between Puzzle

      February 26, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Spade Hardware Description Language
    Technology

    Spade Hardware Description Language

    TechAiVerseBy TechAiVerseMay 12, 2025No Comments6 Mins Read1 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    Spade Hardware Description Language

    Spade is a new hardware description language which makes hardware
    description easier and less error-prone. It does this by taking lessons from
    software programming languages, and adding language level support for common
    hardware constructs, all without compromising low level control over what
    hardware gets generated.

    Key Features

    Language Level Pipelines

    Pipelines are a first class construct in Spade, making re-timing and
    re-pipelining trivial. The reg separates code into stages, meaning you never
    have to manually define pipeline registers, and that behavior is separated
    from physical implementation.

    When you need to update your design to meet timing, you can simply add or move
    reg statements. The compiler is
    smart enough to figure out when these changes affect the timing of instantiating
    modules and tells you where to update your code to keep the original behavior.

    pipeline(4) X(clk: clk, a: int<32>, b: int<32>) -> int<64> {
            let product = a * b;
        reg * 3;
            let result = f(a, product);
        reg;
            result
    }
    

    For more complex pipelines with feedback, such as a processor data path,
    re-timing becomes less trivial, but being able to reason about signals in
    stages instead of individual registers is still very helpful.

    Types and Enums

    Spade has a powerful type system with structs, arrays, tuples and sum types
    called enums.
    A strong type system makes interoperability with external or internal modules
    easier, and means you can refactor your code with confidence. The compiler will
    tell you where your changes affect the behavior of your code.

    Enums are of particular importance: unlike the enums of C and Verilog, they can
    have associated payload.

    You can model a value which may or may not be available with the Option enum:

    enum Option {
        Some(val: T),
        None
    }
    

    Or why not model the instruction set of a CPU?

    enum Insn {
        Set { dreg: int<5>, val: int<32> },
        Add { dreg: int<5>, lhs: int<5>, rhs: int<5> },
        Sub { dreg: int<5>, lhs: int<5>, rhs: int<5> },
        Jump { target: int<32> }
    }
    

    The compiler ensures that fields can only be accessed if the value is of the
    correct type. For example, if the instruction is a Jump, there is no way to
    access a dreg field.

    Pattern Matching

    Enums work really well with pattern matching which allows you to check
    conditions and easily bind sub-values to variables.

    You can easily build an ALU:

    fn alu(insn: Insn, rs1: int<32>, rs2: int<32>) -> int<32> {
        let adder_result = match insn {
            Insn::Add(_, _, _) => rs1 + rs2,
            Insn::Sub(_, _, _) => rs1 - rs2,
            Insn::Set(_, val) => sext(val),
            Insn::Jump(_) => 0,
        };
    
        trunc(adder_result)
    }
    

    Or select the first of two values, and 0 if none are present:

    let result = match (a, b) {
        (Some (x), _) => x,
        (_, Some(x)) => x,
        _ => 0
    }
    

    The compiler makes sure that all cases are covered. For example, if you add a
    new instruction to the Insn type, it will force you to deal with that case in
    the ALU.

    Type inference

    Spade has powerful type inference which gives you the benefits of static types,
    without all the typing.

    Great Error Messages

    The compiler should be your friend. Error messages give you as much information
    as possible

    error: Match branches have incompatible type
    30 +-Insn::Add(_, _, _) => rs1 + rs2,
       |                       ^^^^^^^^^
       |                       This branch has type int<33>
    32 | Insn::Set(_, val) => val,
       |                      ^^^ But this one has type int<32>
       |
       = Expected: 33 in: int<33>
       =      Got: 32 in: int<32>
    

    Bad error messages are considered a bug. Please report them!

    Helpful tooling

    Spade comes with a great set of tools around the language

    • The official build tool Swim manages
      your dependencies, calls synthesis tools and runs your tests. It can even
      create a new project for you with a single command!

      • Of course you can put the generated Verilog into your regular build flow
        as well.
    • Tests are written in cocotb allowing you to take
      advantage of python for all your testing needs. When you need higher
      performance tests, you can also use verilator
    • VCDs coming out of tests are automatically translated to include Spade type
      information so you never have to decode individual bits in your waveform.

    Planned features

    There are also some planned features:

    • Integer ranges as types.
    • Generics with traits
    • Clock domain information on types.
      • Mixing domains without explicit synchronization is a compilation error.
      • Related: clock domain inference where the domain is obvious.
    • And more…

    Using Spade

    To get started, read the (work in progress) spade book.

    For an overview of what Spade is, have a look at this
    talk from OSDA 2023.
    Documentation is very much a work in progress, but some is available in our
    book.

    Spade is in its early stages, so everything is subject to change. You can build
    things with it but be prepared for bugs and missing features.

    Learn more

    Feel free to follow the development either on Gitlab
    or in our Discord community server.

    Publications

    To cite Spade itself, use the zenodo record.

    • Frans Skarman, Lucas Klemmer Oscar Gustafsson Daniel Große.
      Enhancing Compiler-Driven HDL Design with Automatic Waveform Analysis.
      September 2023. In: Forum on specification & Design Languages (FDL).
    • Frans Skarman, Oscar Gustafsson.
      Spade: An Expression-Based HDL With Pipelines.
      April 2023. In: 3rd Workshop on Open-Source Design Automation (OSDA).
    • Frans Skarman, Oscar Gustafsson.
      Abstraction in the Spade Hardware Description Language.
      March 2023. In: 3rd Workshop on Languages, Tools, and Techniques for Accelerator Design (LATTE).
    • Frans Skarman, Oscar Gustafsson.
      Spade: An HDL Inspired by Modern Software Languages.
      August 2022. In: 32nd International Conference on Field-Programmable Logic and Applications (FPL).

    Talks

    • Frans Skarman
      Spade – An HDL Inspired by Modern Software Languages.
      May 2024. At: LatchUp 2024.

    Development

    Spade is currently being developed as an Open Source project at the
    Division of Computer Engineering,
    Department of Electrical Engineering,
    Linköping University, Sweden.

    License

    The Spade compiler and other tooling is licensed under the EUPL-1.2
    license
    .
    The Spade standard library and this website is licensed under the terms of both
    the MIT
    license
    and
    the Apache
    license
    .

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleSpark AI (YC W24) Is Hiring a Full Stack Engineer in San Francisco
    Next Article University of Texas-Led Team Solves a Big Problem for Fusion Energy
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    The Top 25 Best Pokemon Games of All Time, Ranked

    February 26, 2026

    Turns Out Perplexity Might Be the Sleeper Feature on Samsung’s Galaxy S26

    February 26, 2026

    Today’s NYT Mini Crossword Answers for Thursday, Feb. 26

    February 26, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025693 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025279 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025160 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025122 Views
    Don't Miss
    Technology February 26, 2026

    The Top 25 Best Pokemon Games of All Time, Ranked

    The Top 25 Best Pokemon Games of All Time, RankedThere’s a reason your mom knows…

    Turns Out Perplexity Might Be the Sleeper Feature on Samsung’s Galaxy S26

    Today’s NYT Mini Crossword Answers for Thursday, Feb. 26

    Today’s NYT Connections: Sports Edition Hints and Answers for Feb. 26, #521

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    The Top 25 Best Pokemon Games of All Time, Ranked

    February 26, 20260 Views

    Turns Out Perplexity Might Be the Sleeper Feature on Samsung’s Galaxy S26

    February 26, 20260 Views

    Today’s NYT Mini Crossword Answers for Thursday, Feb. 26

    February 26, 20260 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.