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

Support block_item_declaration in forks #4455

Merged
merged 11 commits into from
Sep 8, 2023

Conversation

kboronski-ant
Copy link
Member

Adds support for block_item_declaration elements in forks. (See 9.3.2 Parallel blocks in IEEE_1800-2017)

A block_item_declaration is basically a definition of a variable placed directly within a parallel block. Eg.:

fork
  int bid = 2;
join_none

It's a special kind of statement. Instead of being forked, it creates a local variable accessible to all forked processes, before they get spawned. This can be useful when forking under a loop as it allows to create a local copy of the iterated variable, for each set of processes spawned in a given iteration.

Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
@kboronski-ant kboronski-ant added area: scheduling Issue involves scheduling/ordering of events type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Sep 1, 2023
Copy link
Member

@wsnyder wsnyder left a comment

Choose a reason for hiding this comment

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

Feel free to squash merge after these minor nits.

src/V3Fork.cpp Outdated Show resolved Hide resolved
src/V3Fork.cpp Outdated Show resolved Hide resolved
src/V3Fork.cpp Outdated Show resolved Hide resolved
src/V3Fork.cpp Outdated Show resolved Hide resolved
src/verilog.y Outdated Show resolved Hide resolved
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
@kboronski-ant kboronski-ant marked this pull request as ready for review September 6, 2023 18:57
@kboronski-ant kboronski-ant merged commit 70b11f9 into verilator:master Sep 8, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: scheduling Issue involves scheduling/ordering of events type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants