An apparatus for measuring coverage of branching paths in a microprogram being executed in logic simulation, said microprogram comprising a series of instruction steps, comprising:
- a simulation executor for executing said series of instruction steps one after another, said simulation executor producing a step completion signal and a simulation completion signal when execution of one step instruction is complete and when execution of the microprogram is completed, respectively, the series of instruction steps including one or more branching instruction steps, each of the branching instruction steps having an instruction for designating different instruction steps having destination steps and for indicating to select one of the destination steps as an instruction step to be next executed, a path of execution of instruction steps being branched into different paths at each of the branching instruction steps;
- a branch table for holding information of said branching instruction steps, said branch table being prepared to indicate the branching instruction steps in the microprogram before start of the simulation;
- a coverage table containing a path execution number for each of said branching paths, said path execution number being used to represent how many times each of said branching paths is executed during the simulation, an initial value of each path execution number being set to zero;
- first memory means coupled to said simulation executor for holding, as a current step number, one of the instruction steps currently executed by said simulation executor;
- second memory means for holding, as a latest step number, one of the instruction steps latest executed by said simulation executor;
- coverage table renewing means coupled to said simulation executor, said first and said second memory means, and said branch and said coverage tables responsive to said step completion signal from said simulation executor for detecting that a particular one of said branching paths is coincident with a path corresponding to a pair of said latest step number and said current step number by referring to said first and said second memory means and said branch and said coverage tables to renew said path execution number for the particular branching path in said coverage table, said coverage table renewing means then producing a renewal end signal;
- transferring means coupled to said first and said second memory means and said coverage table renewing means responsive to said renewal end signal for transferring said current step number from said first memory means into said second memory means as said latest step number to produce a transfer completion signal;
- simulation end deciding means coupled to said simulation executor and said transferring means responsive to said transfer completion signal for deciding an end of the simulation to produce a start signal when receiving said simulation completion signal from said simulation executor;
- and
- means coupled with said simulation end deciding means and said coverage table responsive to said start signal for accumulating said coverage from contents in said coverage table.