Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ICE40 dialect. #8018

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add the ICE40 dialect. #8018

wants to merge 3 commits into from

Conversation

darthscsi
Copy link
Contributor

The ICE40 dialect is a synthesis target representing the Lattice ICE40 family of fpgas.

The ICE40 dialect is a synthesis target representing the Lattice ICE40 family of fpgas.
@teqdruid
Copy link
Contributor

Hobby or SiFive work?

@darthscsi
Copy link
Contributor Author

Hobby or SiFive work?

Hobby. Want to push things a bit and build on @uenoku 's synthesis work (also hobby, but hopefully I can fund it).

@darthscsi darthscsi marked this pull request as ready for review January 4, 2025 18:20
@darthscsi darthscsi mentioned this pull request Jan 5, 2025
// SBLut4Op
//===----------------------------------------------------------------------===//

LogicalResult SBLut4Op::verify() { return success(); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really exciting! One nit - is it worth verifying that lut_init has 16 elements? Or is this just a placeholder verifier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed it should check.

@KelvinChung2000
Copy link

Would it be better to do it as a generic FPGA dialect?

@teqdruid
Copy link
Contributor

teqdruid commented Jan 7, 2025

Would it be better to do it as a generic FPGA dialect?

There's no way to capture all the details of every FPGA in a set of common ops. There is something to be said for one dialect containing ops for each FPGA family, but it's easier to start separately then merge dialects if need be.

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool 😎 Blinkenlights wen?

Copy link
Contributor

@teqdruid teqdruid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!

carry_out(i0, i1, ci) = 1 iff popcount(concat(i0,i1,ci)) >= 2.
result(i0, i1, i2, i3) = lut_init[concat(i3,i2,i1,i0)].
There are constraints on the use, as i0 and i1 have to be the i0 and i1 input of a single lut.
This op doesn't check this. There is a combined op that handles that.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the combined op?

// SBLut4Op
//===----------------------------------------------------------------------===//

LogicalResult SBLut4Op::verify() { return success(); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed it should check.

// SBLut4CarryOp
//===----------------------------------------------------------------------===//

LogicalResult SBLut4CarryOp::verify() { return success(); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment re checking here.

@@ -0,0 +1,11 @@
// RUN: circt-opt %s | FileCheck %s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you add the verifier, create an error test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants