div_capture.v 1.31 KB

reg [31:0] fpC_div;
initial 
begin
  if ($test$plusargs("qsim_capture_div"))
      begin

        fpC_div = $fopen("capture_div.tab");

        $fwrite(fpC_div,
		    "CLK                    @C 1(8) 0(8)\n",
                    "Reset_l                @I @E 2     \n",
                    "OpCode[5:0]            @I @E 2     \n",
                    "OpCodeValid            @I @E 2     \n",
                    "VTL[15:0]              @I @E 2     \n",
                    "VTH[15:0]              @I @E 2     \n",
                    "El2                    @I @E 2     \n",
                    "DivOut[15:0]           @O @S 10    \n",
                    "RADDR[9:0]             @O @S 14    \n",
                    "ROMData[15:0]          @O @S 13    \n"
	        );
        $fdisplay(fpC_div); 
    
         @(posedge `CLK);

        forever 
	  begin
	    @(posedge `CLK);
	    #4;
	    $fwrite(fpC_div,"%b ",   `vu_path.div1.Reset_l,
	    		    "0x%h ", `vu_path.div1.OpCode,
	    		    "%b ",   `vu_path.div1.OpCodeValid,
	    		    "0x%h ", `vu_path.div1.VTL,
	    		    "0x%h ", `vu_path.div1.VTH,
	    		    "%b ",   `vu_path.div1.El2,
	    		    "0x%h ", `vu_path.div1.DivOut,
	    		    "0x%h ", `vu_path.div1.RADDR,
	    		    "0x%h ", `vu_path.div1.ROMData
		    );
            $fdisplay(fpC_div); 
          end
      end
end