# Difference between Pure function and Cordinary function

**URL:** <https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [September 22, 2016, 5:46am UTC](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300 "2016-09-22T05:46:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Kumar\_Panda](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@Amit\_Kumar\_Panda](https://verificationacademy.com/forums/u/Amit_Kumar_Panda)\
**Post date:** [September 22, 2016, 5:46am UTC](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/1 "2016-09-22T05:46:59Z")

</div>

Hi all,  
It would be helpful if anybody can tell me the difference between Pure Function and Cordinary function?

---

<div class="post-metadata">

**Author:** ![alexgran](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/ce73a5/32.png) [@alexgran](https://verificationacademy.com/forums/u/alexgran)\
**Post date:** [September 22, 2016, 2:30pm UTC](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/2 "2016-09-22T14:30:25Z")

</div>

_In reply to [Amit Kumar Panda](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300):_

I’m not sure what a ‘cordinary function’ is that term doesn’t exist in the SV standard.  
However, Section 35.5.1.3 contains this:

> A function whose result depends solely on the values of its input arguments and with no side effects can be  
> specified as pure.

---

<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:** [September 22, 2016, 2:43pm UTC](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/3 "2016-09-22T14:43:50Z")

</div>

_In reply to [Amit Kumar Panda](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/2):_  
Did you mean Ordinary and not pure?

A pure function is any function whose return value can be determined solely by its input arguments. A pure function has no internal states variables and no references to any external variables other than those passed in as inputs. A pure function does not have modify any of its arguments (side-effects) and its return value is the only result of executing the function.

SystemVerilog requires functions to be pure when used in certain constructs like constant expressions, constraints and assertions.

---

<div class="post-metadata">

**Author:** ![Amit\_Kumar\_Panda](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@Amit\_Kumar\_Panda](https://verificationacademy.com/forums/u/Amit_Kumar_Panda)\
**Post date:** [September 23, 2016, 7:08am UTC](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/4 "2016-09-23T07:08:41Z")

</div>

_In reply to [alexgran](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/3):_

Thank you alex. Actually I also had doubts about ‘cordinary function’ but I wanted to be sure since I got this question online. Thanks again

---

<div class="post-metadata">

**Author:** ![Amit\_Kumar\_Panda](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/bcef8e/32.png) [@Amit\_Kumar\_Panda](https://verificationacademy.com/forums/u/Amit_Kumar_Panda)\
**Post date:** [September 23, 2016, 7:11am UTC](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/5 "2016-09-23T07:11:17Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/difference-between-pure-function-and-cordinary-function/32300/4):_

Thank you Dave . I got this question online and I wasn’t sure if there is something called ‘cordinary function’ in system verilog. Thanks for the clarification on pure function.
