Vengineerの妄想(準備期間)

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

Bluespec SystemVerilog : docアトリビュート

Verification Engineerの戯言

Bluespec SystemVerilogでは、
docアトリビュートを使うことで生成されるVerilog HDLコードに含めることができます。
docアトリビュートは、
    ・ トップレベルのモジュールの定義
    ・ サブモジュールのインスタンス
  ・ ルールの定義
  ・ ルールの式
に対して付けることができます。

    (* doc = "This is a user-provided comment" *)

  複数行のコメントにしたいときは、'''\n'''を使います。

    (* doc = "This is one line\nAnd this is another" *)

  または、複数の'''docアトリビュート'''を使うことができます。

    (* doc = "This is one line" *)
    (* doc = "And this is another" *)

  上記の記述は、つぎのようにも書けます。

    (* doc = "This is one line",
       doc = "And this is another" *)

・ モジュールの定義では、つぎのようにします。

    (* synthesize *)
    (* doc = "This is important information about the following module" *)
    module mkMod (IFC);
      ...
    endmodule

・ サブモジュールのインスタンス部では、つぎのようにします。

    (* doc = "This submodule does something" *)
    FIFO#(Bool) f();
    mkFIFO the_f(f);

    (* doc = "This submodule does something else" *)
    Server srv <- mkServer;

    Client c;
    (* doc = "This submodule does a third thing" *)
    c <- mkClient;

・ ルールの定義では、つぎのようにします。

    (* doc = "This rule is important" *)
    rule do_something (b);
      x <= !x;
    endrule


検証、Verification、Bluespec SystemVerilog