# Test 1: Input port with high fanout is reported # Input 'a' fans out to 5 output ports, limit is 3 => should warn for 'a' # Input 'b' fans out to 2 output ports (<= 3) => no warn for 'b' log -header "Input port fanout exceeds limit" log -push design -reset read_verilog < 3), 'b' has fanout 2 (<= 3) # Expect exactly one warning for input port 'a' logger -expect warning "\(top, a\) = 5" 1 report_fanout -limit 3 design -reset log -pop # Test 2: Cell output port with high fanout is reported # AND gate output fans out to 5 output ports, limit is 2 => should warn log -header "Cell output port fanout exceeds limit" log -push design -reset read_verilog < 2) # Input ports a and b each fan out to 1 cell input (<= 2), no warn for them logger -expect warning "\(top, .*, Y\) = 5" 1 report_fanout -limit 2 design -reset log -pop # Test 3: No warnings when all fanouts are within the limit log -header "No fanout exceeds limit" log -push design -reset read_verilog < two warnings log -header "Multiple cells with high fanout" log -push design -reset read_verilog < 1). Input 'a' fans out to 2 cell inputs (> 1). # Expect 3 warnings total. logger -expect warning "\(top, .*, Y\) = 3" 2 logger -expect warning "\(top, a\) = 2" 1 report_fanout -limit 1 design -reset log -pop # Test 5: Mixed - input port AND cell output both exceed limit log -header "Input port and cell output both exceed limit" log -push design -reset read_verilog < 2) # $logic_not Y fans out to 3 (> 2) logger -expect warning "\(top, a\) = 4" 1 logger -expect warning "\(top, .*, Y\) = 3" 1 report_fanout -limit 2 design -reset log -pop # Test 6: Clock and reset ports are excluded by default log -header "Clock and reset exclusion" log -push design -reset read_verilog <