Re: BTF - B13 - Mutable part selects proposal

From: Adam Krolnik (adamk@cyrix.com)
Date: Mon Jul 20 1998 - 02:12:17 PDT


Good afternoon,

I do not feel the specification of an index, and a width is clear, without
knowing the declaration of the element. At the least, the expression
is error prone - Consider:

reg [0:31] downto;
reg [31:0] upto;

begin
if (downto[8::8] == up[16::8]) // What did I just do?
// 15:8 9:16
// 1:8 16:23 if downto was really 31:0 and upto was 0:31.

One other thought, base::width or base+:width explicitly bars this case.

[26 : 26 - 15 - 4]

So should we remove this offending case?

>constant_difference ::=
> "common_sub"expression + constant_expression : "common_sub"expression
> | constant_expression + "common_sub"expression : "common_sub"expression
> | "common_sub"expression : constant_expression + "common_"sub"expression
> | "common_sub"expression : "common_"sub"expression + constant_expression

<p>Remember, these are the alternatives:

//Set the ith byte in the qword to the new valid byte.
qword_data = (qword_data & ~(8'hff << 8*ith)) | valid_byte[7:0] << 8*ith);

or
case (ith)
  0: qword_data[63:56] = valid_byte[7:0];
  1: qword_data[55:48] = valid_byte[7:0];
  2: qword_data[47:40] = valid_byte[7:0];
  3: qword_data[39:32] = valid_byte[7:0];
  4: qword_data[31:24] = valid_byte[7:0];
  5: qword_data[23:16] = valid_byte[7:0];
  6: qword_data[15:8] = valid_byte[7:0];
  7: qword_data[7:0] = valid_byte[7:0];
endcase

<p><p> Adam Krolnik
     Verification Engineer
     Cyrix - NSM.
     Richardson TX. 75085



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