Vengineerの妄想

人生は短いけど、長いです。人生を楽しみましょう!

Bluespec SystemVerilog : StmtFSMパッケージ(その3)

Verification Engineerの戯言

リファレンス・ガイドのP.255の例題( Defining and instantiating a state machine )のStmt部分を見ていきましょう。

    Stmt driversMonitors =
      (seq
        // Clear the fifo
        dut.clear;

        // Two secuential blocks running in parallel
        par
          // Enque 2 times the Fifo Depth
          for(i = 1; i < = 10; i = i + 1)
          seq
            dut.enq({0,i});
            $display(" Enque %d", i);
          endseq

          // Wait until the fifo is full and then deque

          seq
            while (i < 5)
            seq
              noAction;
            endseq
            while (i <= 10)
            action
              dut.deq;
              $display("Value read %d", dut.first);
            endaction
          endseq

       endpar

       $finish(0);
     endseq);

seqendseqで囲まれた部分は逐次動作になります。
また、parendparで囲まれた部分は並列動作になります。

driversMonitorsステートメントは、seqendseqで囲まれた
    1)、dut.clear
  2)、parとendparで囲まれた部分
  3)、$finish(0)
の順に実行されます。

2)のparendparで囲まれた2つのseqendseqが並列に実行されます。

検証、Verification、Bluespec SystemVerilog

P.S
今日で1ヶ月に及ぶBluespec SystemVerilogを学ぶを終了します。