Hydra

1 program Added 2026-02-23T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit d7c902fdfa · authored 2026-02-23T18:09:11+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Pixel Bender (0.29)Imandra (0.23)Gura (0.18)Heta (0.18)Hylo (0.18)

LLM-contributed programs

4-bit Adder Simulation Driver

Provenance: commit d7c902fdfa · authored 2026-02-23T18:09:11+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.hs · license: GPL-3.0 · added: 2026-02-23T10:00:00Z
-- Add4Run: simulation driver for add4 circuit
-- This file is part of Hydra. See README, https://github.com/jtod/Hydra
-- Copyright (c) 2022 John T. O'Donnell

module Main where
import HDL.Hydra.Core.Lib
import Add4

-- Each test has input data "c x y" where c is the carry input (must
-- be 0 or 1) and x and y are integers between 0 and 15. A number of
-- such tests are provided; they will run on successive clock cycles.

testdata1 :: [String]
testdata1 =
--------------------------------------------------
-- c x y -- name of signal
--------------------------------------------------
 ["0 5 8", -- inputs for clock cycle 0
  "0 7 3", -- inputs for clock cycle 1
  "0 8 12", -- inputs for clock cycle 2
  "0 8 1", -- inputs for clock cycle 3
  "1 12 1", -- inputs for clock cycle 4
  "1 2 3", -- inputs for clock cycle 5
  "1 15 15"] -- inputs for clock cycle 6

main :: IO ()
main = driver $ do
 useData testdata1

-- Inputs
 cin <- inputBit "cin"
 x <- inputWord "x" 4
 y <- inputWord "y" 4

-- Circuit
 let (cout,s) = add4 cin x y

-- Outputs
 outputBit "cout" cout
 outputWord "s" s

-- Run
 runSimulation

Contribute — propose a file extension

Tell us where to find evidence about Hydra (mapped to pl/hydra). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Hydra/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← hycom HydraLoop →