mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Added additional checks for A_SIGNED == B_SIGNED for cells with that constraint
This commit is contained in:
		
							parent
							
								
									1cd975ef8d
								
							
						
					
					
						commit
						15acf593e7
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -337,7 +337,7 @@ namespace { | ||||||
| 			expected_ports.insert(name); | 			expected_ports.insert(name); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		void check_expected() | 		void check_expected(bool check_matched_sign = true) | ||||||
| 		{ | 		{ | ||||||
| 			for (auto ¶ : cell->parameters) | 			for (auto ¶ : cell->parameters) | ||||||
| 				if (expected_params.count(para.first) == 0) | 				if (expected_params.count(para.first) == 0) | ||||||
|  | @ -345,6 +345,13 @@ namespace { | ||||||
| 			for (auto &conn : cell->connections) | 			for (auto &conn : cell->connections) | ||||||
| 				if (expected_ports.count(conn.first) == 0) | 				if (expected_ports.count(conn.first) == 0) | ||||||
| 					error(__LINE__); | 					error(__LINE__); | ||||||
|  | 
 | ||||||
|  | 			if (expected_params.count("\\A_SIGNED") != 0 && expected_params.count("\\B_SIGNED") && check_matched_sign) { | ||||||
|  | 				bool a_is_signed = param("\\A_SIGNED") != 0; | ||||||
|  | 				bool b_is_signed = param("\\B_SIGNED") != 0; | ||||||
|  | 				if (a_is_signed != b_is_signed) | ||||||
|  | 					error(__LINE__); | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		void check_gate(const char *ports) | 		void check_gate(const char *ports) | ||||||
|  | @ -403,7 +410,7 @@ namespace { | ||||||
| 				port("\\A", param("\\A_WIDTH")); | 				port("\\A", param("\\A_WIDTH")); | ||||||
| 				port("\\B", param("\\B_WIDTH")); | 				port("\\B", param("\\B_WIDTH")); | ||||||
| 				port("\\Y", param("\\Y_WIDTH")); | 				port("\\Y", param("\\Y_WIDTH")); | ||||||
| 				check_expected(); | 				check_expected(false); | ||||||
| 				return; | 				return; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | @ -425,7 +432,7 @@ namespace { | ||||||
| 				port("\\A", param("\\A_WIDTH")); | 				port("\\A", param("\\A_WIDTH")); | ||||||
| 				port("\\B", param("\\B_WIDTH")); | 				port("\\B", param("\\B_WIDTH")); | ||||||
| 				port("\\Y", param("\\Y_WIDTH")); | 				port("\\Y", param("\\Y_WIDTH")); | ||||||
| 				check_expected(); | 				check_expected(cell->type != "$pow"); | ||||||
| 				return; | 				return; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | @ -443,7 +450,7 @@ namespace { | ||||||
| 				port("\\A", param("\\A_WIDTH")); | 				port("\\A", param("\\A_WIDTH")); | ||||||
| 				port("\\B", param("\\B_WIDTH")); | 				port("\\B", param("\\B_WIDTH")); | ||||||
| 				port("\\Y", param("\\Y_WIDTH")); | 				port("\\Y", param("\\Y_WIDTH")); | ||||||
| 				check_expected(); | 				check_expected(false); | ||||||
| 				return; | 				return; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue