1

I have 4 instances of a DAI interface in my testbench. I have been running some simulations with my created environment and have had no issues with errors. However, when I attempt to bind my assertions to the interface instances, I get an error relating to setting the interface in the configuration database. The code below shows where I add the interfaces to the configuration database:

 //------------------------------------------------------------------------------------------------------
//Create instances of the interface for inputs and outputs - note these instances are the same, but they 
//are hooked up differently in the env level             
//------------------------------------------------------------------------------------------------------
//Parallel Inputs - To be used for the input drivers, agents and monitors
dai_if   #(.P_WD_DATA       (P_WD_DATA      ), 
           .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
           .P_WD_OFFSET     (P_WD_OFFSET    ),
           .P_WD_CH_NUM     (P_WD_CH_NUM    ),
           .P_WD_FMT        (P_WD_FMT       ),
           .P_WD_WL         (P_WD_WL        )
            ) 
            dai_par_ivif();

//Serial Inputs - To be used for the input drivers, agents and monitors
dai_if   #(.P_WD_DATA       (P_WD_DATA      ), 
           .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
           .P_WD_OFFSET     (P_WD_OFFSET    ),
           .P_WD_CH_NUM     (P_WD_CH_NUM    ),
           .P_WD_FMT        (P_WD_FMT       ),
           .P_WD_WL         (P_WD_WL        )
            ) 
            dai_ser_ivif();

//Parallel Outputs - To be used for the output monitors and agents
dai_if   #(.P_WD_DATA       (P_WD_DATA      ), 
           .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
           .P_WD_OFFSET     (P_WD_OFFSET    ),
           .P_WD_CH_NUM     (P_WD_CH_NUM    ),
           .P_WD_FMT        (P_WD_FMT       ),
           .P_WD_WL         (P_WD_WL        )
            ) 
            dai_par_ovif();

//Serial Outputs - To be used for the output monitors and agents
dai_if   #(.P_WD_DATA       (P_WD_DATA      ), 
           .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
           .P_WD_OFFSET     (P_WD_OFFSET    ),
           .P_WD_CH_NUM     (P_WD_CH_NUM    ),
           .P_WD_FMT        (P_WD_FMT       ),
           .P_WD_WL         (P_WD_WL        )
            ) 
            dai_ser_ovif();



//------------------------------------------------------------------------------------------------------
//Set interfaces in the database with specific hierachical paths.
//------------------------------------------------------------------------------------------------------
initial begin

    //------------------------------------------------------------------------------------------------------
    //Set these unrequired signals to their default values.
    //------------------------------------------------------------------------------------------------------
    dft_latch_clk       = 1'b1;
    dft_latch_rst_an    = 1'b1;
    scan_mode           = 1'b0;
    scan_enable         = 1'b0;

    uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_in[0]*",  "dai_vif", dai_ser_ivif);
    uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_in[1]*",  "dai_vif", dai_par_ivif);
    uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_out[0]*", "dai_vif", dai_par_ovif);
    uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_out[1]*", "dai_vif", dai_ser_ovif);

    //Scoreboard interface uses the one which drives the clock
    uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_sb[0]*", "dai_vif", dai_ser_ivif);
    uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_sb[1]*", "dai_vif", dai_ser_ivif);

    //Print top level topology
    uvm_top.print();

    //Run specific test using command line switch addition (+UVM_TESTNAME=test_name)
    run_test();

end

I bind the interface assertions prior to endmodule in the top level module as shown below:

bind  dai_if :dai_ser_ivif      dai_ser_in_checkers   #(.P_WD_DATA      (P_WD_DATA      ),    
                                                       .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
                                                       .P_WD_OFFSET     (P_WD_OFFSET    ),
                                                       .P_WD_CH_NUM     (P_WD_CH_NUM    ),
                                                       .P_WD_FMT        (P_WD_FMT       ),
                                                       .P_WD_WL         (P_WD_WL        )) ast_dai_ser_in_checkers (bclk, wclk, rst_an, wclk_period, bclk_period,
                                                                                                                    serial_data, sdatout_oe, frame_sync, active_clk, 
                                                                                                                    active_dai, tdm_en, bclk_pol, wclk_pol, dai_en,
                                                                                                                    tdm_ch_en, ch_num, format, offset, wl, parallel_data);

bind  dai_if :dai_ser_ovif      dai_ser_out_checkers  #(.P_WD_DATA      (P_WD_DATA      ),    
                                                       .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
                                                       .P_WD_OFFSET     (P_WD_OFFSET    ),
                                                       .P_WD_CH_NUM     (P_WD_CH_NUM    ),
                                                       .P_WD_FMT        (P_WD_FMT       ),
                                                       .P_WD_WL         (P_WD_WL        )) ast_dai_ser_out_checkers (bclk, wclk, rst_an, wclk_period, bclk_period,
                                                                                                                    serial_data, sdatout_oe, frame_sync, active_clk, 
                                                                                                                    active_dai, tdm_en, bclk_pol, wclk_pol, dai_en,
                                                                                                                    tdm_ch_en, ch_num, format, offset, wl, parallel_data);

