mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Fix tmpdir naming when passing -nocleanup option to abc(9) on systems where base_tmpdir isn't /tmp/
This commit is contained in:
		
							parent
							
								
									dd4a0c3034
								
							
						
					
					
						commit
						da614fe13a
					
				
					 2 changed files with 12 additions and 6 deletions
				
			
		| 
						 | 
					@ -782,9 +782,12 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin
 | 
				
			||||||
	if (dff_mode && clk_sig.empty())
 | 
						if (dff_mode && clk_sig.empty())
 | 
				
			||||||
		log_cmd_error("Clock domain %s not found.\n", clk_str.c_str());
 | 
							log_cmd_error("Clock domain %s not found.\n", clk_str.c_str());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	std::string tempdir_name = get_base_tmpdir() + "/" + proc_program_prefix()+ "yosys-abc-XXXXXX";
 | 
						std::string tempdir_name;
 | 
				
			||||||
	if (!cleanup)
 | 
						if (cleanup) 
 | 
				
			||||||
		tempdir_name[0] = tempdir_name[4] = '_';
 | 
							tempdir_name = get_base_tmpdir() + "/";
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							tempdir_name = "_tmp_";
 | 
				
			||||||
 | 
						tempdir_name += proc_program_prefix() + "yosys-abc-XXXXXX";
 | 
				
			||||||
	tempdir_name = make_temp_dir(tempdir_name);
 | 
						tempdir_name = make_temp_dir(tempdir_name);
 | 
				
			||||||
	log_header(design, "Extracting gate netlist of module `%s' to `%s/input.blif'..\n",
 | 
						log_header(design, "Extracting gate netlist of module `%s' to `%s/input.blif'..\n",
 | 
				
			||||||
			module->name.c_str(), replace_tempdir(tempdir_name, tempdir_name, show_tempdir).c_str());
 | 
								module->name.c_str(), replace_tempdir(tempdir_name, tempdir_name, show_tempdir).c_str());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -404,9 +404,12 @@ struct Abc9Pass : public ScriptPass
 | 
				
			||||||
					if (!active_design->selected_whole_module(mod))
 | 
										if (!active_design->selected_whole_module(mod))
 | 
				
			||||||
						log_error("Can't handle partially selected module %s!\n", log_id(mod));
 | 
											log_error("Can't handle partially selected module %s!\n", log_id(mod));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					std::string tempdir_name = get_base_tmpdir() + "/" + proc_program_prefix() + "yosys-abc-XXXXXX";
 | 
										std::string tempdir_name;
 | 
				
			||||||
					if (!cleanup)
 | 
										if (cleanup) 
 | 
				
			||||||
						tempdir_name[0] = tempdir_name[4] = '_';
 | 
											tempdir_name = get_base_tmpdir() + "/";
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											tempdir_name = "_tmp_";
 | 
				
			||||||
 | 
										tempdir_name += proc_program_prefix() + "yosys-abc-XXXXXX";
 | 
				
			||||||
					tempdir_name = make_temp_dir(tempdir_name);
 | 
										tempdir_name = make_temp_dir(tempdir_name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					if (!lut_mode)
 | 
										if (!lut_mode)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue