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 ability to include inline verilog #30

Merged
merged 2 commits into from
Dec 20, 2019
Merged

Conversation

leonardt
Copy link
Owner

Adds a node that serializes to it's value, which allows the passing of inline verilog through the compiler. This will enable the use of inline verilog in magma (ala pragma asm). For now magma (or fault rather) will be responsible for interpolating the verilog name in the inline verilog (e.g. referring to a tuple field will need to be mapped to the verilog name). We can work on more robust/extensible ways to handle this in the future.

@@ -319,6 +319,15 @@ class BlockComment : public StructuralStatement, public BehavioralStatement {
~BlockComment(){};
};

class InlineVerilog : public StructuralStatement, public BehavioralStatement {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any expectation/constraints on what value can correspond to? Like if I pass in an entire module declaration is that valid? Or only "body" stuff? Presumably this can't checked but it should be documented.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I don't think we can validate the contents, but in terms of rules:

It can be used inside the body of a module definition, so any valid statement or collection of statements is valid. Technically it can also be used inside any always block, but that won't really matter for our current use case (since we'll just be using this to allow inline verilog like assertions inside a magma definition), later on we could also support inline expressions, but again I don't think that would be used in the current intended flow. For now, I'll change it to just Structural statement and document the intended use case.

@leonardt leonardt merged commit 9becbee into master Dec 20, 2019
@leonardt leonardt deleted the inline-verilog-node branch December 20, 2019 01:14
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