URL
https://opencores.org/ocsvn/uart2bus_testbench/uart2bus_testbench/trunk
Subversion Repositories uart2bus_testbench
[/] [uart2bus_testbench/] [trunk/] [tb/] [test/] [uart_test.svh] - Rev 2
Go to most recent revision | Compare with Previous | Blame | View Log
//-----------------------------------------------------------------------------
//
// UART2BUS VERIFICATION
//
//-----------------------------------------------------------------------------
// CREATOR : HANY SALAH
// PROJECT : UART2BUS UVM TEST BENCH
// UNIT : TEST
//-----------------------------------------------------------------------------
// TITLE : UART TEST
// DESCRIPTION: This
//-----------------------------------------------------------------------------
// LOG DETAILS
//-------------
// VERSION NAME DATE DESCRIPTION
// 1 HANY SALAH 10012016 FILE CREATION
//-----------------------------------------------------------------------------
// ALL COPYRIGHTS ARE RESERVED FOR THE PRODUCER ONLY .THIS FILE IS PRODUCED FOR
// OPENCORES MEMBERS ONLY AND IT IS PROHIBTED TO USE THIS MATERIAL WITHOUT THE
// CREATOR'S PERMISSION
//-----------------------------------------------------------------------------
class uart_base_test extends uvm_test;
uart_env env;
uvm_table_printer printer;
uart_config _config;
`uvm_component_utils(uart_base_test)
function new (string name,uvm_component parent);
super.new(name,parent);
endfunction:new
function void build_phase (uvm_phase phase);
super.build_phase(phase);
env = uart_env::type_id::create("env",this);
_config = uart_config::type_id::create("_config",this);
uvm_config_db#(uart_config)::set(this,"*","UART_CONFIGURATION",_config);
printer = new();
printer.knobs.depth = 3;
endfunction:build_phase
function void connect_phase (uvm_phase phase);
super.connect_phase(phase);
endfunction:connect_phase
function void end_of_elaboration_phase (uvm_phase phase);
super.end_of_elaboration_phase(phase);
_config._edge = pos_edge;
_config._start = lsb;
_config._datamode = ascii;
_config.num_stop_bits = 1;
_config.num_of_bits = 8;
_config._paritymode = parity_off;
_config.response_time = 10000;
endfunction:end_of_elaboration_phase
task run_phase (uvm_phase phase);
phase.phase_done.set_drain_time(this,5000);
endtask:run_phase
endclass:uart_base_test
class write_text_mode extends uart_base_test;
seq_1p1 seq1;
seq_1p2 seq2;
seq_1p3 seq3;
seq_1p4 seq4;
seq_1p5 seq5;
seq_1p6 seq6;
seq_1p7 seq7;
seq_1p8 seq8;
seq_1p9 seq9;
seq_1p10 seq10;
seq_1p11 seq11;
`uvm_component_utils(write_text_mode)
function new (string name,uvm_component parent);
super.new(name,parent);
endfunction:new
function void build_phase (uvm_phase phase);
super.build_phase (phase);
seq1 = seq_1p1::type_id::create("seq1");
seq2 = seq_1p2::type_id::create("seq2");
seq3 = seq_1p3::type_id::create("seq3");
seq4 = seq_1p4::type_id::create("seq4");
seq5 = seq_1p5::type_id::create("seq5");
seq6 = seq_1p6::type_id::create("seq6");
seq7 = seq_1p7::type_id::create("seq7");
seq8 = seq_1p8::type_id::create("seq8");
seq9 = seq_1p9::type_id::create("seq9");
seq10 = seq_1p10::type_id::create("seq10");
seq11 = seq_1p11::type_id::create("seq11");
endfunction:build_phase
task run_phase (uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
seq1.start(env.agent._seq,null);
seq2.start(env.agent._seq,null);
seq3.start(env.agent._seq,null);
seq4.start(env.agent._seq,null);
seq5.start(env.agent._seq,null);
seq6.start(env.agent._seq,null);
seq7.start(env.agent._seq,null);
seq8.start(env.agent._seq,null);
seq9.start(env.agent._seq,null);
seq10.start(env.agent._seq,null);
seq11.start(env.agent._seq,null);
phase.drop_objection(this);
endtask:run_phase
endclass:write_text_mode
class read_text_mode extends uart_base_test;
seq_2p1 seq1;
seq_2p2 seq2;
seq_2p3 seq3;
seq_2p4 seq4;
seq_2p5 seq5;
seq_2p6 seq6;
seq_2p7 seq7;
seq_2p8 seq8;
seq_2p9 seq9;
seq_2p10 seq10;
seq_2p11 seq11;
`uvm_component_utils(read_text_mode)
function new (string name,uvm_component parent);
super.new(name,parent);
endfunction:new
function void build_phase (uvm_phase phase);
super.build_phase(phase);
seq1 = seq_2p1::type_id::create("seq1");
seq2 = seq_2p2::type_id::create("seq2");
seq3 = seq_2p3::type_id::create("seq3");
seq4 = seq_2p4::type_id::create("seq4");
seq5 = seq_2p5::type_id::create("seq5");
seq6 = seq_2p6::type_id::create("seq6");
seq7 = seq_2p7::type_id::create("seq7");
seq8 = seq_2p8::type_id::create("seq8");
seq9 = seq_2p9::type_id::create("seq9");
seq10 = seq_2p10::type_id::create("seq10");
seq11 = seq_2p11::type_id::create("seq11");
endfunction:build_phase
task run_phase (uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
seq1.start(env.agent._seq,null);
seq2.start(env.agent._seq,null);
seq3.start(env.agent._seq,null);
seq4.start(env.agent._seq,null);
seq5.start(env.agent._seq,null);
seq6.start(env.agent._seq,null);
seq7.start(env.agent._seq,null);
seq8.start(env.agent._seq,null);
seq9.start(env.agent._seq,null);
seq10.start(env.agent._seq,null);
seq11.start(env.agent._seq,null);
phase.drop_objection(this);
endtask:run_phase
endclass:read_text_mode
class nop_command_mode extends uart_base_test;
seq_3p1 seq1;
//seq_3p2 seq2;
seq_3p3 seq3;
seq_4p1 seq4;
//seq_4p2 seq5;
seq_4p3 seq6;
`uvm_component_utils(nop_command_mode)
function new (string name,uvm_component parent);
super.new(name,parent);
endfunction:new
function void build_phase (uvm_phase phase);
super.build_phase(phase);
seq1 = seq_3p1::type_id::create("seq1");
//seq2 = seq_3p2::type_id::create("seq2");
seq3 = seq_3p3::type_id::create("seq3");
seq4 = seq_4p1::type_id::create("seq4");
//seq5 = seq_4p2::type_id::create("seq5");
seq6 = seq_4p3::type_id::create("seq6");
endfunction:build_phase
task run_phase(uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
seq1.start(env.agent._seq,null);
//seq2.start(env.agent._seq,null);
seq3.start(env.agent._seq,null);
seq4.start(env.agent._seq,null);
//seq5.start(env.agent._seq,null);
seq6.start(env.agent._seq,null);
phase.drop_objection(this);
endtask:run_phase
endclass:nop_command_mode
class write_command_mode extends uart_base_test;
seq_5p1 seq1;
seq_5p2 seq2;
seq_5p3 seq3;
seq_5p4 seq4;
seq_5p5 seq5;
seq_5p6 seq6;
seq_5p7 seq7;
seq_5p8 seq8;
seq_5p9 seq9;
seq_5p10 seq10;
`uvm_component_utils(write_command_mode)
function new (string name,uvm_component parent);
super.new(name,parent);
endfunction:new
function void build_phase (uvm_phase phase);
super.build_phase(phase);
seq1 = seq_5p1::type_id::create("seq1");
seq2 = seq_5p2::type_id::create("seq2");
seq3 = seq_5p3::type_id::create("seq3");
seq4 = seq_5p4::type_id::create("seq4");
seq5 = seq_5p5::type_id::create("seq5");
seq6 = seq_5p6::type_id::create("seq6");
seq7 = seq_5p7::type_id::create("seq7");
seq8 = seq_5p8::type_id::create("seq8");
seq9 = seq_5p9::type_id::create("seq9");
seq10 = seq_5p10::type_id::create("seq10");
endfunction:build_phase
task run_phase (uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
uvm_test_done.set_drain_time(this,5000);
seq1.start(env.agent._seq,null);
seq2.start(env.agent._seq,null);
seq3.start(env.agent._seq,null);
seq4.start(env.agent._seq,null);
seq5.start(env.agent._seq,null);
seq6.start(env.agent._seq,null);
seq7.start(env.agent._seq,null);
seq8.start(env.agent._seq,null);
seq9.start(env.agent._seq,null);
seq10.start(env.agent._seq,null);
phase.drop_objection(this);
endtask:run_phase
endclass: write_command_mode
class read_command_mode extends uart_base_test;
seq_6p1 seq1;
seq_6p2 seq2;
seq_6p3 seq3;
seq_6p4 seq4;
seq_6p5 seq5;
seq_6p6 seq6;
seq_6p7 seq7;
seq_6p8 seq8;
seq_6p9 seq9;
seq_6p10 seq10;
`uvm_component_utils(read_command_mode)
function new (string name,uvm_component parent);
super.new(name,parent);
seq1 = seq_6p1::type_id::create("seq1");
seq2 = seq_6p2::type_id::create("seq2");
seq3 = seq_6p3::type_id::create("seq3");
seq4 = seq_6p4::type_id::create("seq4");
seq5 = seq_6p5::type_id::create("seq5");
seq6 = seq_6p6::type_id::create("seq6");
seq7 = seq_6p7::type_id::create("seq7");
seq8 = seq_6p8::type_id::create("seq8");
seq9 = seq_6p9::type_id::create("seq9");
seq10 = seq_6p10::type_id::create("seq10");
endfunction:new
function void build_phase (uvm_phase phase);
super.build_phase(phase);
endfunction:build_phase
task run_phase (uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
seq1.start(env.agent._seq,null);
seq2.start(env.agent._seq,null);
seq3.start(env.agent._seq,null);
seq4.start(env.agent._seq,null);
seq5.start(env.agent._seq,null);
seq6.start(env.agent._seq,null);
seq7.start(env.agent._seq,null);
seq8.start(env.agent._seq,null);
seq9.start(env.agent._seq,null);
seq10.start(env.agent._seq,null);
phase.drop_objection(this);
endtask:run_phase
endclass:read_command_mode
Go to most recent revision | Compare with Previous | Blame | View Log