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

Bundle literal constructors #418

Closed
ducky64 opened this issue Dec 16, 2016 · 1 comment
Closed

Bundle literal constructors #418

ducky64 opened this issue Dec 16, 2016 · 1 comment
Assignees
Labels
Feature New feature, will be included in release notes
Milestone

Comments

@ducky64
Copy link
Contributor

ducky64 commented Dec 16, 2016

This has been worked around in many ways, from assigning all the parts separately, to manually writing functions that can be invoked in one line but do the assignments inside, to compile-time-unsafe Maps. Theoretically, it should be possible to use macros to generate a companion object that constructs a bundle literal.

For example, if I have

@bundle
class MyBundle extends Bundle {
  val a = Bool()
  val b = UInt(8.W)
}

I want to be able to do

wire := MyBundle(a=true.B, b=0x42.U)

(ideally, like above, it would require a full set of keyword arguments, though how to accomplish this is uncertain...)

Also, if something could be done that addresses #417, this would be super useful in a testing context since it would not require the compile-time-unsafe string maps.

@ducky64 ducky64 self-assigned this Apr 18, 2017
@edwardcwang edwardcwang added the Feature New feature, will be included in release notes label Nov 8, 2017
@edwardcwang edwardcwang added this to the 3.1.0 milestone Nov 8, 2017
@ducky64 ducky64 modified the milestones: 3.1.0, 3.2.0 Dec 13, 2017
@ducky64 ducky64 mentioned this issue Feb 14, 2018
9 tasks
@ducky64
Copy link
Contributor Author

ducky64 commented Apr 13, 2018

Superseded by #805

@ducky64 ducky64 closed this as completed Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature, will be included in release notes
Projects
None yet
Development

No branches or pull requests

2 participants