Giter Club home page Giter Club logo

wyre's Introduction

Wyre

An ergonomic hardware definition language that compiles to Verilog.

Features

  • Strongly typed
  • Type inference
  • Inline module instantiations
  • Order independent declarations
  • Minimalistic syntax
  • Newline as statement separator
  • Names before types and compact type notation
  • C-style { block syntax }
  • Compact bit literals
  • match expressions
  • Large data literals (data blocks)
  • Builtin functions for transforming data (e.g. slice, swizzle)
  • Structs
  • Column accurate compile error reporting

Learn more about these features

Example

What does Wyre look like? Here is a basic example design with 2 modules, a clock input, a button and 3 leds.

top(clk $1, button $1) {
	out reg leds $3

	posedge clk {
		if button {
			leds <= '111
		} else {
			leds <= inc(a: leds).o
		}
	}
}

inc(a $3) {
	out o := a + 1
}

Background

A while back I got a Lattice iCE40 FPGA. I've had a lot of fun making designs for it in Verilog and learning more about how computers work at a low level. During the process I kept track of gripes with the toolchain. I ended up with a list of mostly minor things, but nonetheless a list that had a fair amount of items. I felt that there were enough items to justify building some new tooling, and Wyre is the result.

Compared to Verilog, Wyre aims to cut down on verbosity, reduce errors (via strong typing) and improve design iteration speed. Wyre compiles to Verilog, so any design can be fed through an existing Verilog-based toolchain.

Some other hardware definition languages try to abstract away the hardware in some ways, with features like memory inference and various generative constructs. These higher level features are explicit non-goals for Wyre. Instead, Wyre aims to stay close to the hardware.

The Wyre compiler is written in the Muon programming language, of which I am the author and which is my main open source project. Syntactically, Wyre and Muon have a quite a bit in common. So if you like Wyre, be sure to check out Muon too!

Getting started

For a quick summary of features, check out Feature overview (recommended).

For in-depth documentation, have a look at the Language guide.

To learn more about how to install and use the compiler, go to Getting started. Wyre works on Windows and Linux. I haven't tested it on macOS, but it will likely work.

You can also view more examples.

Roadmap

Feedback is welcome! If you have ideas for new features or for improving existing features, let me know by creating an issue.

Twitter

To stay up-to-date on Wyre, consider following me on Twitter.

License

MIT

wyre's People

Contributors

nickmqb avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.