Synthesis of pure and impure functions

Discussion in 'VHDL' started by konstantink, Jul 16, 2007.

  1. konstantink

    konstantink Guest

    Hi, experts!

    Is there any difference in synthesis of pure and impure functions if
    both of them don't access to any of the global signals?

    Thanks!
     
    konstantink, Jul 16, 2007
    #1
    1. Advertising

  2. konstantink wrote:

    > Is there any difference in synthesis of pure and impure functions if
    > both of them don't access to any of the global signals?



    Well, the default "function" is pure,
    and I leave it that way when I can.

    Declaring a function used purely
    as impure is bad style because
    it confuses the reader and slightly
    dangerous because unintended side
    effects would be accepted without error.

    I do most of my synthesis work at process scope.
    If a subprogram *assigns* a value to an object,
    I use a procedure rather than an impure function.

    If a subprogram just *uses* values,
    then I prefer calling an impure function.

    For example:

    impure function bit_done return boolean is
    begin
    return TxBitSampleCount_v = tic_per_bit_c;
    end function bit_done;

    -- Mike Treseler
     
    Mike Treseler, Jul 16, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alif Wahid

    The 'impure' construct

    Alif Wahid, Jan 4, 2006, in forum: VHDL
    Replies:
    2
    Views:
    8,511
    Reiner Huober
    Jan 4, 2006
  2. Todd Aspeotis
    Replies:
    3
    Views:
    498
    Kanenas
    May 30, 2005
  3. Frederik Vanrenterghem

    Build impure modules

    Frederik Vanrenterghem, May 18, 2005, in forum: Python
    Replies:
    0
    Views:
    333
    Frederik Vanrenterghem
    May 18, 2005
  4. owl
    Replies:
    2
    Views:
    300
  5. Replies:
    3
    Views:
    344
Loading...

Share This Page