mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	memory_dff: Fix checking of feedback mux input when more than one mux
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
		
							parent
							
								
									d206eca03b
								
							
						
					
					
						commit
						d45936fe5f
					
				
					 3 changed files with 25 additions and 3 deletions
				
			
		
							
								
								
									
										16
									
								
								tests/memories/read_two_mux.v
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								tests/memories/read_two_mux.v
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
// expect-wr-ports 1
 | 
			
		||||
// expect-rd-ports 1
 | 
			
		||||
// expect-no-rd-clk
 | 
			
		||||
 | 
			
		||||
module top(input clk, input we, re, reset, input [7:0] addr, wdata, output reg [7:0] rdata);
 | 
			
		||||
 | 
			
		||||
reg [7:0] bram[0:255];
 | 
			
		||||
(* keep *) reg dummy;
 | 
			
		||||
 | 
			
		||||
always @(posedge clk) begin
 | 
			
		||||
	rdata <= re ? (reset ? 8'b0 : bram[addr]) : rdata;
 | 
			
		||||
	if (we)
 | 
			
		||||
		bram[addr] <= wdata;
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
endmodule
 | 
			
		||||
| 
						 | 
				
			
			@ -31,6 +31,10 @@ for f in `egrep -l 'expect-(wr-ports|rd-ports|rd-clk)' *.v`; do
 | 
			
		|||
		grep -q "connect \\\\RD_CLK \\$(gawk '/expect-rd-clk/ { print $3; }' $f)\$" ${f%.v}.dmp ||
 | 
			
		||||
				{ echo " ERROR: Unexpected read clock."; false; }
 | 
			
		||||
	fi
 | 
			
		||||
	if grep -q expect-no-rd-clk $f; then
 | 
			
		||||
		grep -q "connect \\\\RD_CLK 1'x\$" ${f%.v}.dmp ||
 | 
			
		||||
				{ echo " ERROR: Expected no read clock."; false; }
 | 
			
		||||
	fi
 | 
			
		||||
	echo " ok."
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue