|
|
|

|
|
|
|
|
|

|
|
 |
Wild equality and wild inequality
|
|
|
The wild equality operator (=?=) and inequality operator (!?=) treat X and Z values in a given bit position as a wildcard. A wildcard bit matches any bit value (0, 1,Z, or X) in the value of the expression being compared against it. |
|
|

|
|
|
|
|
|

|
|
 |
Example - Wild equality
|
|
|

|
|
|
1 module wild_equality_operator ();
2
3 bit [7:0] data = 8'hFF;
4
5 initial begin
6 // Compare with wild equality
7 if (data =?= 8'b1xxx_z1xz) begin
8 $display ("Data %b matches with %b", data, 8'b1xxx_z1xz);
9 end
10 // Compare with wild non-equality
11 if (data ! ?= 8'b1xxx_z1x0) begin
12 $display ("Data %b does not matches with %b", data, 8'b1xxx_z1x0);
13 end
14 #1 $finish;
15 end
16
17 endmodule
You could download file wild_equality_operator.sv here
|
|
|

|
|
 |
Simulator Output
|
|
|

|
|
|
Data 11111111 matches with 1xxxz1xz
Data 11111111 does not matches with 1xxxz1x0
|
|
|

|
|
|

|
|
|

|
|
|
|
|
|

|
|
|
|
|
|

|
|
Copyright © 1998-2025 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|