bind  dai_if :dai_par_ivif      dai_par_in_checkers   #(.P_WD_DATA      (P_WD_DATA      ),    
                                                       .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
                                                       .P_WD_OFFSET     (P_WD_OFFSET    ),
                                                       .P_WD_CH_NUM     (P_WD_CH_NUM    ),
                                                       .P_WD_FMT        (P_WD_FMT       ),
                                                       .P_WD_WL         (P_WD_WL        )) ast_dai_par_in_checkers (bclk, wclk, rst_an, wclk_period, bclk_period,
                                                                                                                    serial_data, sdatout_oe, frame_sync, active_clk, 
                                                                                                                    active_dai, tdm_en, bclk_pol, wclk_pol, dai_en,
                                                                                                                    tdm_ch_en, ch_num, format, offset, wl, parallel_data);

bind  dai_if :dai_par_ovif      dai_par_out_checkers  #(.P_WD_DATA      (P_WD_DATA      ),    
                                                       .P_CH_NUM_MAX    (P_CH_NUM_MAX   ),
                                                       .P_WD_OFFSET     (P_WD_OFFSET    ),
                                                       .P_WD_CH_NUM     (P_WD_CH_NUM    ),
                                                       .P_WD_FMT        (P_WD_FMT       ),
                                                       .P_WD_WL         (P_WD_WL        )) ast_dai_par_out_checkers (bclk, wclk, rst_an, wclk_period, bclk_period,
                                                                                                                    serial_data, sdatout_oe, frame_sync, active_clk, 
                                                                                                                    active_dai, tdm_en, bclk_pol, wclk_pol, dai_en,
                                                                                                                    tdm_ch_en, ch_num, format, offset, wl, parallel_data);

`

The error I receive from this points to the lines where I set the interfaces in the configuration database as shown below:

uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_in[0]*",  "dai_vif", dai_ser_ivif);
                                                                                                       |
ncelab: *E,TYCMPAT (/.../dai_top.sv,178|122): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'virtual interface dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2))' but found an incompatible 'dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2)) instance' instead).
        uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_in[1]*",  "dai_vif", dai_par_ivif);
                                                                                                               |
ncelab: *E,TYCMPAT (/.../dai_top.sv,179|122): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'virtual interface dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2))' but found an incompatible 'dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2)) instance' instead).
        uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_out[0]*", "dai_vif", dai_par_ovif);
                                                                                                               |
ncelab: *E,TYCMPAT (/.../dai_top.sv,180|122): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'virtual interface dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2))' but found an incompatible 'dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2)) instance' instead).
        uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_sb[0]*", "dai_vif", dai_ser_ivif);
                                                                                                           |
ncelab: *E,TYCMPAT (/.../dai_top.sv,184|118): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'virtual interface dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2))' but found an incompatible 'dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2)) instance' instead).
        uvm_config_db#(virtual dai_if)::set(uvm_root::get(), "uvm_test_top.dai_env.dai_sb[1]*", "dai_vif", dai_ser_ivif);
                                                                                                           |                                                        
ncelab: *E,TYCMPAT (/.../dai_top.sv,185|118): formal and actual do not have assignment compatible data types (expecting datatype compatible with 'virtual interface dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2))' but found an incompatible 'dai_if#(.P_WD_DATA(24),.P_WD_OFFSET(11),.P_CH_NUM_MAX(8),.P_WD_CH_NUM(3),.P_WD_FMT(2),.P_WD_WL(2)) instance' instead).

I had some issues formatting the error messages. The pointer '|' should be underneath each interface instance, e.g dai_ser_ivif. If I remove the bind statements, the simulation runs fine with no similar errors to above. So I assume that this issue is related to the binding process, however, the errors seem to be complaining about the fact that i'm setting a virtual interface in the configuration database with an interface (not a virtual interface)?

Any suggestions or pointers are greatly apprecited.

Thanks.

Greg
  • 18,111
  • 5
  • 46
  • 68
Robert Owen
  • 37
  • 1
  • 7
  • Sounds like a tool issue. – Tudor Timi Oct 13 '15 at 12:16
  • `nchelp ncelab TYCMPAT` doesn't provide much extra information other than telling me that the error is related to mismatching data types. As an aside, I ran a few extra tests and noticed that if I bind the same interface (e.g dai_ser_in_checkers) with the same instance name (e.g ast_dai_ser_in_checkers) for all of the four interfaces the code compiles. However, whenever, I change any of these values, I get the same error. Any thoughts on why that might be? – Robert Owen Oct 13 '15 at 13:35
  • The simulator might be uniquifying the interfaces because the bind creates different hierarchy per instance. Perhaps you can dai_ser/par_in/out_checkers into a single module and make a run-time decision which ser/par_in/out mode should be used by utilizing `uvm_re_match` or `uvm_glob_to_re` with the hierarchical path. Example: `uvm_re_match("dai_par_ivif", $sformatf("%m))` – Greg Oct 13 '15 at 18:40
  • @Greg, can you provide a bit more information regarding where in the hierarchy I should use this command? I've looked online for some examples of this usage but couldn't find anything. – Robert Owen Oct 14 '15 at 07:15

1 Answers1

0

Config db settings requires type compatibility, when you use parameterized interface, same type should be used while setting the virtual interface in config db. e.g.,

//Serial Inputs - To be used for the input drivers, agents and monitors
dai_if   #(.P_WD_DATA (P_WD_DATA)) dai_ser_ivif();

uvm_config_db#(virtual dai_if#(P_WD_DATA))::set(uvm_root::get(), "uvm_test_top.dai_env.dai_ag_in[0]*",  "dai_vif", dai_ser_ivif);
MayurKubavat
  • 341
  • 4
  • 10