mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	ice40: Fix SPRAM model to keep data stable if chipselect is low
According to the official simulation model, and also cross-checked on real hardware, the data output of the SPRAM when chipselect is low is kept stable. It doesn't go undefined. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
		
							parent
							
								
									acb341745d
								
							
						
					
					
						commit
						acd9eeef7c
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
					@ -2350,18 +2350,21 @@ module SB_SPRAM256KA (
 | 
				
			||||||
		if (off) begin
 | 
							if (off) begin
 | 
				
			||||||
			DATAOUT <= 0;
 | 
								DATAOUT <= 0;
 | 
				
			||||||
		end else
 | 
							end else
 | 
				
			||||||
		if (CHIPSELECT && !STANDBY && !WREN) begin
 | 
							if (STANDBY) begin
 | 
				
			||||||
 | 
								DATAOUT <= 'bx;
 | 
				
			||||||
 | 
							end else
 | 
				
			||||||
 | 
							if (CHIPSELECT) begin
 | 
				
			||||||
 | 
								if (!WREN) begin
 | 
				
			||||||
				DATAOUT <= mem[ADDRESS];
 | 
									DATAOUT <= mem[ADDRESS];
 | 
				
			||||||
			end else begin
 | 
								end else begin
 | 
				
			||||||
			if (CHIPSELECT && !STANDBY && WREN) begin
 | 
					 | 
				
			||||||
				if (MASKWREN[0]) mem[ADDRESS][ 3: 0] = DATAIN[ 3: 0];
 | 
									if (MASKWREN[0]) mem[ADDRESS][ 3: 0] = DATAIN[ 3: 0];
 | 
				
			||||||
				if (MASKWREN[1]) mem[ADDRESS][ 7: 4] = DATAIN[ 7: 4];
 | 
									if (MASKWREN[1]) mem[ADDRESS][ 7: 4] = DATAIN[ 7: 4];
 | 
				
			||||||
				if (MASKWREN[2]) mem[ADDRESS][11: 8] = DATAIN[11: 8];
 | 
									if (MASKWREN[2]) mem[ADDRESS][11: 8] = DATAIN[11: 8];
 | 
				
			||||||
				if (MASKWREN[3]) mem[ADDRESS][15:12] = DATAIN[15:12];
 | 
									if (MASKWREN[3]) mem[ADDRESS][15:12] = DATAIN[15:12];
 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
				DATAOUT <= 'bx;
 | 
									DATAOUT <= 'bx;
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
`endif
 | 
					`endif
 | 
				
			||||||
`endif
 | 
					`endif
 | 
				
			||||||
`ifdef ICE40_U
 | 
					`ifdef ICE40_U
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue