randomaize()の威力をグラフにしてみる

イメージ 1

randomaize()てそんなに便利??と思ったので数値化しグラフにしてみた。
回路はお手軽にcase文で作成、順番による調停回路20bit(ラウンドロビン)ただしクロック毎に調停する RTLは下記参照

// --- arbitr -> round robin ---
always @(posedge clk, negedge rst_n) begin
if(rst_n == 1'b0)
roundGnt <= 2'h0 ;
else begin
case (roundGnt)
5'h00 : if(req[0] == 1'b1)
roundGnt <= 5'h01 ;
else
roundGnt <= roundGnt ;
5'h01 : if(req[1] == 1'b1)
roundGnt <= 5'h02 ;
else
roundGnt <= roundGnt ;
..............
..............
5'h13 : if(req[19] == 1'b1)
roundGnt <= 5'h14 ;
else
roundGnt <= roundGnt ;
5'h14 : roundGnt <= 5'h00 ;
// coverage off
default : roundGnt <= roundGnt ;
// coverage on
endcase
end
end
assign gnt = decode(roundGnt) ;

 カバレッジ値の変化を見たいだけなのでアサーションはovlのassert_zero_one_hotのみ付けといた。

 結果は冒頭のグラフにあるとおりrandomパターンを80個生成でカバレッジ100%達成。結構収束が速い。。回路の性格で??
 次はもう少し現実的な物でためしてみるか、
   2次元配列対応のDMAC回路ならパターンは簡単だけど結構面倒くさい。
   これ行ってみようか。。アサーションをもう少しまともにしてみる。
本日はここまで。