mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
check: Also check for conflicts with constant drivers
This commit is contained in:
parent
f9257d3192
commit
a07f8ac38a
2 changed files with 71 additions and 11 deletions
51
tests/various/constant_drive_conflict.ys
Normal file
51
tests/various/constant_drive_conflict.ys
Normal file
|
@ -0,0 +1,51 @@
|
|||
read_verilog <<EOT
|
||||
module top(input A, output Y);
|
||||
assign A = 1;
|
||||
|
||||
assign Y = A;
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
hierarchy -top top; proc
|
||||
|
||||
logger -expect warning "Drivers conflicting with a constant" 1
|
||||
logger -expect log "Found and reported 1 problems." 1
|
||||
check
|
||||
logger -check-expected
|
||||
|
||||
design -reset
|
||||
read_verilog <<EOT
|
||||
module top(input A, output Y);
|
||||
buffer some_buffer(A, Y);
|
||||
assign Y = 1;
|
||||
endmodule
|
||||
module buffer(input A, output Y);
|
||||
assign Y = A;
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
hierarchy -top top; proc
|
||||
|
||||
logger -expect warning "Drivers conflicting with a constant" 1
|
||||
logger -expect log "Found and reported 1 problems." 1
|
||||
check
|
||||
logger -check-expected
|
||||
|
||||
design -reset
|
||||
read_verilog <<EOT
|
||||
module top(input clk, input A, output Y);
|
||||
reg Q;
|
||||
always @(posedge clk) Q <= A;
|
||||
|
||||
assign Q = 1;
|
||||
|
||||
assign Y = A;
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
hierarchy -top top
|
||||
|
||||
logger -expect warning "Drivers conflicting with a constant" 1
|
||||
logger -expect log "Found and reported 1 problems." 1
|
||||
check
|
||||
logger -check-expected
|
Loading…
Add table
Add a link
Reference in a new issue