data/full_repos/permissive/143278/ivltests/realtobits.v
data/verilator_xmls/ddec6d60-3405-4c05-a081-508dcc31ca68.xml
module main;

   real val;

   initial begin
      val = 0.0;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h0000000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 1.0;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3ff0000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 0.5;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3fe0000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 1.5;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3ff8000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 1.125;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3ff2000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 2.6;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h4004cccccccccccd) begin
	 $display("FAILED");
	 $finish;
      end

      $display("PASSED");
   end

endmodule
module main;


   real val;

   initial begin
      val = 0.0;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h0000000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 1.0;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3ff0000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 0.5;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3fe0000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 1.5;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3ff8000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 1.125;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h3ff2000000000000) begin
	 $display("FAILED");
	 $finish;
      end

      val = 2.6;
      $display("val=%f (%h)", val, $realtobits(val));
      if ($realtobits(val) !== 64'h4004cccccccccccd) begin
	 $display("FAILED");
	 $finish;
      end

      $display("PASSED");
   end

endmodule