chipsalliance / chipsalliance/chisel

Absorb rocket.DecodeLogic into Standard Library

Open
#1,187 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
4.8k
Forks
658
Avg merge
18h 59m
Merged PRs (30d)
14

Description

tl;dr: Proposal to migrate Rocket Chip Decode Quine--McKluskey algorithm into Chisel3 standard library.

**Type of issue**: feature request

**Impact**: API addition (no impact on existing code)

**Development Phase**: proposal

**Other information**

**What is the current behavior?**

Users wanting to build a microprocessor need to build a decoder. However, because Chisel and FIRRTL have no notion of actual "don't cares" and/or the ability to emit `casex`, this cannot be pushed to the synthesis tool to properly optimize.

Rocket solves this with a [Quine-McKluskey](https://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algorithm) implementation inside [`freechips.rocketchip.rocket.DecodeLogic`](https://github.com/chipsalliance/rocket-chip/blob/d42b521df4596bd6425b675794a06da08991eea0/src/main/scala/rocket/Decode.scala). This is great, but it requires either code replication or pulling in Rocket Chip for a feature which is, arguably, something that is common to hardware designs and not Rocket designs.

**What is the expected behavior?**

The standard library (or some other library, e.g,. `chisel3.optimization`) should expose this API and not Rocket.

**What is the use case for changing the behavior?**

Moving this and adding documentation would enable users to do QM optimizations for building decoders without having to pull in Rocket.

Any API modifications as a result of the migration would preserve backwards compatibility with Rocket Chip usage. (I don't know yet if these would be needed or warranted. Likely not.)

**Feedback Requested**

I'd like feedback from @aswaterman on this.

**Notes**

Espresso implementations:
- https://github.com/classabbyamp/espresso-logic

Contributor guide

Open the contributing guide

Research direction

Start with rocket-chip's src/main/scala/rocket/Decode.scala and the existing DecodeLogic implementation, then review the issue discussion and Chisel's standard-library structure. Define the public API and documentation needed for Quine–McKluskey decoder optimization, while checking that Rocket Chip usage remains backwards compatible.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.