Test correct and incorrect type parameters from CVA6 #281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch contains a standalone set of Ariane (CVA6) System Verilog RISCV processor files to test the type parameter bug in sv2v.
sv2v/test/type_param/sv2v.sh contains the unpatched files and fails with this error:
sv2v: field 'insn' not found in struct packed {
logic x_compressed_valid;
struct packed {
logic [15:0] instr;
logic [1:0] mode;
logic [2:0] id;
} x_compressed_req;
logic x_issue_valid;
struct packed {
logic [31:0] instr;
logic [1:0] mode;
logic [2:0] id;
logic [1:0][63:0] rs;
logic [1:0] rs_valid;
} x_issue_req;
logic x_commit_valid;
struct packed {
logic [2:0] id;
logic x_commit_kill;
} x_commit;
logic x_mem_ready;
struct packed {
logic exc;
logic [5:0] exccode;
} x_mem_resp;
logic x_mem_result_valid;
struct packed {
logic [2:0] id;
logic [63:0] rdata;
logic err;
} x_mem_result;
logic x_result_ready;
}, in expression acc_req_o.insn, within scope acc_dispatcher_20306, near core/acc_dispatcher.sv:213:3
CallStack (from HasCallStack):
error, called at src/Convert/Scoper.hs:376:22 in main:Convert.Scoper
possibly because the converter tries to find struct fields in a type parameter prior to substitution.
The alternative script:
sv2v_patched/test/type_param/sv2v_corrected.sh
uses a patched core/acc_dispatcher.sv which substitutes the default type parameter value directly:
and this generates a plausible output file:
-rw-r--r-- 1 jonathan staff 7496480 23 Apr 10:50 cva6_nonsys.v
However, I don't have a suitable test bench or other methodology to add to the regression suite yet.