mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	cellref: Better name checking
Fix RTD not including source with warning
`WARNING: invalid signature for autocellsource ('/home/docs/checkouts/readthedocs.org/user_builds/yosys/checkouts/manual-rewrite/source/generated/simlib.v:$alu::__source')`.
			
			
This commit is contained in:
		
							parent
							
								
									ccd3bace23
								
							
						
					
					
						commit
						84f2968031
					
				
					 1 changed files with 17 additions and 3 deletions
				
			
		|  | @ -14,7 +14,7 @@ logger = logging.getLogger(__name__) | ||||||
| 
 | 
 | ||||||
| # cell signature | # cell signature | ||||||
| cell_ext_sig_re = re.compile( | cell_ext_sig_re = re.compile( | ||||||
|     r'''^ (?:([\w._/]+):)?       # explicit file name |     r'''^ (?:([^:\s]+):)?        # explicit file name | ||||||
|           ([\w$._]+?)?           # module and/or class name(s) |           ([\w$._]+?)?           # module and/or class name(s) | ||||||
|           (?:\.([\w_]+))?        # optional: thing name |           (?:\.([\w_]+))?        # optional: thing name | ||||||
|           (::[\w_]+)?            #           attribute |           (::[\w_]+)?            #           attribute | ||||||
|  | @ -147,9 +147,18 @@ class YosysCellDocumenter(Documenter): | ||||||
|         try: |         try: | ||||||
|             parsed_lib = self.parsed_libs[objpath] |             parsed_lib = self.parsed_libs[objpath] | ||||||
|         except KeyError: |         except KeyError: | ||||||
|             parsed_lib = load_cell_lib(objpath) |             try: | ||||||
|  |                 parsed_lib = load_cell_lib(objpath) | ||||||
|  |             except FileNotFoundError: | ||||||
|  |                 logger.warning( | ||||||
|  |                     f"unable to find cell lib at {'/'.join(self.objpath)}", | ||||||
|  |                     type = 'cellref', | ||||||
|  |                     subtype = 'import_object' | ||||||
|  |                 ) | ||||||
|  |                 return False | ||||||
|             self.parsed_libs[objpath] = parsed_lib |             self.parsed_libs[objpath] = parsed_lib | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|         # get cell |         # get cell | ||||||
|         try: |         try: | ||||||
|             self.object = parsed_lib[self.modname] |             self.object = parsed_lib[self.modname] | ||||||
|  | @ -264,7 +273,12 @@ class YosysCellDocumenter(Documenter): | ||||||
|             ) |             ) | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         self.import_object() |         if not self.import_object(): | ||||||
|  |             logger.warning( | ||||||
|  |                 f"unable to load {self.name}", | ||||||
|  |                 type = 'cellref' | ||||||
|  |             ) | ||||||
|  |             return | ||||||
| 
 | 
 | ||||||
|         # check __module__ of object (for members not given explicitly) |         # check __module__ of object (for members not given explicitly) | ||||||
|         # if check_module: |         # if check_module: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue