Enhancement: Dynamic Values on attributes.

From: Krishna Garlapati (krishna@synplicity.com)
Date: Thu Oct 30 2003 - 14:25:33 PST

  • Next message: Steven Sharp: "Re: Enhancement: Dynamic Values on attributes."

    Frequently, our users ask for a method by which attributes can be created
    dynamically. Basically they want a convenient way to associate new values
    to attributes that are a combination of strings and compile time constants.
    This usage is typically associated with generate statements and I have
    an example in the end.

    The existing $swrite can be used, but is not very intuitive. To achieve
    this we
    have implemented a system function called $strcat in our Verilog Compiler
    and would like it to make into the 1364 standard.

    The format of this function is as follows:
    *
    Format*

    $strcat(string (or) const [, string (or) const]);
    returns a string

    *Parameters*

    string -> any compile time string
    const -> any compile time constant

    *Return value*

    a concatenated string that consists of all the evaluated parameters

    *Example:*

    generate for(i=0; i <= 7; i = i+1)
      begin: my_reg
        (* xc_rloc=$strcat("R",i,"C0.S0"),xc_uset="SET1" *) FDE flip_flop
    (.D(d[i]), .CE(ce),.C(clk),.Q(qb[i]));
      // myreg0.flip_flop gets an attribute xc_rloc = "R0C0.S0"
      // myreg0.flip_flop gets xc_rloc = "R1C0.S0"
      // and so on...
      end
    endgenerate

    Thanks,

    -- 
    - Krishna Garlapati, Synplicity Inc. (408)215-6152
    


    This archive was generated by hypermail 2.1.4 : Thu Oct 30 2003 - 14:19:02 PST and
    sponsored by Boyd Technology, Inc.