mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	stat: allow gzipped liberty files
This commit is contained in:
		
							parent
							
								
									7aefd4b226
								
							
						
					
					
						commit
						980a0a15c1
					
				
					 2 changed files with 19 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -23,6 +23,7 @@
 | 
			
		|||
#include "kernel/celltypes.h"
 | 
			
		||||
#include "passes/techmap/libparse.h"
 | 
			
		||||
#include "kernel/cost.h"
 | 
			
		||||
#include "kernel/gzip.h"
 | 
			
		||||
#include "libs/json11/json11.hpp"
 | 
			
		||||
 | 
			
		||||
USING_YOSYS_NAMESPACE
 | 
			
		||||
| 
						 | 
				
			
			@ -347,13 +348,12 @@ statdata_t hierarchy_worker(std::map<RTLIL::IdString, statdata_t> &mod_stat, RTL
 | 
			
		|||
 | 
			
		||||
void read_liberty_cellarea(dict<IdString, cell_area_t> &cell_area, string liberty_file)
 | 
			
		||||
{
 | 
			
		||||
	std::ifstream f;
 | 
			
		||||
	f.open(liberty_file.c_str());
 | 
			
		||||
	std::istream* f = uncompressed(liberty_file.c_str());
 | 
			
		||||
	yosys_input_files.insert(liberty_file);
 | 
			
		||||
	if (f.fail())
 | 
			
		||||
	if (f->fail())
 | 
			
		||||
		log_cmd_error("Can't open liberty file `%s': %s\n", liberty_file.c_str(), strerror(errno));
 | 
			
		||||
	LibertyParser libparser(f);
 | 
			
		||||
	f.close();
 | 
			
		||||
	LibertyParser libparser(*f);
 | 
			
		||||
	delete f;
 | 
			
		||||
 | 
			
		||||
	for (auto cell : libparser.ast->children)
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue