errata/527: Replication operator on concats involving function calls

From: Brad Pierce (Brad.Pierce@synopsys.com)
Date: Wed Jan 07 2004 - 14:40:00 PST

  • Next message: Brophy, Dennis: "RE: P1364-2005/D3 - updated"

    >Number: 527
    >Category: errata
    >Originator: "Brad Pierce" <Brad.Pierce@synopsys.com>
    >Description:

    In section (4.1.14) it says "If the replication operator is
    used on a function call ...". But this is inconsistent with the
    language of http://www.boyd.com/1364_btf/report/full_pr/73.html ,
    because a replication operator cannot be used on a function
    call, but only on a concatenation.

    It seems to me that it should not be legal to implement

             result = {4(func(w)}
    as
             result = { func(w), func(w), func(w), func(w) }

    and that if there's a side-effect in func, it should happen
    exactly once. That is, the replication operator should
    replicate the value of the concatentation. Otherwise, why can't
    the result of the replication operator be used as an lvalue?

    For example, shouldn't the following example unambiguously yield
    |0001000100010001|, even though Verilog-XL didn't do it that way?

    module m (o);
    output [15:0] o ;
    reg [15:0] o ;
    reg [3:0] t;

      function [3:0] f ;
      input i ;
      begin
        t = t + i ;
        f = t ;
      end
      endfunction

      initial begin
        t = 0 ;
        o = {4{f(1'b1)}} ;
        $display("|%b|", o) ;
      end

    endmodule

    Is replication an operator or syntactic sugar? If syntactic sugar,
    why not allow it in lvalues?

    -- Brad

       
             



    This archive was generated by hypermail 2.1.4 : Wed Jan 07 2004 - 14:40:08 PST and
    sponsored by Boyd Technology, Inc.