dump_tab.vh 4.69 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:      rcp_tab.vh
// description: dumps out an rcp i/o .tab file
//
// designer:    Tony DeLaurier
// date:        11/21/94
//
////////////////////////////////////////////////////////////////////////


  integer	tab_file_ptr;
  integer	cycle_0;

  // open tab file
  initial 
  begin

    tab_file_ptr = $fopen("test.tab");
    
    $fwriteh(tab_file_ptr, "gclk                    @C 1(8) 0(8) \n");
    $fwriteh(tab_file_ptr, "st_span                 @I @E 2\n");
    $fwriteh(tab_file_ptr, "ncyc                    @I @E 2\n");
    $fwriteh(tab_file_ptr, "l[15:0]                 @I @E 2\n");
    $fwriteh(tab_file_ptr, "s[15:0]                 @I @E 2\n");
    $fwriteh(tab_file_ptr, "t[15:0]                 @I @E 2\n");
    $fwriteh(tab_file_ptr, "w[15:0]                 @I @E 2\n");
    $fwriteh(tab_file_ptr, "min_level[4:0]          @I @E 2\n");
    $fwriteh(tab_file_ptr, "detail_en               @I @E 2\n");
    $fwriteh(tab_file_ptr, "sharp_en                @I @E 2\n");
    $fwriteh(tab_file_ptr, "lod_en                  @I @E 2\n");
    $fwriteh(tab_file_ptr, "persp_en                @I @E 2\n");
    $fwriteh(tab_file_ptr, "copy                    @I @E 2\n");
    $fwriteh(tab_file_ptr, "samp_type               @I @E 2\n");
    $fwriteh(tab_file_ptr, "tlut_en                 @I @E 2\n");
    $fwriteh(tab_file_ptr, "tlut_type               @I @E 2\n");
    $fwriteh(tab_file_ptr, "max_level[2:0]          @I @E 2\n");
    $fwriteh(tab_file_ptr, "prim_tile[2:0]          @I @E 2\n");
    $fwriteh(tab_file_ptr, "load                    @I @E 2\n");
    $fwriteh(tab_file_ptr, "shift_coord             @I @E 2\n");
    $fwriteh(tab_file_ptr, "tile_adrs[2:0]          @I @E 2\n");
    $fwriteh(tab_file_ptr, "tile_data[47:0]         @I @E 2\n");
    $fwriteh(tab_file_ptr, "we_tile_size            @I @E 2\n");
    $fwriteh(tab_file_ptr, "we_tile_attr            @I @E 2\n");
    $fwriteh(tab_file_ptr, "copy_load[63:0]         @B copy_load_oe 1 @E 2 @S 15\n");
    $fwriteh(tab_file_ptr, "copy_load_oe            @O @S 15\n");
    $fwriteh(tab_file_ptr, "load_dv                 @I @E 2\n");

    $fwriteh(tab_file_ptr, "l_frac[8:0]             @O @S 15\n");
    $fwriteh(tab_file_ptr, "lod_ge_one              @O @S 15\n");
    $fwriteh(tab_file_ptr, "s_frac_rg[7:0]          @O @S 15\n");
    $fwriteh(tab_file_ptr, "t_frac_rg[7:0]          @O @S 15\n");
    $fwriteh(tab_file_ptr, "s_frac_ba[7:0]          @O @S 15\n");
    $fwriteh(tab_file_ptr, "t_frac_ba[7:0]          @O @S 15\n");
    $fwriteh(tab_file_ptr, "red_a[8:0]              @O @S 15\n");
    $fwriteh(tab_file_ptr, "green_a[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "blue_a[8:0]             @O @S 15\n");
    $fwriteh(tab_file_ptr, "alpha_a[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "red_b[8:0]              @O @S 15\n");
    $fwriteh(tab_file_ptr, "green_b[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "blue_b[8:0]             @O @S 15\n");
    $fwriteh(tab_file_ptr, "alpha_b[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "red_c[8:0]              @O @S 15\n");
    $fwriteh(tab_file_ptr, "green_c[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "blue_c[8:0]             @O @S 15\n");
    $fwriteh(tab_file_ptr, "alpha_c[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "red_d[8:0]              @O @S 15\n");
    $fwriteh(tab_file_ptr, "green_d[8:0]            @O @S 15\n");
    $fwriteh(tab_file_ptr, "blue_d[8:0]             @O @S 15\n");
    $fwriteh(tab_file_ptr, "alpha_d[8:0]            @O @S 15\n");

    $fwriteh(tab_file_ptr, "\n");

    // set cycle 0 flag
    cycle_0 = 1;

  end // initial

  // dump i/o at pos edge clock 
  always @(posedge gclk)
  begin
    if (!cycle_0)
    begin
      $fwriteh(tab_file_ptr, 
	  st_span,,
	  ncyc,,"  ",
	  "0x",l,,
	  "0x",s,,
	  "0x",t,,
	  "0x",w,,"  ",
	  "0x",min_level,,
	  detail_en,,
	  sharp_en,,
	  lod_en,,
	  persp_en,,
	  copy,,
	  samp_type,,
	  tlut_en,,
	  tlut_type,,
	  "0x",max_level,,
	  "0x",prim_tile,,
	  load,,
	  shift_coord,,"  ",
	  "0x",tile_adrs,,
	  "0x",tile_data,,
	  we_tile_size,,
	  we_tile_attr,,"  ",
	  "0x",copy_load,,
	  tex.tm.copy_load_oe,,
	  load_dv,,"  ",

	  "0x",l_frac,,
	  lod_ge_one,,"  ",
	  "0x",s_frac_rg,,
	  "0x",t_frac_rg,,
	  "0x",s_frac_ba,,
	  "0x",t_frac_ba,,"  ",
	  "0x",red_a,,
	  "0x",green_a,,
	  "0x",blue_a,,
	  "0x",alpha_a,,"  ",
	  "0x",red_b,,
	  "0x",green_b,,
	  "0x",blue_b,,
	  "0x",alpha_b,,"  ",
	  "0x",red_c,,
	  "0x",green_c,,
	  "0x",blue_c,,
	  "0x",alpha_c,,"  ",
	  "0x",red_d,,
	  "0x",green_d,,
	  "0x",blue_d,,
	  "0x",alpha_d,
          "\n");
    end // if
    else
      cycle_0 = 0;
  end // always