ThinkOpenly / sail-riscv

Sail RISC-V model
Other
9 stars 11 forks source link

[JSON] extract dependent functions #17

Closed ThinkOpenly closed 1 month ago

ThinkOpenly commented 3 months ago

Some functions (function clause execute) call other functions (function).

Currently the latter function definitions are not extracted.

These should be extracted for completeness. These should also be emitted in JSON, possibly as an independent top-level entity containing an array of these type of functions.

Example from model/riscv_insts_vext_mem.sail:


function process_vlxseg (nf, vm, vd, EEW_index_bytes, EEW_data_bytes, EMUL_index_pow, EMUL_data_pow, rs1, vs2, num_elem, mop) = {
[...]
}
[...]
function clause execute(VLUXSEGTYPE(nf, vm, vs2, rs1, width, vd)) = {
[...]
  process_vlxseg(nf_int, vm, vd, EEW_index_bytes, EEW_data_bytes, EMUL_index_pow, EMUL_data_pow, rs1, vs2, num_elem, 1)
}
snapdgn commented 3 months ago

Looking into this!