display.v 833 Bytes
//
// Display for vi_gamma
//
// 10/17/94 Kluster
//

module display(vclk, gamma_enable, gamma_dither_enable, rgb, rand, sync, gamma_rgb, gamma_sync);
//
// Inputs
//
input			vclk;
input 			gamma_enable;
input			gamma_dither_enable;
input	[7:0]		rgb;
input	[5:0]		rand;
input			sync;
input	[6:0]		gamma_rgb;
input			gamma_sync;	

reg	[1:256*8]	filename;

//
//  Open output file
//
initial
begin	
  if ($getstr$plusarg("out=", filename) == 1)
    begin	
      if ($open_out_file(filename) == -1)
        begin
          $write("Cannot open out file \n");
          $finish();
        end	
    end	
end


always @(posedge vclk) 
begin
  if ($output_gamma(gamma_enable, gamma_dither_enable, rgb, rand, sync, gamma_rgb, gamma_sync) == -1)
    begin
      $write("Cannot write output values \n");
      $finish();
    end
end

endmodule