Skip to content

A hardware description language created as an EDSL in Haskell.

License

Notifications You must be signed in to change notification settings

aninhumer/mantle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Mantle is a Hardware Description Language created as an embedded language in Haskell. It uses a monadic construct to build up a Register Transfer Level representation of hardware, which can then be compiled to synthesisable Verilog code. This can then be built upon using regular Haskell to provide complex and powerful abstractions for creating hardware designs.

Here is a simple counter example in Mantle, which uses an abstraction for Synchronous circuit designs:

counter :: SyncComp (Output Int)
counter out = do
    count <- reg 0          -- Create a register which is set to 0 on reset.
    onSync $ do             -- Then every clock edge,
        count <=: count + 1 -- increment the counter.
    out =: count            -- Set the output to match the current count.

I am developing Mantle as a third year undergraduate project at Cambridge University.

About

A hardware description language created as an EDSL in Haskell.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published