2.uvm analysis port to valid event channel
// golden cehck via uvm analysis port
// ps : the port should be connected to it's callback module. that uvm can collected.
// ex: item_port.connect( analysis_export );
uvm_analysis_port item_port
// DPI import ... for our golen model
import "DPI" void *yuv2rgb(int unsigned y, int unsigned u, int unsigned v);
// yub2rgb(void* trx); using ptr is a more friendly interface....
import "DPI" void *rgb2yuv(int unsigned r, int unsigned g, int unsigned b);
// callback func called from callable func/module
task callback(sample_trx trx);
assert(trx!=null);
if (trx.type == YUV2RGB)
dpi_c_yuv2rgb(trx);
else
dpi_c_rgb2yuv(trx);
endtask
void dpi_c_yuv2rgb(sample_trx trx);
assert(trx!=null);
c_rst = yuv2rgb(trx.y, trx.u, trx.v)
assert( c_rst.r == trx.r &
c_rst.g == trx.g &
c_rst.b == trx.b);
endtask
沒有留言:
張貼留言