vi_pipe.pl 7.02 KB
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_filter/vi_filter_all/vif1.pl";
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_filter/vi_filter_all/vif2.pl";
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_divot/vi_divot_all/vid1.pl";
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_divot/vi_divot_all/vid2.pl";
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_lerp/vivl.pl";
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_lerp/vivh.pl";
require "$ENV{'ROOT'}/PR/rdpsim/test/vi/OutData/vi_gamma/vi_gamma.pl";

sub vi_pipe
{
    $divot_enable        = $_[0];
    $gamma_enable        = $_[1];
    $gamma_dither_enable = $_[2];
    $rand                = $_[3];
    $hfrac               = $_[4];
    $vfrac               = $_[5];
    $rgb0i               = $_[6];
    $rgb1i               = $_[7];
    $rgb2i               = $_[8];
    $rgb3i               = $_[9];
    $cvg1i               = $_[10];
    $cvg2i               = $_[11];
    $synci               = $_[12];

    $_[13] = $osrgb;
    $_[14] = $osync;

    $rgb2x = $rgb0i;
    $rgb1e = $rgb1i;
    $rgb2e = $rgb2i;
    $rgb1x = $rgb3i;
    $synce = $synci;

    $pipe_hold  = $osynca ? ($orgb1a & 1) : $opipe_hold_reg;
    $vlerp_hold = $ovlerp4sync ? (($ovlerp4rgb & (1 << 5)) >> 5) : $ovlerp_hold_reg;

    $nrgb2xx = ($pipe_hold & !$synce) ? $orgb1d : $rgb2x;
    $nrgb2xy = $orgb2xx;
    $nrgb2xz = $orgb2xy;    
    $nrgb1d  = $orgb2xz;
    $nrgb1dx = ($pipe_hold & !$osyncf) ? $orgb2y : $orgb1d;
    $nrgb1dy = $orgb1dx;
    $nrgb1dz = $orgb1dy;
    $nrgb2y  = $orgb1dz;
    $nrgb2yx = ($pipe_hold & !$osynca) ? $orgb1c : $orgb2y;
    $nrgb2yy = $orgb2yx;
    $nrgb2yz = $orgb2yy;
    $nrgb1c  = $orgb2yz;

    $nrgb1ex = ($pipe_hold & !$synce) ? $orgb2d : $rgb1e;
    $nrgb1ey = $orgb1ex;
    $nrgb1ez = $orgb1ey;
    $nrgb2d  = $orgb1ez;
    $nrgb2dx = ($pipe_hold & !$osyncf) ? $orgb1a : $orgb2d;
    $nrgb2dy = $orgb2dx;
    $nrgb2dz = $orgb2dy;
    $nrgb1a  = $orgb2dz;
    $nrgb1ax = ($pipe_hold & !$osynca) ? $orgb2c : $orgb1a;
    $nrgb1ay = $orgb1ax;
    $nrgb1az = $orgb1ay;
    $nrgb2c  = $orgb1az;
    $nrgb2cx = ($pipe_hold & !$osyncg) ? $orgb1b : $orgb2c;
    $nrgb2cy = $orgb2cx;
    $nrgb2cz = $orgb2cy;
    $nrgb1b  = $orgb2cz;

    $nrgb2ex = ($pipe_hold & !$synce) ? $orgb1f : $rgb2e;
    $nrgb2ey = $orgb2ex;
    $nrgb2ez = $orgb2ey;
    $nrgb1f  = $orgb2ez;
    $nrgb1fx = ($pipe_hold & !$osyncf) ? $orgb2a : $orgb1f;
    $nrgb1fy = $orgb1fx;
    $nrgb1fz = $orgb1fy;
    $nrgb2a  = $orgb1fz;
    $nrgb2ax = ($pipe_hold & !$osynca) ? $orgb1g : $orgb2a;
    $nrgb2ay = $orgb2ax;
    $nrgb2az = $orgb2ay;
    $nrgb1g  = $orgb2az;
    $nrgb1gx = ($pipe_hold & !$osyncg) ? $orgb2b : $orgb1g;
    $nrgb1gy = $orgb1gx;
    $nrgb1gz = $orgb1gy;
    $nrgb2b  = $orgb1gz;

    $nrgb1xx = ($pipe_hold & !$synce) ? $orgb2f : $rgb1x;
    $nrgb1xy = $orgb1xx;
    $nrgb1xz = $orgb1xy;    
    $nrgb2f  = $orgb1xz;
    $nrgb2fx = ($pipe_hold & !$osyncf) ? $orgb1y : $orgb2f;
    $nrgb2fy = $orgb2fx;
    $nrgb2fz = $orgb2fy;
    $nrgb1y  = $orgb2fz;
    $nrgb1yx = ($pipe_hold & !$osynca) ? $orgb2g : $orgb1y;
    $nrgb1yy = $orgb1yx;
    $nrgb1yz = $orgb1yy;
    $nrgb2g  = $orgb1yz;

    $ncvg1e  = (!$pipe_hold & $synce)  ? $cvg1i  : $ocvg1e;
    $ncvg2d  = (!$pipe_hold & $osyncf) ? $ocvg1e : $ocvg2d;
    $ncvg1a  = (!$pipe_hold & $osynca) ? $ocvg2d : $ocvg1a;

    $ncvg2e  = (!$pipe_hold & $synce)  ? $cvg2i  : $ocvg2e;
    $ncvg1f  = (!$pipe_hold & $osyncf) ? $ocvg2e : $ocvg1f;
    $ncvg2a  = (!$pipe_hold & $osynca) ? $ocvg1f : $ocvg2a;

    $nsyncex = $synce;
    $nsyncey = $osyncex;
    $nsyncez = $osyncey;
    $nsyncf  = $osyncez;
    $nsyncfx = $osyncf;
    $nsyncfy = $osyncfx;
    $nsyncfz = $osyncfy;
    $nsynca  = $osyncfz;
    $nsyncax = $osynca;
    $nsyncay = $osyncax;
    $nsyncaz = $osyncay;
    $nsyncg  = $osyncaz;

    &vif1($orgb1a, $orgb1b, $orgb1c,  $orgb1d, $rgb1e, $orgb1f, $orgb1g,
	  $ocvg1a, $osynca, $filter1rgb, $filter1cvg, $filter1sync);

    &vif2($orgb2a, $orgb2b, $orgb2c,  $orgb2d, $rgb2e, $orgb2f, $orgb2g,
	  $ocvg2a, $osynca, $filter2rgb, $filter2cvg, $filter2sync);

    &vid1($divot_enable, $filter1rgb, $filter1cvg, $filter1sync, $divot1rgb, $divotsync);
    &vid2($divot_enable, $filter2rgb, $filter2cvg, $filter2sync, $divot2rgb, $divotsync);

    &vivl($vfrac, $divot1rgb, $divot2rgb, $divotsync, $vlerp0rgb, $vlerp0sync);

    $npipe_hold_reg = $pipe_hold;

    $nvlerp1rgb  = ($vlerp_hold & !$ovlerp4sync) ? $ovlerp4rgb : $vlerp0rgb;
    $nvlerp2rgb  = $ovlerp1rgb;
    $nvlerp3rgb  = $ovlerp2rgb;
    $nvlerp4rgb  = $ovlerp3rgb;

    $nvlerp1sync = $vlerp0sync;
    $nvlerp2sync = $ovlerp1sync;
    $nvlerp3sync = $ovlerp2sync;
    $nvlerp4sync = $ovlerp3sync;

    &vivh($hfrac, $ovlerp4rgb, $vlerp0rgb, $ovlerp4sync, $hlerprgb, $hlerpsync);

    &vi_gamma($gamma_enable, $gamma_dither_enable, $hlerprgb, $rand, $hlerpsync, 
	      $gammargb, $gammasync);

    $LineNumber++;

    $nvlerp_hold_reg = $vlerp_hold;
    $nsrgb = $gammargb;
    $nsync = $gammasync;
    
    # now stuff n's into o's

    $orgb2xx = $nrgb2xx;
    $orgb2xy = $nrgb2xy;
    $orgb2xz = $nrgb2xz;
    $orgb1d  = $nrgb1d;
    $orgb1dx = $nrgb1dx;
    $orgb1dy = $nrgb1dy;
    $orgb1dz = $nrgb1dz;
    $orgb2y  = $nrgb2y;
    $orgb2yx = $nrgb2yx;
    $orgb2yy = $nrgb2yy;
    $orgb2yz = $nrgb2yz;
    $orgb1c  = $nrgb1c;

    $orgb1ex = $nrgb1ex;
    $orgb1ey = $nrgb1ey;
    $orgb1ez = $nrgb1ez;
    $orgb2d  = $nrgb2d;
    $orgb2dx = $nrgb2dx;
    $orgb2dy = $nrgb2dy;
    $orgb2dz = $nrgb2dz;
    $orgb1a  = $nrgb1a;
    $orgb1ax = $nrgb1ax;
    $orgb1ay = $nrgb1ay;
    $orgb1az = $nrgb1az;
    $orgb2c  = $nrgb2c;
    $orgb2cx = $nrgb2cx;
    $orgb2cy = $nrgb2cy;
    $orgb2cz = $nrgb2cz;
    $orgb1b  = $nrgb1b;

    $orgb2ex = $nrgb2ex;
    $orgb2ey = $nrgb2ey;
    $orgb2ez = $nrgb2ez;
    $orgb1f  = $nrgb1f;
    $orgb1fx = $nrgb1fx;
    $orgb1fy = $nrgb1fy;
    $orgb1fz = $nrgb1fz;
    $orgb2a  = $nrgb2a;
    $orgb2ax = $nrgb2ax;
    $orgb2ay = $nrgb2ay;
    $orgb2az = $nrgb2az;
    $orgb1g  = $nrgb1g;
    $orgb1gx = $nrgb1gx;
    $orgb1gy = $nrgb1gy;
    $orgb1gz = $nrgb1gz;
    $orgb2b  = $nrgb2b;

    $orgb1xx = $nrgb1xx;
    $orgb1xy = $nrgb1xy;
    $orgb1xz = $nrgb1xz;
    $orgb2f  = $nrgb2f;
    $orgb2fx = $nrgb2fx;
    $orgb2fy = $nrgb2fy;
    $orgb2fz = $nrgb2fz;
    $orgb1y  = $nrgb1y;
    $orgb1yx = $nrgb1yx;
    $orgb1yy = $nrgb1yy;
    $orgb1yz = $nrgb1yz;
    $orgb2g  = $nrgb2g;

    $ocvg1e  = $ncvg1e;
    $ocvg2d  = $ncvg2d;
    $ocvg1a  = $ncvg1a;

    $ocvg2e  = $ncvg2e;
    $ocvg1f  = $ncvg1f;
    $ocvg2a  = $ncvg2a;

    $osyncex = $nsyncex;
    $osyncey = $nsyncey;
    $osyncez = $nsyncez;
    $osyncf  = $nsyncf;
    $osyncfx = $nsyncfx;
    $osyncfy = $nsyncfy;
    $osyncfz = $nsyncfz;
    $osynca  = $nsynca;
    $osyncax = $nsyncax;
    $osyncay = $nsyncay;
    $osyncaz = $nsyncaz;
    $osyncg  = $nsyncg;

    $ovlerp1rgb  = $nvlerp1rgb;
    $ovlerp1sync = $nvlerp1sync;
    $ovlerp2rgb  = $nvlerp2rgb;
    $ovlerp2sync = $nvlerp2sync;
    $ovlerp3rgb  = $nvlerp3rgb;
    $ovlerp3sync = $nvlerp3sync;
    $ovlerp4rgb  = $nvlerp4rgb;
    $ovlerp4sync = $nvlerp4sync;

    $osrgb = $nsrgb;
    $osync = $nsync;
}