Skip to content

[DSLX] Improve type handling in parametrics#986

Closed
mtdudek wants to merge 2 commits intogoogle:mainfrom
antmicro:Improve_ParseParametrics
Closed

[DSLX] Improve type handling in parametrics#986
mtdudek wants to merge 2 commits intogoogle:mainfrom
antmicro:Improve_ParseParametrics

Conversation

@mtdudek
Copy link
Contributor

@mtdudek mtdudek commented May 26, 2023

Some buildins like zero! did not work with
parametric structs and with arrays of structs.

ParseParametrics returns TypeAnnotation only if
token is a buildin type. In all other cases
identifiers are expected to resolve to TypeRef or
constant values.

This commit changes ParseParametrics to allow for
parametric structs and struct arrays types.
This change only extends Parser capabiliteis.

Signed-off-by: Maciej Dudek mdudek@antmicro.com

mtdudek added 2 commits May 26, 2023 18:29
This commit adds tests to improve
`zero!<>()` coverage. Some tests are disabled
(GH-google#984)

Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Some buildins like `zero!` did not work with
parametric structs and with arrays of structs.

ParseParametrics returns TypeAnnotation only if
token is a buildin type. In all other cases
identifiers are expected to resolve to TypeRef or
constant values.

This commit changes ParseParametrics to allow for
parametric structs and struct arrays types.
This change only extends Parser capabiliteis.

Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
@proppy
Copy link
Member

proppy commented Jun 13, 2023

is that ready to review? is that blocking #994?

@proppy
Copy link
Member

proppy commented Apr 3, 2024

@tmichalak can you confirm if this is still needed?

@tmichalak
Copy link

@tmichalak can you confirm if this is still needed?

So, the zero! macro is still limited and you cannot use parametric structs with it. Currently, as a workaround you need to define a type alias that renames a parametric type to a new one without explicit parameters, therefore having a more advanced zero! macro would be useful.

@proppy
Copy link
Member

proppy commented Apr 3, 2024

the zero! macro is still limited and you cannot use parametric structs with it.

is that already captured as an issue?

@tmichalak
Copy link

the zero! macro is still limited and you cannot use parametric structs with it.

is that already captured as an issue?

Yes, there is this one, but I guess that looking at the comment and workaround we might need to stick to the workaround for the time being.

@dplassgit
Copy link
Contributor

This PR has been open without change for 1 year. Can it be closed?

@dplassgit
Copy link
Contributor

Closing due to lack of activity and obsolescence.

@dplassgit dplassgit closed this Jun 16, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Antmicro XLS Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants