Skip to content

[enhancement] parametric support for type aliases #3472

@proppy

Description

@proppy

What's hard to do? (limit 100 words)

Currently you can really do things like:

type Index<N: u32> = uN[std::clog2(u32) + u32:1];

or

struct SomeDataChunk<N: u32> {
  type Index = uN[std::clog2(u32) + u32:1],
  data: u32[N],
  index_start: Index,
  index_end: Index,
}

Current best alternative workaround (limit 100 words)

Hardcode the type or duplicate the type expression everywhere it's being used.

Your view of the "best case XLS enhancement" (limit 100 words)

Add support for arbitrary parameterized type alias in all context:

  • struct body
  • proc body
  • parametric definition

Metadata

Metadata

Assignees

No one assigned

    Labels

    dslxDSLX (domain specific language) implementation / front-endenhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions