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

Subversion Repositories qaz_libs

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /qaz_libs/trunk/BFM/src
    from Rev 45 to Rev 46
    Reverse comparison

Rev 45 → Rev 46

/8b10b/deserializer_8b10b_bfm_if.sv
0,0 → 1,313
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
// Chuck Benz, Hollis, NH Copyright (c)2002
//
// The information and description contained herein is the
// property of Chuck Benz.
//
// Permission is granted for any reuse of this information
// and description as long as this copyright notice is
// preserved. Modifications may be made as long as this
// notice is preserved.
// per Widmer and Franaszek
 
interface
deserializer_8b10b_bfm_if
( input clk
, input serial_in
);
 
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// module decode_8b10b (datain, dispin, dataout, dispout, code_err, disp_err) ;
// input [9:0] datain ;
// input dispin ;
// output [8:0] dataout ;
// output dispout ;
// output code_err ;
// output disp_err ;
 
wire [9:0] datain;
wire dispin;
wire [8:0] dataout ;
wire code_err ;
wire disp_err ;
 
wire ai = datain[0] ;
wire bi = datain[1] ;
wire ci = datain[2] ;
wire di = datain[3] ;
wire ei = datain[4] ;
wire ii = datain[5] ;
wire fi = datain[6] ;
wire gi = datain[7] ;
wire hi = datain[8] ;
wire ji = datain[9] ;
 
wire aeqb = (ai & bi) | (!ai & !bi) ;
wire ceqd = (ci & di) | (!ci & !di) ;
wire p22 = (ai & bi & !ci & !di) |
(ci & di & !ai & !bi) |
( !aeqb & !ceqd) ;
wire p13 = ( !aeqb & !ci & !di) |
( !ceqd & !ai & !bi) ;
wire p31 = ( !aeqb & ci & di) |
( !ceqd & ai & bi) ;
 
wire p40 = ai & bi & ci & di ;
wire p04 = !ai & !bi & !ci & !di ;
 
wire disp6a = p31 | (p22 & dispin) ; // pos disp if p22 and was pos, or p31.
wire disp6a2 = p31 & dispin ; // disp is ++ after 4 bits
wire disp6a0 = p13 & ! dispin ; // -- disp after 4 bits
 
wire disp6b = (((ei & ii & ! disp6a0) | (disp6a & (ei | ii)) | disp6a2 |
(ei & ii & di)) & (ei | ii | di)) ;
 
// The 5B/6B decoding special cases where ABCDE != abcde
 
wire p22bceeqi = p22 & bi & ci & (ei == ii) ;
wire p22bncneeqi = p22 & !bi & !ci & (ei == ii) ;
wire p13in = p13 & !ii ;
wire p31i = p31 & ii ;
wire p13dei = p13 & di & ei & ii ;
wire p22aceeqi = p22 & ai & ci & (ei == ii) ;
wire p22ancneeqi = p22 & !ai & !ci & (ei == ii) ;
wire p13en = p13 & !ei ;
wire anbnenin = !ai & !bi & !ei & !ii ;
wire abei = ai & bi & ei & ii ;
wire cdei = ci & di & ei & ii ;
wire cndnenin = !ci & !di & !ei & !ii ;
 
// non-zero disparity cases:
wire p22enin = p22 & !ei & !ii ;
wire p22ei = p22 & ei & ii ;
//wire p13in = p12 & !ii ;
//wire p31i = p31 & ii ;
wire p31dnenin = p31 & !di & !ei & !ii ;
//wire p13dei = p13 & di & ei & ii ;
wire p31e = p31 & ei ;
 
wire compa = p22bncneeqi | p31i | p13dei | p22ancneeqi |
p13en | abei | cndnenin ;
wire compb = p22bceeqi | p31i | p13dei | p22aceeqi |
p13en | abei | cndnenin ;
wire compc = p22bceeqi | p31i | p13dei | p22ancneeqi |
p13en | anbnenin | cndnenin ;
wire compd = p22bncneeqi | p31i | p13dei | p22aceeqi |
p13en | abei | cndnenin ;
wire compe = p22bncneeqi | p13in | p13dei | p22ancneeqi |
p13en | anbnenin | cndnenin ;
 
