# Formal verification and system functions

**URL:** <https://verificationacademy.com/forums/t/formal-verification-and-system-functions/42696>\
**Category:** SystemVerilog\
**Tags:** SVA, SystemVerilog, bitstoreal, formal\
**Created:** [November 16, 2023, 6:27am UTC](https://verificationacademy.com/forums/t/formal-verification-and-system-functions/42696 "2023-11-16T06:27:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DefaultName](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/a88e57/32.png) [@DefaultName](https://verificationacademy.com/forums/u/DefaultName)\
**Post date:** [November 16, 2023, 6:27am UTC](https://verificationacademy.com/forums/t/formal-verification-and-system-functions/42696/1 "2023-11-16T06:27:31Z")

</div>

Suppose I need to verify the floating point adder. Can I write such a assertion and will the format tool be able to carry out verification in a reasonable time? Is such an approach viable?

```verilog

  input ival,
  input [31:0] in_a,
  input [31:0] in_b,
  output oval,
  output [31:0] result

...
  some rtl code
...

  property check_sum;
    shortreal sum;
    (ival, sum = $bitstoshortreal(in_a) + $bitstoshortreal(in_b)) |=> oval & (result == $shortrealtobits(sum));
  endproperty

  sva_check_sum: assert property (check_sum);

```

Or in this case, the effectiveness of the tool will not be better than going through all the values in the simulation?  
The `$bitstoshortreal` function works with constant expressions, but for example, suppose I managed to get around this limitation.  
Thank you.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [November 26, 2023, 1:50pm UTC](https://verificationacademy.com/forums/t/formal-verification-and-system-functions/42696/2 "2023-11-26T13:50:41Z")

</div>

_In reply to [DefaultName](https://verificationacademy.com/forums/t/formal-verification-and-system-functions/42696):_

There is no need for the $bittoshortreal function or any of the bit-to or to to-bits system function in SystemVerilog. They were hacks to get around the favt that Verilog only supported packed integral arrays through ports.

Efficiency of particular tools is off-topic for this forum.

You may want to read: [https://dvcon-proceedings.org/wp-content/uploads/formal-verification-of-floating-point-hardware-with-assertion-based-vip.pdf](https://dvcon-proceedings.org/wp-content/uploads/formal-verification-of-floating-point-hardware-with-assertion-based-vip.pdf)
