Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Add Bundle Literals. #929

Open
wants to merge 18 commits into
base: master-deprecated
Choose a base branch
from

Conversation

grebe
Copy link
Contributor

@grebe grebe commented Nov 1, 2018

This is an attempt to add bundle literals to firrtl. I'll make an associated chisel PR.

@grebe grebe requested a review from a team as a code owner November 1, 2018 08:59
Copy link
Contributor

@chick chick left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me but I will defer to @azidar and @jackkoenig
The Firrtl Spec should be changed with this PR I think.

@grebe grebe changed the title WIP: Add Bundle Literals. Add Bundle Literals. Jun 3, 2019
Copy link
Contributor

@azidar azidar left a comment

Choose a reason for hiding this comment

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

Overall looks fine as a first pass. A few high level requests/comments/questions:

  • Why are you naming one BundleLiteral, but the other VectorExpression? Shouldn't it be VectorLiteral?
  • Although we discussed only adding literals, I'm leaning towards adding aggregate expressions. While on the one hand, adding literals is a strict subset (and thus backwards compatible to Chisel users) and could theoretically be added first, it isn't backwards compatible with FIRRTL transform writers who may match on VectorLiteral, and then we would later remove that and add a VectorExpression. I think we need to make a decision about aggregate expressions, and if we are adding them, do it in this PR.
  • If we do add aggregate expressions, they must be able to express flipped fields. I'm personally ok this this, but others may have worries.
  • Any change to the IR must also have an update to the spec.tex (and update spec.pdf)

Thoughts?

src/main/scala/firrtl/ir/IR.scala Outdated Show resolved Hide resolved
src/main/scala/firrtl/ir/IR.scala Outdated Show resolved Hide resolved
src/test/scala/firrtlTests/MemSpec.scala Outdated Show resolved Hide resolved
@grebe
Copy link
Contributor Author

grebe commented Mar 3, 2020

I have switched to doing bundle and vector expressions. So far it seems to work fine for literals and nesting these expressions.

I'm currently not testing mixed direction bundle expressions. I'm not really sure what the desired behavior is, nor what the use-cases are (the main one that jumps to mind is assigning a decoupled bundle directly). Do mixed direction vectors make sense? I don't think so... but maybe it does. I think things should "just work™" in the sense that these are pretty thin wrappers and should be mostly equivalent to the expansion that eventually happens.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

4 participants