indexed part selects

From: Karen L. Pieper (pieper@synopsys.com)
Date: Tue May 26 1998 - 15:13:21 PDT


BAD MSG:
It turns out that the set of indexed part selects supported by HDLC is very
mall. It supports them when the index variable is the index in a for-loop,
and unrolling the loop provides the compiler with the ability to turn the
part selects into a constant. The following example works fine:
Content-Length: 875
X-Lines: 51
X-Status: $$$$
X-UID: 0000000486
Status: RO

module top(b);
    output [7:0] b;
    integer i;
    
    reg [31:0] a;
    reg [ 7:0] c;
    assign b = c;
    always @(a) begin
        for (i = 0; i <= 24; i = i + 1)
            c = a[i+7:i];
    end

endmodule

However, each of the following two cases do not work:

module top(b);
    output [7:0] b;
    integer i;
    
    reg [31:0] a;
    reg [ 7:0] c;
    assign b = c;
    always @(a) begin
        c = a[i+7:i];
    end

endmodule

dc_shell error:
Error: Can't get width of port A
        in call to '+'

module top(b);
    output [7:0] b;
    integer i;
    
    reg [31:0] a;

    assign b = a[i+7:i];
endmodule

dc_shell error:
Error: Can't get width of port A
        in call to '+'

So do we want to limit indexed part selects to unrollable loops where the
index is the same as the loop variable and unrolling completely determines
the accesses?

Karen



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:52:53 PDT and
sponsored by Boyd Technology, Inc.