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

Add support for directives #63

Open
joaovam opened this issue Jan 8, 2025 · 0 comments
Open

Add support for directives #63

joaovam opened this issue Jan 8, 2025 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@joaovam
Copy link
Collaborator

joaovam commented Jan 8, 2025

ChiBench only support modules, in the sense that every directive generated is erased from the final program. We should add the support for directive flags, for example:

  • ifdef
  • ifndef
  • endif

The simpler solution would be to generate two programs, let's call them A and B.

The final program generated would be:

//This define should be randomized, for some programs we should follow the if branch, for others the else branch
`define B1

`ifdef B1
A
`else
B
`endif

This solution would cover only straightforward define cases, in real programs these directives are used with much more granularity, for example, inside functions, modules between statements, and so on.

@joaovam joaovam added the help wanted Extra attention is needed label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant