Conflict: House
Conflict is a practical {hardware} description language that borrows each its syntax and semantics from the practical programming language Haskell. It supplies a well-recognized structural design strategy to each combinational and synchronous sequential circuits. The Conflict compiler transforms these high-level descriptions to low-level synthesizable VHDL, Verilog, or SystemVerilog.
Conflict is an open-source challenge, licensed beneath the permissive BSD2 license, and actively maintained by QBayLogic. The Conflict challenge is a Haskell Foundation affiliated challenge.
Strongly typed
Conflict is constructed on Haskell which supplies a wonderful basis for well-typed code. Along with Conflict’s normal library it’s straightforward to construct scalable and reusable {hardware} designs.
Interactive REPL
Load your designs in an interpreter and simply take a look at all of your element with no need to setup a take a look at bench.
Low-level entry
Though Conflict presents many options, you typically must straight entry VHDL, Verilog, or SystemVerilog straight. Conflict permits you to do that with its personal templating system.
Haskell has develop into the practical programming language of selection for a lot of builders on account of its wonderful instruments for abstraction and principled program design. The open supply Conflict {hardware} description language now brings these options to FPGA improvement.
Retrocomputing with Clash takes the skilled Haskell programmer on a journey into the world of {hardware} design with Conflict. Our strategy relies on utilizing Haskell to its fullest potential, utilizing abstractions like monads and lenses in constructing a library of reusable elements.
- Pocket calculator
- Pong (sample chapter)
- An implementation of the CHIP-8 digital pc specification
- Intel 8080 CPU
- House Invaders arcade machine
- Compucolor II, a house pc from 1977 full with keyboard, coloration video, and a floppy drive
FIR Filter
Conflict permits programmers to write down operate with out hardcoded size or ingredient sort data, similar to this FIR filter:
fir coeffs x = dotp coeffs (window x)
the place
dotp as bs = sum (zipWith (*) as bs)
Conflict will determine the kind of this operate by means of its highly effective sort inference system. To “lock” sorts in place, we are able to partially apply `fir`:
-- inferred: Sign dom Int -> Sign dom Int
fir3int = fir (3 :> 4 :> 5 :> Nil)
-- inferred: Sign dom Float -> Sign dom Float
fir4float = fir (3.5 :> 4.2 :> 3.0 :> 6.1 :> Nil)
Matrix multiplication
In the event you do select to write down sorts explicitly, you possibly can add further constraints. Conflict will verify these constraints and refuse to compile if they don’t seem to be met. The next instance implements a totally parallel matrix multiplication algorithm:
mmult
-- Dimension constraints:
:: na ~ mb
=> 1 <= mb
-- Enable simulation to entry mb/nb:
=> KnownNat mb
=> KnownNat nb
-- Arguments:
=> Vec ma (Vec na Int)
-> Vec mb (Vec nb Int)
-- Consequence:
-> Vec ma (Vec nb Int)
mmult mA mB = outcome
the place
mBT = transpose mB
dot a b = sum $ zipWith (*) a b
outcome = map (ar -> dot ar <$> mBT) mA
Conflict advantages from an lively neighborhood.
Whether or not you want a query answered or need to contribute to open-source options, browse the options beneath to benefit from Conflict.
We count on contributors on these public boards to watch our Guidelines for Respectful Communication.
Mailing list
Issue tracker
Slack: functionalprogramming.slack.com#clash (Invite your self at fpslack.com)
IRC (webchat): libera.chat#clash (or ircs://irc.libera.chat:6697/clash while you need to join with an everyday IRC consumer)
In the event you want skilled help from the original developers of Conflict, take a look at the support plan.