wire ao = ai ^ compa ;
wire bo = bi ^ compb ;
wire co = ci ^ compc ;
wire _do = di ^ compd ;
wire eo = ei ^ compe ;
 
wire feqg = (fi & gi) | (!fi & !gi) ;
wire heqj = (hi & ji) | (!hi & !ji) ;
wire fghj22 = (fi & gi & !hi & !ji) |
(!fi & !gi & hi & ji) |
( !feqg & !heqj) ;
wire fghjp13 = ( !feqg & !hi & !ji) |
( !heqj & !fi & !gi) ;
wire fghjp31 = ( (!feqg) & hi & ji) |
( !heqj & fi & gi) ;
 
wire dispout = (fghjp31 | (disp6b & fghj22) | (hi & ji)) & (hi | ji) ;
 
wire ko = ( (ci & di & ei & ii) | ( !ci & !di & !ei & !ii) |
(p13 & !ei & ii & gi & hi & ji) |
(p31 & ei & !ii & !gi & !hi & !ji)) ;
 
wire alt7 = (fi & !gi & !hi & // 1000 cases, where disp6b is 1
((dispin & ci & di & !ei & !ii) | ko |
(dispin & !ci & di & !ei & !ii))) |
(!fi & gi & hi & // 0111 cases, where disp6b is 0
(( !dispin & !ci & !di & ei & ii) | ko |
( !dispin & ci & !di & ei & ii))) ;
 
wire k28 = (ci & di & ei & ii) | ! (ci | di | ei | ii) ;
// k28 with positive disp into fghi - .1, .2, .5, and .6 special cases
wire k28p = ! (ci | di | ei | ii) ;
wire fo = (ji & !fi & (hi | !gi | k28p)) |
(fi & !ji & (!hi | gi | !k28p)) |
(k28p & gi & hi) |
(!k28p & !gi & !hi) ;
wire go = (ji & !fi & (hi | !gi | !k28p)) |
(fi & !ji & (!hi | gi |k28p)) |
(!k28p & gi & hi) |
(k28p & !gi & !hi) ;
wire ho = ((ji ^ hi) & ! ((!fi & gi & !hi & ji & !k28p) | (!fi & gi & hi & !ji & k28p) |
(fi & !gi & !hi & ji & !k28p) | (fi & !gi & hi & !ji & k28p))) |
(!fi & gi & hi & ji) | (fi & !gi & !hi & !ji) ;
 
wire disp6p = (p31 & (ei | ii)) | (p22 & ei & ii) ;
wire disp6n = (p13 & ! (ei & ii)) | (p22 & !ei & !ii) ;
wire disp4p = fghjp31 ;
wire disp4n = fghjp13 ;
 
assign code_err = p40 | p04 | (fi & gi & hi & ji) | (!fi & !gi & !hi & !ji) |
(p13 & !ei & !ii) | (p31 & ei & ii) |
(ei & ii & fi & gi & hi) | (!ei & !ii & !fi & !gi & !hi) |
(ei & !ii & gi & hi & ji) | (!ei & ii & !gi & !hi & !ji) |
(!p31 & ei & !ii & !gi & !hi & !ji) |
(!p13 & !ei & ii & gi & hi & ji) |
(((ei & ii & !gi & !hi & !ji) |
(!ei & !ii & gi & hi & ji)) &
! ((ci & di & ei) | (!ci & !di & !ei))) |
(disp6p & disp4p) | (disp6n & disp4n) |
(ai & bi & ci & !ei & !ii & ((!fi & !gi) | fghjp13)) |
(!ai & !bi & !ci & ei & ii & ((fi & gi) | fghjp31)) |
(fi & gi & !hi & !ji & disp6p) |
(!fi & !gi & hi & ji & disp6n) |
(ci & di & ei & ii & !fi & !gi & !hi) |
(!ci & !di & !ei & !ii & fi & gi & hi) ;
 
assign dataout = {ko, ho, go, fo, eo, _do, co, bo, ao} ;
 
// my disp err fires for any legal codes that violate disparity, may fire for illegal codes
assign disp_err = ((dispin & disp6p) | (disp6n & !dispin) |
(dispin & !disp6n & fi & gi) |
(dispin & ai & bi & ci) |
(dispin & !disp6n & disp4p) |
(!dispin & !disp6p & !fi & !gi) |
(!dispin & !ai & !bi & !ci) |
(!dispin & !disp6p & disp4n) |
(disp6p & disp4p) | (disp6n & disp4n)) ;
 
// endmodule
// --------------------------------------------------------------------
// --------------------------------------------------------------------
 
// --------------------------------------------------------------------
localparam COMMAS_TO_LOCK = 5;
localparam K28_5 = 10'b1010000011;
 
// --------------------------------------------------------------------
logic [9:0] parallel_data = 0;
logic [9:0] comma_char = K28_5;
int cycle;
bit dataout_valid;
 
// --------------------------------------------------------------------
default clocking cb @(posedge clk);
input serial_in;
inout parallel_data;
inout cycle;
inout dataout_valid;
endclocking
 
// --------------------------------------------------------------------
task zero_cycle_delay;
##0;
endtask: zero_cycle_delay
 
// --------------------------------------------------------------------
wire comma_sync = (parallel_data == comma_char);
 
always @(cb)
cb.parallel_data <= {cb.serial_in, cb.parallel_data[9:1]};
 
// --------------------------------------------------------------------
always @(cb)
if(comma_sync)
cb.cycle <= 1;
else if(cb.cycle == 9)
cb.cycle <= 0;
else
cb.cycle <= cb.cycle + 1;
 
// --------------------------------------------------------------------
int locked_count = 0;
wire locked = locked_count >= COMMAS_TO_LOCK;
 
always @(cb iff comma_sync)
if(cb.cycle == 0)
begin
if(locked_count < COMMAS_TO_LOCK)
locked_count++;
end
else
locked_count = 0;
 
// --------------------------------------------------------------------
reg [9:0] parallel_data_r;
wire [9:0] parallel_data_msb = {<<{parallel_data_r}};
wire [5:0] data_6b = parallel_data_msb[9:4];
wire [3:0] data_4b = parallel_data_msb[3:0];
 
always @(cb)
if(cb.cycle == 0)
parallel_data_r <= cb.parallel_data;
 
// --------------------------------------------------------------------
int disparity;
int running_disparity;
 
