mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix sign extension of pattern members, bug882.
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2015 by Iztok Jeras.
|
||||
|
||||
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); end while(0)
|
||||
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); $stop; end while(0)
|
||||
|
||||
module t (/*AUTOARG*/);
|
||||
module t (/*AUTOARG*/);
|
||||
|
||||
// signed source
|
||||
logic signed [8-1:0] src;
|
||||
@@ -17,13 +17,16 @@ module t (/*AUTOARG*/);
|
||||
} dst;
|
||||
|
||||
initial begin
|
||||
// bug882
|
||||
// verilator lint_off WIDTH
|
||||
src = 8'sh05;
|
||||
dst = '{s: src, u: src};
|
||||
`checkh (dst.s, 16'h0005);
|
||||
`checkh (dst.u, 16'h0005);
|
||||
|
||||
src = 8'shf5;
|
||||
dst = '{s: src, u: src};
|
||||
`checkh (dst.s, 16'hfff5);
|
||||
`checkh (dst.u, 16'hfff5);
|
||||
// verilator lint_on WIDTH
|
||||
|
||||
|
||||
Reference in New Issue
Block a user