Vengineerの妄想(準備期間)

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

VMMで、namespace ?


namespaceといえば、C++だと思っています。
今回紹介するブログ:The right name at the right space: using ‘namespace’ in VMM to set virtual interfacesでは、VMMでのnamespaceについて書かれています。
でも、VMMにnamespaceってあったかな?

どうも、ポイントはクラスを生成するときの引数(パラメータ)にラベルを付けて、
namespaceを作っている
    initial begin
        // Create the interface wrapper in the testbench top 
        // with DUTIF as the namespace
        dut_if_port#(virtual dut_if) dut_if_port = new("DUTIF::intf", intf);
    end
DUTIF::intfnamespaceを付けます。

そして、参照するところでは、
    // get interface wrapper from the DUTIF name space and set the interface in the transactor
    obj = vmm_object::find_object_by_name("DUTIF::intf");
    $cast(intf,obf);
    drv.connect_tif(intf.vitf);
のように、find_object_by_nameの引数に先ほど付けたnamespaceにて
オブジェクトを見つけるということになります。

皆さん、いかがでしょうか?

検証、Verification、VMM