Skip to content

[HW] Make hw::getBitwidth use an TypeInterface? #9269

@teqdruid

Description

@teqdruid

Should we make a StaticallyComputableWidth Type interface and get hw::getBitWidth to use it? Or potentially replace it?

The use case here is one might have a hw.struct with a field which is not a hw type. (As I do with ESI's Window type.) At a minimum, hw.bitcast compares the two bitwidths. While said field would not be able to be lowered directly to SystemVerilog though it may get lowered of removed by a later pass.

IIRC we've always said that the HW dialect should be as open as possible, this is something which isn't terribly open. I seem to recall having this discussion in the past...

What do people think?

Metadata

Metadata

Assignees

Labels

HWInvolving the `hw` dialect

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions