riscv-software-src / riscv-isac

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decrease coverage calculation time

pawks opened this issue · comments

Summary

Coverage computation in ISAC is an iterative process where all coverpoints are evaluated for every instruction. This causes an exponential increase in coverage computation time as the number of coverpoints increases. The following strategies may be used to decrease the time taken to measure coverage.

  • Removing hit coverpoints from the working-cgf - For architectural testing, it is enough if a coverpoint is hit just once and has an impact on the signature. To leverage this, coverpoints can be dropped once hit to avoid evaluating it for all the subsequent instructions. A CLI option should be added to enable/disable this strategy.

  • Launching multiple parallel threads to collect coverage parallelly - Coverage computation is an embarrassingly parallel workload. The set of available coverpoints can be partitioned across multiple sets and each set can be evaluated in parallel to reduce total time taken. A cli option may be added to make the number of parallel threads lauched configurable. Both strategies can be combined together to reduce coverage calculation time further.

Instead of decoding every instruction from the trace file, isn't it better to generate the instruction(s) or instruction format from the .cgf file and then compare it with the trace file? In doing so, it simply becomes an integer comparison rather than a string comparison. Maybe that can speedup things a little especially when the trace file is long.

EDIT: That's only useful when a converpoint describes a fully defined instruction (i.e. a coverpoint defining opcode, function, rs1, rs2, rd or imm) as RISC-V instruction set format do not have a definite pattern.

The coverpoints are defined on the fields of the instruction and a single coverpoint does not span across all the fields. This will cause a lot of don't cares in non-contiguous bit positions and complicates the match function significantly.

The coverpoints are defined on the fields of the instruction and a single coverpoint does not span across all the fields. This will cause a lot of don't cares in non-contiguous bit positions and complicates the match function significantly.

True! I overlooked that at first glance.

Can;t this be done with a masked compare?