OpenCores
URL https://opencores.org/ocsvn/uart2bus_testbench/uart2bus_testbench/trunk

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [analysis/] [uart_scoreboard.svh] - Diff between revs 3 and 9

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 3 Rev 9
Line 38... Line 38...
 
 
        uart_transaction                        frm_drv,frm_drv_tmp;
        uart_transaction                        frm_drv,frm_drv_tmp;
 
 
        uart_transaction                        frm_mon,frm_mon_tmp;
        uart_transaction                        frm_mon,frm_mon_tmp;
 
 
        `uvm_component_utils(uart_scoreboard)
        int                                     match=0;
 
 
 
        `uvm_component_utils_begin(uart_scoreboard)
 
           `uvm_field_int(match,UVM_ALL_ON)
 
        `uvm_component_utils_end
 
 
        function new (string name , uvm_component parent);
        function new (string name , uvm_component parent);
                super.new(name,parent);
                super.new(name,parent);
        endfunction:new
        endfunction:new
 
 
Line 98... Line 102...
                                begin
                                begin
                                `uvm_error("Failed UART Undefined Command","DUT responds to undefined Prefix \n")
                                `uvm_error("Failed UART Undefined Command","DUT responds to undefined Prefix \n")
                                end
                                end
                        else
                        else
                                begin
                                begin
                                `uvm_info("Passed UART Undefined Command","DUT doesn't respond to undefined Prefix \n",UVM_NONE)
                                `uvm_info("Passed UART Undefined Command","DUT doesn't respond to undefined Prefix \n",UVM_HIGH)
 
                                   match++;
                                end
                                end
                        end
                        end
 
 
                else if (frm_drv._command inside {invalid_read,invalid_write})
                else if (frm_drv._command inside {invalid_read,invalid_write})
                        begin
                        begin
Line 110... Line 115...
                                begin
                                begin
                                `uvm_error("Failed UART Invalid Command","DUT responds to invalid binary command \n")
                                `uvm_error("Failed UART Invalid Command","DUT responds to invalid binary command \n")
                                end
                                end
                        else
                        else
                                begin
                                begin
                                `uvm_info("Passed UART Invalid Command","DUT doesn't respond to invalid binary command \n",UVM_NONE)
                                `uvm_info("Passed UART Invalid Command","DUT doesn't respond to invalid binary command \n",UVM_HIGH)
 
                                   match++;
                                end
                                end
                        end
                        end
 
 
                else
                else
                        begin
                        begin
Line 136... Line 142...
                                                                                begin
                                                                                begin
                                                                                `uvm_error("Failed Wrong Read Command","DUT responds to stimulus with wrong white space or eol charachters \n")
                                                                                `uvm_error("Failed Wrong Read Command","DUT responds to stimulus with wrong white space or eol charachters \n")
                                                                                end
                                                                                end
                                                                        else
                                                                        else
                                                                                begin
                                                                                begin
                                                                                `uvm_info("Passed Wrong Read Command",$sformatf("Dut was requested to read the data of the address %h with wrong white spaces or eol character \n",frm_mon.address),UVM_NONE)
                                                                                `uvm_info("Passed Wrong Read Command",$sformatf("Dut was requested to read the data of the address %h with wrong white spaces or eol character \n",frm_mon.address),UVM_HIGH)
 
                                                                                   match++;
                                                                                end
                                                                                end
                                                                        end
                                                                        end
                                                                else if (frm_drv._data != frm_mon._data)
                                                                else if (frm_drv._data != frm_mon._data)
                                                                        begin
                                                                        begin
                                                                        `uvm_error("Failed Read Text Mode",$sformatf("Data fields aren't identical ,, It was requested to drive %b and dut reply with the data %b \n",frm_drv._data,frm_mon._data))
                                                                        `uvm_error("Failed Read Text Mode",$sformatf("Data fields aren't identical ,, It was requested to drive %b and dut reply with the data %b \n",frm_drv._data,frm_mon._data))
Line 150... Line 157...
                                                                                                (frm_drv._spacetype1    == frm_mon._spacetype1) &&
                                                                                                (frm_drv._spacetype1    == frm_mon._spacetype1) &&
                                                                                                (frm_drv._eoltype                       == frm_mon._eoltype) &&
                                                                                                (frm_drv._eoltype                       == frm_mon._eoltype) &&
                                                                                                (frm_drv._chartype              == frm_mon._chartype))
                                                                                                (frm_drv._chartype              == frm_mon._chartype))
                                                                        begin
                                                                        begin
                                                                        `uvm_info("Passed Read Text Mode",$sformatf("Data fields are identical ,, It was requested to read from the address %h and dut reply with the data %p using white space = %p and %p prefix character and %p as end of line character \n",frm_drv.address,frm_mon._data,frm_drv._spacetype1,frm_drv._chartype,
                                                                        `uvm_info("Passed Read Text Mode",$sformatf("Data fields are identical ,, It was requested to read from the address %h and dut reply with the data %p using white space = %p and %p prefix character and %p as end of line character \n",frm_drv.address,frm_mon._data,frm_drv._spacetype1,frm_drv._chartype,
                                                                                frm_drv._eoltype),UVM_NONE)
                                                                                frm_drv._eoltype),UVM_HIGH)
 
                                                                           match++;
                                                                        end
                                                                        end
                                                                else
                                                                else
                                                                        begin
                                                                        begin
                                                                        `uvm_error("Failed Read Text Mode",$sformatf("It is Requested to request to read data = %p address of %h with character prefix : %p using white space = %p and end of line character %p .. and found data = %p and address=%h with character prefix : %p using white space = %p and end of line character %p \n",frm_drv._data,frm_drv.address,frm_drv._chartype,frm_drv._spacetype1,frm_drv._eoltype,
                                                                        `uvm_error("Failed Read Text Mode",$sformatf("It is Requested to request to read data = %p address of %h with character prefix : %p using white space = %p and end of line character %p .. and found data = %p and address=%h with character prefix : %p using white space = %p and end of line character %p \n",frm_drv._data,frm_drv.address,frm_drv._chartype,frm_drv._spacetype1,frm_drv._eoltype,
                                                                         frm_mon._data,frm_mon.address,frm_mon._chartype,frm_mon._spacetype1,frm_mon._eoltype))
                                                                         frm_mon._data,frm_mon.address,frm_mon._chartype,frm_mon._spacetype1,frm_mon._eoltype))
Line 168... Line 176...
                                                                                begin
                                                                                begin
                                                                                `uvm_error("Failed Wrong Write Command","DUT responds to stimulus with wrong white space or eol charachters \n")
                                                                                `uvm_error("Failed Wrong Write Command","DUT responds to stimulus with wrong white space or eol charachters \n")
                                                                                end
                                                                                end
                                                                        else
                                                                        else
                                                                                begin
                                                                                begin
                                                                                `uvm_info("Passed Wrong Write Command",$sformatf("Dut was requested to read the data of the address %h with wrong white spaces or eol character \n",frm_mon.address),UVM_NONE)
                                                                                `uvm_info("Passed Wrong Write Command",$sformatf("Dut was requested to read the data of the address %h with wrong white spaces or eol character \n",frm_mon.address),UVM_HIGH)
 
                                                                                   match++;
                                                                                end
                                                                                end
                                                                        end
                                                                        end
                                                                else if (frm_drv._data != frm_mon._data)
                                                                else if (frm_drv._data != frm_mon._data)
                                                                        begin
                                                                        begin
                                                                        `uvm_error("Failed Write Text Mode",$sformatf("Data fields aren't identical ,, It was requested to drive %p and dut register the data %p \n",frm_drv._data,frm_mon._data))
                                                                        `uvm_error("Failed Write Text Mode",$sformatf("Data fields aren't identical ,, It was requested to drive %p and dut register the data %p \n",frm_drv._data,frm_mon._data))
Line 183... Line 192...
                                                                                                (frm_drv._spacetype2    == frm_mon._spacetype2) &&
                                                                                                (frm_drv._spacetype2    == frm_mon._spacetype2) &&
                                                                                                (frm_drv._eoltype                       == frm_mon._eoltype) &&
                                                                                                (frm_drv._eoltype                       == frm_mon._eoltype) &&
                                                                                                (frm_drv._chartype              == frm_mon._chartype))
                                                                                                (frm_drv._chartype              == frm_mon._chartype))
                                                                        begin
                                                                        begin
                                                                        `uvm_info("Passed write Text Mode",$sformatf("Data fields are identical ,, It was requested to write to the address %h and dut register the data %p using white space = %p and %p prefix character and %p as end of line character \n",frm_drv.address,frm_mon._data,frm_drv._spacetype1,frm_drv._chartype,
                                                                        `uvm_info("Passed write Text Mode",$sformatf("Data fields are identical ,, It was requested to write to the address %h and dut register the data %p using white space = %p and %p prefix character and %p as end of line character \n",frm_drv.address,frm_mon._data,frm_drv._spacetype1,frm_drv._chartype,
                                                                                frm_drv._eoltype),UVM_NONE)
                                                                                frm_drv._eoltype),UVM_HIGH)
 
                                                                           match++;
                                                                        end
                                                                        end
                                                                else
                                                                else
                                                                        begin
                                                                        begin
                                                                        `uvm_error("Failed write Text Mode",$sformatf("It is Requested to request to write data = %p address of %h with character prefix : %p using white space = %p and end of line character %p .. and found data = %p and address=%h with character prefix : %p using white space = %p and end of line character %p \n",frm_drv._data,frm_drv.address,frm_drv._chartype,frm_drv._spacetype1,frm_drv._eoltype,
                                                                        `uvm_error("Failed write Text Mode",$sformatf("It is Requested to request to write data = %p address of %h with character prefix : %p using white space = %p and end of line character %p .. and found data = %p and address=%h with character prefix : %p using white space = %p and end of line character %p \n",frm_drv._data,frm_drv.address,frm_drv._chartype,frm_drv._spacetype1,frm_drv._eoltype,
                                                                         frm_mon._data,frm_mon.address,frm_mon._chartype,frm_mon._spacetype1,frm_mon._eoltype))
                                                                         frm_mon._data,frm_mon.address,frm_mon._chartype,frm_mon._spacetype1,frm_mon._eoltype))
