我在我的一个测试中有以下run_phase任务:
//run_phase
task run_phase(uvm_phase phase);
tx_big_sml_diff_sequence tx_seq_i;
axi_config_reg_sequence axi_seq_i;
phase.raise_objection(.obj(this));
for (int i = 2; i <= 9; i++) begin
tx_seq_i = tx_big_sml_diff_sequence::type_id::create(.name("tx_seq_i"), .contxt(get_full_name()));
axi_seq_i = axi_config_reg_sequence::type_id::create(.name("axi_seq_i"), .contxt(get_full_name()));
axi_seq_i.transfers[0] = i;
axi_seq_i.addr = `TX_FE_LIN_INT_ADDR;
fork
begin
tx_seq_i.start(grb_env_i.tx_lin_int_agent_i.tx_lin_int_sequencer);
end
begin
axi_seq_i.start(grb_env_i.axi_agent_i.axi_sequencer);
end
join
end
phase.drop_objection(.obj(this));
super.run_phase(phase);
endtask // run_phase
其中axi_config_reg_sequence是负责配置特定reg的序列(根据给定的地址)。
我想在TX_FE_LIN_INT_ADDR旁边配置另一个reg,如何为另一个配置使用相同的序列?
答案 0 :(得分:0)
您没有提供有关axi_config_reg_sequence
实现的任何详细信息,因此我将假设addr
变量自动负责在该特定地址配置寄存器。如果是这种情况,您可以再次实例化相同的序列,然后在同一个序列器上启动它,如下所示:
tx_seq_i = tx_big_sml_diff_sequence::type_id::create(.name("tx_seq_i"), .contxt(get_full_name()));
axi_seq1_i = axi_config_reg_sequence::type_id::create(.name("axi_seq1_i"), .contxt(get_full_name()));
axi_seq2_i = axi_config_reg_sequence::type_id::create(.name("axi_seq2_i"), .contxt(get_full_name()));
axi_seq1_i.transfers[0] = i;
axi_seq1_i.addr = `TX_FE_LIN_INT_ADDR;
axi_seq2_i.transfers[0] = `SET_THIS_VARIABLE_AS_NEEDED;
axi_seq2_i.addr = `YOUR_OTHER_ADDRESS_GOES_HERE;
fork
begin
tx_seq_i.start(grb_env_i.tx_lin_int_agent_i.tx_lin_int_sequencer);
end
begin
axi_seq1_i.start(grb_env_i.axi_agent_i.axi_sequencer);
axi_seq2_i.start(grb_env_i.axi_agent_i.axi_sequencer);
end
join