JSON output does not distinguish between case, casex, and casez statements
I'm developing a parser based on Verilator's JSON output and noticed that the generated JSON does not differentiate between case, casex, and casez statements (All display with "type":"CASE").
Environment: Verilator version: 5.029 devel rev v5.028-36-g201e34379
Example Code:
// file: casez_example.v
module casez_example (
input [1:0] sel,
input [7:0] a,
input [7:0] b,
output reg [7:0] y
);
always @(*) begin
casez (sel)
2'b1?: y = a; // sel = 10, 11, 1x, 1z
default: y = b;
endcase
end
endmodule
Example Json:
"stmtsp": [
{"type":"CASE","name":"","addr":"(N)","loc":"d,9:9,9:14",
"exprp": [
{"type":"VARREF","name":"sel","addr":"(O)","loc":"d,9:16,9:19","dtypep":"(G)","access":"RD","varp":"(F)","varScopep":"UNLINKED","classOrPackagep":"UNLINKED"}
],
Might you make a pull to fix this? I suspect there will be others you will need.
Add a AstCase::dumpJson and AstCase::dump methods that print the m_casex->ascii() identifier, you can see examples in other dump methods. You'll then need to update the tests by running with --gold.
Sure, let me check.
Fix comment above was intended to refer to #6773.