[sv-bc] RE: Q: case selector wildcards in a localparam?

From: Rich, Dave <Dave_Rich@mentor.com>
Date: Wed Jul 02 2014 - 10:01:50 PDT
The '?' character in a numeric literal is simply the same as 'z'. It doesn't make any difference to the compiler.

It's the statements like casez or operators like ==? that treat the 'z' state as a don't-care.

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Seligman, Erik
Sent: Wednesday, July 02, 2014 9:46 AM
To: sv-bc@eda.org
Subject: [sv-bc] Q: case selector wildcards in a localparam?

Should the code below be legal?   I was surprised to find that some compilers accept it, though my interpretation of the standard is that the localparam needs to be a constant.


module localparam_case (input logic [7:0] i1,input logic clk,rst, output logic [7:0] o1);

localparam ugly =  7'b110_1???;

default clocking @(posedge clk); endclocking
default disable iff rst;

always_comb begin
casez (i1)
  ugly: o1 = 0;
  default: o1 = i1;
endcase
end

a1: assert property (o1 == i1);

endmodule


--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jul 2 10:02:08 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 02 2014 - 10:02:13 PDT