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

added basic support for parameters. #3

Closed
wants to merge 1 commit into from
Closed

Conversation

rdaly525
Copy link
Collaborator

No description provided.

@rdaly525 rdaly525 requested a review from leonardt June 18, 2019 17:56
Copy link
Owner

@leonardt leonardt left a comment

Choose a reason for hiding this comment

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

This changes the handling of parameters from being represented as key (string), value pairs in a map to being std::pairs of Parameter and Constant.

The changes seem fine, but I'm not exactly sure about the motivation, perhaps this will become more apparent when I review the subsequent PRs?

Mainly, what does having an explicit Parameter provide over having them be keys in a map?

And why use pairs versus a map? Actually, using pairs make sense when iterating for code generation since that's the common pattern (generate the key/value pairs for parameters). This sacrifices parameter lookup performance, but I don't think that will be a common use case (we're interested in building and serializing ASTs, so insertion and pair iteration are priorities), so this change seems okay to me.

So can you provide a simple reason why we need an explicit object versus representing a parameter name as a string?

@rdaly525
Copy link
Collaborator Author

Parameters can be used in the verilog code as literals. We should ideally be able to refer to the same object which is a parameter. If we keep them as strings, we would still need to add the concept of a string as a literal that can be used in expressions.

@rdaly525 rdaly525 closed this Jun 18, 2019
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.

None yet

2 participants