mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Merge pull request #1072 from YosysHQ/eddie/fix_1069
Error out if no top module given before 'sim'
This commit is contained in:
		
						commit
						50e2dce5e7
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -88,6 +88,8 @@ struct SimInstance
 | 
				
			||||||
	SimInstance(SimShared *shared, Module *module, Cell *instance = nullptr, SimInstance *parent = nullptr) :
 | 
						SimInstance(SimShared *shared, Module *module, Cell *instance = nullptr, SimInstance *parent = nullptr) :
 | 
				
			||||||
			shared(shared), module(module), instance(instance), parent(parent), sigmap(module)
 | 
								shared(shared), module(module), instance(instance), parent(parent), sigmap(module)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							log_assert(module);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (parent) {
 | 
							if (parent) {
 | 
				
			||||||
			log_assert(parent->children.count(instance) == 0);
 | 
								log_assert(parent->children.count(instance) == 0);
 | 
				
			||||||
			parent->children[instance] = this;
 | 
								parent->children[instance] = this;
 | 
				
			||||||
| 
						 | 
					@ -848,6 +850,9 @@ struct SimPass : public Pass {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (design->full_selection()) {
 | 
							if (design->full_selection()) {
 | 
				
			||||||
			top_mod = design->top_module();
 | 
								top_mod = design->top_module();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (!top_mod)
 | 
				
			||||||
 | 
									log_cmd_error("Design has no top module, use the 'hierarchy' command to specify one.\n");
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			auto mods = design->selected_whole_modules();
 | 
								auto mods = design->selected_whole_modules();
 | 
				
			||||||
			if (GetSize(mods) != 1)
 | 
								if (GetSize(mods) != 1)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue