top_level.v 3.32 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:      top_level
// description: Top Level Driver
//
// designer:    Rob Moore
// date:        8/23/94
//
////////////////////////////////////////////////////////////////////////

`timescale 10ps / 10ps  //1unit = 0.01ns

module top_level();

  wire gclk;             // RDP gated clock
  wire st_span;          // start of span (to sync cycle count)
  wire ncyc;             // number of cycles per pixel (- 1)
  wire bilerp0m;         // cycle 0 mode bit
  wire bilerp1m;         // cycle 1 mode bit
  wire convert_one;      // loopback mode
  wire mid_texel;        // mid mode (for 4 texel average)
  wire [8:0] k0_coeff;   // color convert coefficients
  wire [8:0] k1_coeff;
  wire [8:0] k2_coeff;
  wire [8:0] k3_coeff;
  wire [8:0] lod_frac;   // pipe thru to CCU
  wire lge1;
  wire [7:0] sfrac_rg;   // bilerp alphas
  wire [7:0] tfrac_rg;
  wire [7:0] sfrac_ba;
  wire [7:0] tfrac_ba;
  wire [8:0] tm_ra;      // this texel
  wire [8:0] tm_ga;
  wire [8:0] tm_ba;
  wire [8:0] tm_aa;
  wire [8:0] tm_rb;      // horizontal texel
  wire [8:0] tm_gb;
  wire [8:0] tm_bb;
  wire [8:0] tm_ab;
  wire [8:0] tm_rc;      // vertical texel
  wire [8:0] tm_gc;
  wire [8:0] tm_bc;
  wire [8:0] tm_ac;
  wire [8:0] tm_rd;      // other (opposite) texel
  wire [8:0] tm_gd;
  wire [8:0] tm_bd;
  wire [8:0] tm_ad;

  wire [8:0] tf_r;      // texture filter unit outputs
  wire [8:0] tf_g;
  wire [8:0] tf_b;
  wire [8:0] tf_a;
  wire [8:0] tf_lod_frac; // pipe thru to CCU
  wire tf_lge1;

  // instance driver
  driver driver (.gclk(gclk), 
	.st_span(st_span), .ncyc(ncyc), .bilerp0m(bilerp0m), .bilerp1m(bilerp1m), 
        .convert_one(convert_one), .mid_texel(mid_texel),
        .k0_coeff(k0_coeff), .k1_coeff(k1_coeff), .k2_coeff(k2_coeff), .k3_coeff(k3_coeff),
        .lod_frac(lod_frac), .lge1(lge1), 
        .sfrac_rg(sfrac_rg), .tfrac_rg(tfrac_rg), .sfrac_ba(sfrac_ba), .tfrac_ba(tfrac_ba),
        .tm_ra(tm_ra), .tm_ga(tm_ga), .tm_ba(tm_ba), .tm_aa(tm_aa),
        .tm_rb(tm_rb), .tm_gb(tm_gb), .tm_bb(tm_bb), .tm_ab(tm_ab),
        .tm_rc(tm_rc), .tm_gc(tm_gc), .tm_bc(tm_bc), .tm_ac(tm_ac),
        .tm_rd(tm_rd), .tm_gd(tm_gd), .tm_bd(tm_bd), .tm_ad(tm_ad),
        .tf_r(tf_r), .tf_g(tf_g), .tf_b(tf_b), .tf_a(tf_a), 
       .tf_lod_frac(tf_lod_frac), .tf_lge1(tf_lge1));


  // instance texture filter
  tf tf (.gclk(gclk), .st_span(st_span), .ncyc(ncyc), .bilerp0m(bilerp0m), .bilerp1m(bilerp1m), 
        .convert_one(convert_one), .mid_texel(mid_texel),
        .k0_coeff(k0_coeff), .k1_coeff(k1_coeff), .k2_coeff(k2_coeff), .k3_coeff(k3_coeff),
        .lod_frac(lod_frac), .lge1(lge1), 
        .sfrac_rg(sfrac_rg), .tfrac_rg(tfrac_rg), .sfrac_ba(sfrac_ba), .tfrac_ba(tfrac_ba),
        .tm_ra(tm_ra), .tm_ga(tm_ga), .tm_ba(tm_ba), .tm_aa(tm_aa),
        .tm_rb(tm_rb), .tm_gb(tm_gb), .tm_bb(tm_bb), .tm_ab(tm_ab),
        .tm_rc(tm_rc), .tm_gc(tm_gc), .tm_bc(tm_bc), .tm_ac(tm_ac),
        .tm_rd(tm_rd), .tm_gd(tm_gd), .tm_bd(tm_bd), .tm_ad(tm_ad),
        .tf_r(tf_r), .tf_g(tf_g), .tf_b(tf_b), .tf_a(tf_a), 
       .tf_lod_frac(tf_lod_frac), .tf_lge1(tf_lge1));



  //  kill simulation when tabular file read

  always @(driver.EndVectors)
    $finish;

  // dump file

  initial
  begin
    if ($test$plusargs("dump"))
      $dumpvars;
  end

endmodule // top_level