mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Modified $readmem[hb] to use '\' or '/' according the OS
Signed-off-by: Rodrigo Alejandro Melo <rmelo@inti.gob.ar>
This commit is contained in:
		
							parent
							
								
									665a967d87
								
							
						
					
					
						commit
						da485dc007
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2904,7 +2904,12 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
 | 
			
		|||
	std::ifstream f;
 | 
			
		||||
	f.open(mem_filename.c_str());
 | 
			
		||||
	if (f.fail()) {
 | 
			
		||||
		std::string path = filename.substr(0, filename.find_last_of("\\/")+1);
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
		char slash = '\\';
 | 
			
		||||
#else
 | 
			
		||||
		char slash = '/';
 | 
			
		||||
#endif
 | 
			
		||||
		std::string path = filename.substr(0, filename.find_last_of(slash)+1);
 | 
			
		||||
		f.open(path + mem_filename.c_str());
 | 
			
		||||
		yosys_input_files.insert(path + mem_filename);
 | 
			
		||||
	} else {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue