mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Use filter instead of index; support wide enable muxes
This commit is contained in:
		
							parent
							
								
									fe5a1324c9
								
							
						
					
					
						commit
						7bd55f379c
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -66,9 +66,11 @@ endcode
 | 
				
			||||||
match ffAmux
 | 
					match ffAmux
 | 
				
			||||||
	if ffA
 | 
						if ffA
 | 
				
			||||||
	select ffAmux->type.in($mux)
 | 
						select ffAmux->type.in($mux)
 | 
				
			||||||
 | 
						filter GetSize(port(ffAmux, \Y)) >= GetSize(sigA)
 | 
				
			||||||
 | 
						slice offset GetSize(port(ffAmux, \Y))
 | 
				
			||||||
 | 
						filter offset+GetSize(sigA) <= GetSize(port(ffAmux, \Y)) && port(ffAmux, \Y).extract(offset, GetSize(sigA)) == sigA
 | 
				
			||||||
	choice <IdString> AB {\A, \B}
 | 
						choice <IdString> AB {\A, \B}
 | 
				
			||||||
	index <SigSpec> port(ffAmux, \Y) === sigA
 | 
						filter offset+GetSize(sigffAmux) <= GetSize(port(ffAmux, \Y)) && port(ffAmux, AB).extract(offset, GetSize(sigffAmux)) == sigffAmux
 | 
				
			||||||
	index <SigSpec> port(ffAmux, AB) === sigffAmux
 | 
					 | 
				
			||||||
	set ffAmuxAB AB
 | 
						set ffAmuxAB AB
 | 
				
			||||||
	semioptional
 | 
						semioptional
 | 
				
			||||||
endmatch
 | 
					endmatch
 | 
				
			||||||
| 
						 | 
					@ -105,9 +107,11 @@ endcode
 | 
				
			||||||
match ffBmux
 | 
					match ffBmux
 | 
				
			||||||
	if ffB
 | 
						if ffB
 | 
				
			||||||
	select ffBmux->type.in($mux)
 | 
						select ffBmux->type.in($mux)
 | 
				
			||||||
 | 
						filter GetSize(port(ffBmux, \Y)) >= GetSize(sigB)
 | 
				
			||||||
 | 
						slice offset GetSize(port(ffBmux, \Y))
 | 
				
			||||||
 | 
						filter offset+GetSize(sigB) <= GetSize(port(ffBmux, \Y)) && port(ffBmux, \Y).extract(offset, GetSize(sigB)) == sigB
 | 
				
			||||||
	choice <IdString> AB {\A, \B}
 | 
						choice <IdString> AB {\A, \B}
 | 
				
			||||||
	index <SigSpec> port(ffBmux, \Y) === sigB
 | 
						filter offset+GetSize(sigffBmux) <= GetSize(port(ffBmux, \Y)) && port(ffBmux, AB).extract(offset, GetSize(sigffBmux)) == sigffBmux
 | 
				
			||||||
	index <SigSpec> port(ffBmux, AB) === sigffBmux
 | 
					 | 
				
			||||||
	set ffBmuxAB AB
 | 
						set ffBmuxAB AB
 | 
				
			||||||
	semioptional
 | 
						semioptional
 | 
				
			||||||
endmatch
 | 
					endmatch
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue