Add support for array-typed parameters to VAST.#3685
Add support for array-typed parameters to VAST.#3685meheff wants to merge 2 commits intogoogle:mainfrom
Conversation
These were representable but were unusable because they could not be converted to a IndexableExpression. Also add this capability to the C API.
xls/codegen/vast/vast_test.cc
Outdated
|
|
||
| EXPECT_EQ(m->Emit(nullptr), | ||
| R"(module top; | ||
| parameter P0[2] = '{'0, '0}; |
There was a problem hiding this comment.
I don't believe it's valid SystemVerilog to have an unpacked param without an explicit data type. Similar below.
There was a problem hiding this comment.
Thanks for the review. Sorry I missed it earlier.
There is not a specific example of this construct in the spec, but the grammar production rules allow it (6.20.1) and it doesn't appear to be explicitly disallowed. There is some discussion about aggregate constants at the end of 6.20.2 where such an exception seemingly would be made. I assume it behaves just as an array of the implicit data type (32-bit signed logic in SV).
There was a problem hiding this comment.
Both Verific and VCS report syntax errors in this case. E.g.
Error-[SE] Syntax error
Following verilog source has syntax error :
...
token is '='
parameter P0[2] = '{'0, '0};
There was a problem hiding this comment.
Sounds good. I removed them from the tests. I didn't add a check as checking is awkward as it would require deep inspection of the datatype and VAST generally does not do extensive checking of the AST for legality, just trivial checks.
These were representable but were unusable because they could not be converted to a IndexableExpression. Also add this capability to the C API.
6ed274b to
4152ca1
Compare
|
On import, we're seeing unused variable warnings (which we treat as errors): Mind fixing this, or should we do it at point-of-import? |
These were representable but were unusable because they could not be converted to a IndexableExpression. Also add unpacked array parameters and array assignment to the C API.