always @(cb)
if(~locked)
if(dispout)
running_disparity = 1;
else
running_disparity = -1;
else if(cb.cycle == 0)
begin
disparity = 0;
for(int i = 0; i < 10; i++)
if(cb.parallel_data[i] == 1'b1)
disparity++;
else
disparity--;
running_disparity = running_disparity - disparity;
end
 
// --------------------------------------------------------------------
assign datain = parallel_data_r;
logic dispin_r;
assign dispin = dispin_r;
 
always @(cb)
if(cb.cycle == 0)
dispin_r <= dispout;
 
// --------------------------------------------------------------------
always @(cb)
if(cb.cycle == 5)
cb.dataout_valid <= 1;
else
cb.dataout_valid <= 0;
 
// --------------------------------------------------------------------
wire [7:0] dataout_msb = {<<{dataout[7:0]}};
wire [4:0] data_5b = dataout[4:0];
wire [2:0] data_3b = dataout[7:5];
wire data_k = dataout[8];
 
// --------------------------------------------------------------------
endinterface
/8b10b/video_frame/vf_8b10b_config.svh
0,0 → 1,74
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
 
class vf_8b10b_config;
 
virtual deserializer_8b10b_bfm_if vif;
protected uvm_active_passive_enum is_active; // UVM_ACTIVE or UVM_PASSIVE
int pixels_per_line;
int lines_per_frame;
int bits_per_pixel;
int bytes_per_pixel;
string name;
int channel_id;
logic [8:0] sof_8b = 9'b1_000_11100; // Start of Frame (SOF): K28.0
logic [8:0] eol_8b = 9'b1_010_11100; // End of Line (EOL): K28.2
logic [8:0] eof_8b = 9'b1_011_11100; // End of Frame (EOF): K28.3
logic [8:0] idle_8b = 9'b1_101_11100; // All IDLEs or NULLS: K28.5
 
// --------------------------------------------------------------------
function void init
( int pixels_per_line
, int lines_per_frame
, int bits_per_pixel
, string name = ""
);
this.pixels_per_line = pixels_per_line;
this.lines_per_frame = lines_per_frame;
this.bits_per_pixel = bits_per_pixel;
this.name = name;
this.bytes_per_pixel = (bits_per_pixel % 8 == 0)
? (bits_per_pixel / 8)
: (bits_per_pixel / 8) + 1;
endfunction: init
 
// --------------------------------------------------------------------
function new
( virtual deserializer_8b10b_bfm_if vif
, uvm_active_passive_enum is_active = UVM_PASSIVE
);
this.vif = vif;
this.is_active = is_active;
endfunction : new
 
// --------------------------------------------------------------------
function uvm_active_passive_enum get_is_active();
return is_active;
endfunction : get_is_active
 
// --------------------------------------------------------------------
endclass : vf_8b10b_config
/8b10b/video_frame/vf_8b10b_monitor.svh
0,0 → 1,91
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
 
class vf_8b10b_monitor extends uvm_component;
`uvm_component_utils(vf_8b10b_monitor);
 
virtual deserializer_8b10b_bfm_if vif;
vf_8b10b_config cfg_h;
uvm_analysis_port #(vf_8b10b_sequence_item) ap;
 
// --------------------------------------------------------------------
function new (string name, uvm_component parent);
super.new(name,parent);
endfunction
 
// --------------------------------------------------------------------
function void build_phase(uvm_phase phase);
ap = new("ap", this);
endfunction : build_phase
 
// --------------------------------------------------------------------
task run_phase(uvm_phase phase);
bit got_new_frame = 0;
int l = 0;
int p = 0;
vf_8b10b_sequence_item item;
video_frame_class f_h;
f_h = new();
f_h.init( cfg_h.pixels_per_line
, cfg_h.lines_per_frame
, cfg_h.bits_per_pixel
);
 
forever @(vif.cb iff vif.cb.dataout_valid)
begin
if(vif.dataout == cfg_h.sof_8b)
begin
item = vf_8b10b_sequence_item::type_id::create("item");
item.f_h = f_h.clone;
item.sof_timestamp = $time;
got_new_frame = 1;
end
 
if(~vif.dataout[8] & got_new_frame)
begin
item.f_h.lines[l].pixel[p] = vif.dataout[7:0];
p++;
end
 
if(vif.dataout == cfg_h.eol_8b)
begin
l++;
p = 0;
end
 
if(vif.dataout == cfg_h.eof_8b)
begin
got_new_frame = 0;
l = 0;
p = 0;
ap.write(item);
end
end
endtask : run_phase
 
// --------------------------------------------------------------------
endclass : vf_8b10b_monitor
/8b10b/video_frame/vf_8b10b_pkg.sv
0,0 → 1,42
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
 
package vf_8b10b_pkg;
import uvm_pkg::*;
`include "uvm_macros.svh"
import tb_pkg::*;
import video_frame_pkg::*;
 
// --------------------------------------------------------------------
`include "vf_8b10b_config.svh"
`include "vf_8b10b_sequence_item.svh"
`include "vf_8b10b_monitor.svh"
`include "vf_8b10b_scoreboard.svh"
`include "vf_8b10b_rx_agent.svh"
 
// --------------------------------------------------------------------
endpackage : vf_8b10b_pkg
/8b10b/video_frame/vf_8b10b_rx_agent.svh
0,0 → 1,55
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
 
class vf_8b10b_rx_agent
extends uvm_agent;
`uvm_component_utils(vf_8b10b_rx_agent)
 
// --------------------------------------------------------------------
vf_8b10b_config cfg_h;
vf_8b10b_monitor monitor_h;
 
// --------------------------------------------------------------------
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
monitor_h = vf_8b10b_monitor::type_id::create("monitor_h", this);
endfunction
 
// --------------------------------------------------------------------
virtual function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
monitor_h.vif = cfg_h.vif;
monitor_h.cfg_h = cfg_h;
endfunction
 
// --------------------------------------------------------------------
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
 
// --------------------------------------------------------------------
endclass : vf_8b10b_rx_agent
/8b10b/video_frame/vf_8b10b_scoreboard.svh
0,0 → 1,60
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
 
class vf_8b10b_scoreboard extends uvm_subscriber #(vf_8b10b_sequence_item);
`uvm_component_utils(vf_8b10b_scoreboard);
 
// --------------------------------------------------------------------
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction : new
 
// --------------------------------------------------------------------
function void build_phase(uvm_phase phase);
endfunction : build_phase
 
// --------------------------------------------------------------------
//
function void print_video_frame(ref video_frame_class f_h);
string s;
f_h.print_config();
$display(f_h.convert2string());
endfunction : print_video_frame
 
// --------------------------------------------------------------------
function void write(vf_8b10b_sequence_item t);
print_video_frame(t.f_h);
endfunction : write
 
// --------------------------------------------------------------------
function void report_phase(uvm_phase phase);
// uvm_report_info(get_name(), $sformatf("Matches : %0d", m_matches));
// uvm_report_info(get_name(), $sformatf("Mismatches: %0d", m_mismatches));
endfunction
 
// --------------------------------------------------------------------
endclass : vf_8b10b_scoreboard
/8b10b/video_frame/vf_8b10b_sequence_item.svh
0,0 → 1,104
//////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer. ////
//// ////
//// This source file is free software; you can redistribute it ////
//// and/or modify it under the terms of the GNU Lesser General ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any ////
//// later version. ////
//// ////
//// This source is distributed in the hope that it will be ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
//// PURPOSE. See the GNU Lesser General Public License for more ////
//// details. ////
//// ////
//// You should have received a copy of the GNU Lesser General ////
//// Public License along with this source; if not, download it ////
//// from http://www.opencores.org/lgpl.shtml ////
//// ////
//////////////////////////////////////////////////////////////////////
 
// // --------------------------------------------------------------------
// typedef enum {AVF_REQUEST, AVF_TRANSACTION} avf_sequence_item_t;
 
// --------------------------------------------------------------------
class vf_8b10b_sequence_item
extends uvm_sequence_item;
`uvm_object_utils(vf_8b10b_sequence_item)
 
// --------------------------------------------------------------------
video_frame_class f_h;
int frame_id;
time sof_timestamp;
time eof_timestamp;
 
// --------------------------------------------------------------------
function new(string name = "");
super.new(name);
endfunction : new
 
// // --------------------------------------------------------------------
// function bit do_compare(uvm_object rhs, uvm_comparer comparer);
// vf_8b10b_sequence_item tested;
// bit same;
 
// if (rhs==null)
// `uvm_fatal(get_type_name(), "| %m | comparison to a null pointer");
 
// if (!$cast(tested,rhs))
// same = 0;
// else
// same = super.do_compare(rhs, comparer);
 
// return same;
// endfunction : do_compare
 
// // --------------------------------------------------------------------
// function void do_copy(uvm_object rhs);
// vf_8b10b_sequence_item item;
// assert(rhs != null) else
// `uvm_fatal(get_type_name(), "| %m | copy null transaction");
// super.do_copy(rhs);
// assert($cast(item,rhs)) else
// `uvm_fatal(get_type_name(), "| %m | failed cast");
// delay = item.delay;
// command = item.command;
// wr_full = item.wr_full;
// rd_empty = item.rd_empty;
// wr_data = item.wr_data;
// rd_data = item.rd_data;
// count = item.count;
// endfunction : do_copy
 
// // --------------------------------------------------------------------
// function string convert2string();
// string s0, s1, s2, s3;
// s0 = $sformatf( "| %m | wr | rd | full | empty |\n");
// s1 = $sformatf( "| %m | %1h | %1h | %1h | %1h |\n"
// , (command == FIFO_WR) || (command == FIFO_BOTH)
// , (command == FIFO_RD) || (command == FIFO_BOTH)
// , wr_full
// , rd_empty
// );
// s2 = $sformatf("| %m | wr_data: %h\n" , wr_data);
// s3 = $sformatf("| %m | rd_data: %h\n" , rd_data);
 
// if(command == FIFO_NULL)
// return {s1, s0};
// else if(command == FIFO_BOTH)
// return {s3, s2, s1, s0};
// else if(command == FIFO_WR)
// return {s2, s1, s0};
// else if(command == FIFO_RD)
// return {s3, s1, s0};
// endfunction : convert2string
 
// --------------------------------------------------------------------
endclass : vf_8b10b_sequence_item

powered by: WebSVN 2.1.0

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