diff options
| author | Jim Lawson <ucbjrl@berkeley.edu> | 2019-04-09 13:41:58 -0700 | 
|---|---|---|
| committer | Jim Lawson <ucbjrl@berkeley.edu> | 2019-04-09 13:41:58 -0700 | 
| commit | 354ba5ba83f7b1fc3bb07aa6bf26dde7a00201d1 (patch) | |
| tree | 71722220d86997712e0543e79f63f46b32a1fa8c /frontends | |
| parent | efc3c13ec3409d77cdd7af87b609d94982eaeea5 (diff) | |
| parent | 0deaccbaae436bc94ad5b2913fa39a9368c09ace (diff) | |
| download | yosys-354ba5ba83f7b1fc3bb07aa6bf26dde7a00201d1.tar.gz yosys-354ba5ba83f7b1fc3bb07aa6bf26dde7a00201d1.tar.bz2 yosys-354ba5ba83f7b1fc3bb07aa6bf26dde7a00201d1.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'frontends')
| -rw-r--r-- | frontends/ilang/ilang_frontend.cc | 10 | ||||
| -rw-r--r-- | frontends/ilang/ilang_frontend.h | 1 | ||||
| -rw-r--r-- | frontends/ilang/ilang_parser.y | 6 | 
3 files changed, 14 insertions, 3 deletions
| diff --git a/frontends/ilang/ilang_frontend.cc b/frontends/ilang/ilang_frontend.cc index 6b302a796..30d9ff79d 100644 --- a/frontends/ilang/ilang_frontend.cc +++ b/frontends/ilang/ilang_frontend.cc @@ -47,16 +47,20 @@ struct IlangFrontend : public Frontend {  		log("    -nooverwrite\n");  		log("        ignore re-definitions of modules. (the default behavior is to\n");  		log("        create an error message if the existing module is not a blackbox\n"); -		log("        module, and overwrite the existing module if it is  a blackbox module.)\n"); +		log("        module, and overwrite the existing module if it is a blackbox module.)\n");  		log("\n");  		log("    -overwrite\n");  		log("        overwrite existing modules with the same name\n");  		log("\n"); +		log("    -lib\n"); +		log("        only create empty blackbox modules\n"); +		log("\n");  	}  	void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE  	{  		ILANG_FRONTEND::flag_nooverwrite = false;  		ILANG_FRONTEND::flag_overwrite = false; +		ILANG_FRONTEND::flag_lib = false;  		log_header(design, "Executing ILANG frontend.\n"); @@ -73,6 +77,10 @@ struct IlangFrontend : public Frontend {  				ILANG_FRONTEND::flag_overwrite = true;  				continue;  			} +			if (arg == "-lib") { +				ILANG_FRONTEND::flag_lib = true; +				continue; +			}  			break;  		}  		extra_args(f, filename, args, argidx); diff --git a/frontends/ilang/ilang_frontend.h b/frontends/ilang/ilang_frontend.h index 052dd4cb2..f8a152841 100644 --- a/frontends/ilang/ilang_frontend.h +++ b/frontends/ilang/ilang_frontend.h @@ -34,6 +34,7 @@ namespace ILANG_FRONTEND {  	extern RTLIL::Design *current_design;  	extern bool flag_nooverwrite;  	extern bool flag_overwrite; +	extern bool flag_lib;  }  YOSYS_NAMESPACE_END diff --git a/frontends/ilang/ilang_parser.y b/frontends/ilang/ilang_parser.y index 5bcc01f42..f83824088 100644 --- a/frontends/ilang/ilang_parser.y +++ b/frontends/ilang/ilang_parser.y @@ -37,7 +37,7 @@ namespace ILANG_FRONTEND {  	std::vector<std::vector<RTLIL::SwitchRule*>*> switch_stack;  	std::vector<RTLIL::CaseRule*> case_stack;  	dict<RTLIL::IdString, RTLIL::Const> attrbuf; -	bool flag_nooverwrite, flag_overwrite; +	bool flag_nooverwrite, flag_overwrite, flag_lib;  	bool delete_current_module;  }  using namespace ILANG_FRONTEND; @@ -98,7 +98,7 @@ module:  		delete_current_module = false;  		if (current_design->has($2)) {  			RTLIL::Module *existing_mod = current_design->module($2); -			if (!flag_overwrite && attrbuf.count("\\blackbox") && attrbuf.at("\\blackbox").as_bool()) { +			if (!flag_overwrite && (flag_lib || (attrbuf.count("\\blackbox") && attrbuf.at("\\blackbox").as_bool()))) {  				log("Ignoring blackbox re-definition of module %s.\n", $2);  				delete_current_module = true;  			} else if (!flag_nooverwrite && !flag_overwrite && !existing_mod->get_bool_attribute("\\blackbox")) { @@ -124,6 +124,8 @@ module:  		current_module->fixup_ports();  		if (delete_current_module)  			delete current_module; +		else if (flag_lib) +			current_module->makeblackbox();  		current_module = nullptr;  	} EOL; | 
