2025-03-04 16:12:02 +01:00
// DESCRIPTION: Verilator: Verilog Test module
//
2026-01-27 02:24:34 +01:00
// This file ONLY is placed under the Creative Commons Public Domain
// SPDX-FileCopyrightText: 2025 Antmicro
2025-03-04 16:12:02 +01:00
// SPDX-License-Identifier: CC0-1.0
2025-12-21 03:46:43 +01:00
// verilog_format: off
`define stop $stop
`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)
// verilog_format: on
2025-03-04 16:12:02 +01:00
2026-03-08 23:26:40 +01:00
module t ;
2025-03-04 16:12:02 +01:00
reg [ 1 : 0 ] a = 0 ;
reg [ 1 : 0 ] b = 2 ;
initial begin
2026-03-08 23:26:40 +01:00
force b = a ;
`checkh ( a , 0 ) ;
`checkh ( b , 0 ) ;
2025-03-04 16:12:02 +01:00
end
initial begin
# 1 ;
`checkh ( b , 0 ) ;
a = 1 ;
# 1 ;
`checkh ( a , 1 ) ;
`checkh ( b , 1 ) ;
a = 3 ;
# 1 ;
`checkh ( a , 3 ) ;
`checkh ( b , 3 ) ;
release b ;
`checkh ( a , 3 ) ;
`checkh ( b , 3 ) ;
b = 0 ;
# 1 ;
`checkh ( b , 0 ) ;
# 1 $finish ;
end
endmodule