top_level.v 4.54 KB
`timescale 10ps / 10ps  //1unit = 0.01ns

module top_level();

  wire gclk;
  wire st_span;
  wire ncyc;
  wire key_en;
  wire texture_edge_mode;
  wire cvg_times_alpha;
  wire alpha_cvg_select;
  wire [3:0] cc_x_sel_0_r;
  wire [3:0] cc_y_sel_0_r;
  wire [4:0] cc_a_sel_0_r;
  wire [2:0] cc_c_sel_0_r;
  wire [2:0] cc_x_sel_0_a;
  wire [2:0] cc_y_sel_0_a;
  wire [2:0] cc_a_sel_0_a;
  wire [2:0] cc_c_sel_0_a;
  wire [3:0] cc_x_sel_1_r;
  wire [3:0] cc_y_sel_1_r;
  wire [4:0] cc_a_sel_1_r;
  wire [2:0] cc_c_sel_1_r;
  wire [2:0] cc_x_sel_1_a;
  wire [2:0] cc_y_sel_1_a;
  wire [2:0] cc_a_sel_1_a;
  wire [2:0] cc_c_sel_1_a;
  wire [7:0] st_r;
  wire [7:0] st_g;
  wire [7:0] st_b;
  wire [7:0] st_a;
  wire [8:0] tf_r;
  wire [8:0] tf_g;
  wire [8:0] tf_b;
  wire [8:0] tf_a;
  wire [8:0] tf_lod_frac;
  wire tf_lge1;
  wire [8:0] prim_lod_frac;
  wire [7:0] prim_r;
  wire [7:0] prim_g;
  wire [7:0] prim_b;
  wire [7:0] prim_a;
  wire [7:0] env_r;
  wire [7:0] env_g;
  wire [7:0] env_b;
  wire [7:0] env_a;
  wire [7:0] center_r;
  wire [7:0] center_g;
  wire [7:0] center_b;
  wire [7:0] scale_r;
  wire [7:0] scale_g;
  wire [7:0] scale_b;
  wire [11:0] width_r;
  wire [11:0] width_g;
  wire [11:0] width_b;
  wire [8:0] k4_coeff;
  wire [8:0] k5_coeff;
  wire [8:0] noise;
  wire [3:0] cvg;
  wire dither_en;
  wire [16:0] cc_r;
  wire [16:0] cc_g;
  wire [16:0] cc_b;
  wire [8:0] cc_a;
  wire [7:0] shade_a;
  wire [7:0] pixel_r;
  wire [7:0] pixel_g;
  wire [7:0] pixel_b;
  wire [8:0] pixel_a;
  wire [3:0] pixel_cvg;

  // instance driver

  driver driver(.st_span(st_span), .ncyc(ncyc), .key_en(key_en),
		.texture_edge_mode(texture_edge_mode),
		.cvg_times_alpha(cvg_times_alpha),
		.alpha_cvg_select(alpha_cvg_select),
		.cc_x_sel_0_r(cc_x_sel_0_r), .cc_y_sel_0_r(cc_y_sel_0_r),
		.cc_a_sel_0_r(cc_a_sel_0_r), .cc_c_sel_0_r(cc_c_sel_0_r),
		.cc_x_sel_0_a(cc_x_sel_0_a), .cc_y_sel_0_a(cc_y_sel_0_a),
		.cc_a_sel_0_a(cc_a_sel_0_a), .cc_c_sel_0_a(cc_c_sel_0_a),
		.cc_x_sel_1_r(cc_x_sel_1_r), .cc_y_sel_1_r(cc_y_sel_1_r),
		.cc_a_sel_1_r(cc_a_sel_1_r), .cc_c_sel_1_r(cc_c_sel_1_r),
		.cc_x_sel_1_a(cc_x_sel_1_a), .cc_y_sel_1_a(cc_y_sel_1_a),
		.cc_a_sel_1_a(cc_a_sel_1_a), .cc_c_sel_1_a(cc_c_sel_1_a),
		.st_r(st_r), .st_g(st_g), .st_b(st_b), .st_a(st_a),
		.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),
		.prim_lod_frac(prim_lod_frac),
		.prim_r(prim_r), .prim_g(prim_g),
		.prim_b(prim_b), .prim_a(prim_a),
		.env_r(env_r), .env_g(env_g), .env_b(env_b), .env_a(env_a),
		.center_r(center_r), .center_g(center_g), .center_b(center_b),
		.scale_r(scale_r), .scale_g(scale_g), .scale_b(scale_b),
		.width_r(width_r), .width_g(width_g), .width_b(width_b),
		.k4_coeff(k4_coeff), .k5_coeff(k5_coeff), .noise(noise),
		.cvg(cvg), .dither_en(dither_en), .shade_a(shade_a),
		.cc_r(cc.cc_r), .cc_g(cc.cc_g), .cc_b(cc.cc_b), .cc_a(cc.cc_a),
		.pixel_r(pixel_r), .pixel_g(pixel_g),
		.pixel_b(pixel_b), .pixel_a(pixel_a),
		.pixel_cvg(pixel_cvg), .gclk(gclk));

  // instance cc unit

  cc cc(.gclk(gclk), .st_span(st_span), .ncyc(ncyc), .key_en(key_en),
	.texture_edge_mode(texture_edge_mode),
	.cvg_times_alpha(cvg_times_alpha),
	.alpha_cvg_select(alpha_cvg_select),
	.cc_x_sel_0_r(cc_x_sel_0_r), .cc_y_sel_0_r(cc_y_sel_0_r),
	.cc_a_sel_0_r(cc_a_sel_0_r), .cc_c_sel_0_r(cc_c_sel_0_r),
	.cc_x_sel_0_a(cc_x_sel_0_a), .cc_y_sel_0_a(cc_y_sel_0_a),
	.cc_a_sel_0_a(cc_a_sel_0_a), .cc_c_sel_0_a(cc_c_sel_0_a),
	.cc_x_sel_1_r(cc_x_sel_1_r), .cc_y_sel_1_r(cc_y_sel_1_r),
	.cc_a_sel_1_r(cc_a_sel_1_r), .cc_c_sel_1_r(cc_c_sel_1_r),
	.cc_x_sel_1_a(cc_x_sel_1_a), .cc_y_sel_1_a(cc_y_sel_1_a),
	.cc_a_sel_1_a(cc_a_sel_1_a), .cc_c_sel_1_a(cc_c_sel_1_a),
	.st_r(st_r), .st_g(st_g), .st_b(st_b), .st_a(st_a),
	.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),
	.prim_lod_frac(prim_lod_frac),
	.prim_r(prim_r), .prim_g(prim_g),
	.prim_b(prim_b), .prim_a(prim_a),
	.env_r(env_r), .env_g(env_g), .env_b(env_b), .env_a(env_a),
	.center_r(center_r), .center_g(center_g), .center_b(center_b),
	.scale_r(scale_r), .scale_g(scale_g), .scale_b(scale_b),
	.width_r(width_r), .width_g(width_g), .width_b(width_b),
	.k4_coeff(k4_coeff), .k5_coeff(k5_coeff), .noise(noise),
	.cvg(cvg), .dither_en(dither_en), .shade_a(shade_a),
	.pixel_r(pixel_r), .pixel_g(pixel_g),
	.pixel_b(pixel_b), .pixel_a(pixel_a),
	.pixel_cvg(pixel_cvg));

  //  kill simulation when tabular file read

  always @(driver.EndVectors)
    $finish;

  //  create dump file with optional argument
  initial
  begin
    if ($test$plusargs("dump"))
      $dumpvars;
  end
endmodule // top_level