Line 212... Line 222...
                                                                frm_drv._reqinc                 == frm_mon._reqinc &&
                                                                frm_drv._reqinc                 == frm_mon._reqinc &&
                                                                frm_drv.address                 == frm_mon.address &&
                                                                frm_drv.address                 == frm_mon.address &&
                                                                frm_drv.length_data == frm_mon.length_data &&
                                                                frm_drv.length_data == frm_mon.length_data &&
                                                                frm_drv._data                   == frm_mon._data)
                                                                frm_drv._data                   == frm_mon._data)
                                                        begin
                                                        begin
                                                        `uvm_info($sformatf("Passed Binary %p Command",frm_drv._command),$sformatf("Dut is requested to %p command to start address=%h with data = %p and data length = %0d \n",frm_drv._command,frm_drv.address,frm_drv._data,frm_drv.length_data),UVM_NONE)
                                                        `uvm_info($sformatf("Passed Binary %p Command",frm_drv._command),$sformatf("Dut is requested to %p command to start address=%h with data = %p and data length = %0d \n",frm_drv._command,frm_drv.address,frm_drv._data,frm_drv.length_data),UVM_HIGH)
 
                                                           match++;
                                                        ack_checker();
                                                        ack_checker();
                                                        end
                                                        end
                                                else
                                                else
                                                        begin
                                                        begin
                                                        `uvm_error("Failed Binary Command",$sformatf("Dut is requested to %p command to start address=%h with data = %p, data length = %0d and dut reply with start address = %h and data = %p, length_data=%0d \n",
                                                        `uvm_error("Failed Binary Command",$sformatf("Dut is requested to %p command to start address=%h with data = %p, data length = %0d and dut reply with start address = %h and data = %p, length_data=%0d \n",
Line 224... Line 235...
                                                                                                                                 frm_mon.address,frm_mon._data,frm_mon.length_data))
                                                                                                                                 frm_mon.address,frm_mon._data,frm_mon.length_data))
                                                        end
                                                        end
                                                end
                                                end
                                        else if (frm_drv._command == nop)
                                        else if (frm_drv._command == nop)
                                                begin
                                                begin
                                                `uvm_info("NOP Command",$sformatf("Dut is requested to %p command \n",frm_drv._command),UVM_NONE)
                                                `uvm_info("NOP Command",$sformatf("Dut is requested to %p command \n",frm_drv._command),UVM_HIGH)
 
                                                   match++;
                                                ack_checker();
                                                ack_checker();
                                                end
                                                end
                                        end
                                        end
                                default:
                                default:
                                        begin
                                        begin
                                        `uvm_fatal("Testbench Bug",$sformatf("Mode is undefined = %p \n",frm_drv._mode))
                                        `uvm_fatal("Testbench Bug",$sformatf("Mode is undefined = %p \n",frm_drv._mode))
                                        end
                                        end
                        endcase
                        endcase
                        end
                        end // else: !if(frm_drv._command inside {invalid_read,invalid_write})
 
                   uvm_resource_db#(int)::write_by_name("Reporting","matched_packets",match);
                end
                end
endtask:run_phase
endtask:run_phase
 
 
function void uart_scoreboard::ack_checker();
function void uart_scoreboard::ack_checker();
 
 
Line 249... Line 262...
                begin
                begin
                `uvm_error("Wrong Response","Command doesn't request Acknowledge and DUT forward acknowledge character \n")
                `uvm_error("Wrong Response","Command doesn't request Acknowledge and DUT forward acknowledge character \n")
                end
                end
        else
        else
                begin
                begin
                `uvm_info("Accepted Acknowledge","Acknowledge is the defined as standard \n",UVM_NONE)
                `uvm_info("Accepted Acknowledge","Acknowledge is the defined as standard \n",UVM_HIGH)
                end
                end
 
 
endfunction:ack_checker
endfunction:ack_checker
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.