ThinkOpenly / sail-riscv

Sail RISC-V model
Other
12 stars 15 forks source link

[JSON] extract dependent functions #17

Closed ThinkOpenly closed 6 months ago

ThinkOpenly commented 8 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 8 months ago

Looking into this!