mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	dft_tag: Implement $overwrite_tag and $original_tag
				
					
				
			This does not correctly handle an `$overwrite_tag` on a module output, but since we currently require the user to flatten the design for cross-module dft, this cannot be observed from within the design, only by manually inspecting the signals in the design.
This commit is contained in:
		
							parent
							
								
									78ff40d1b2
								
							
						
					
					
						commit
						62b4df4989
					
				
					 4 changed files with 124 additions and 24 deletions
				
			
		|  | @ -3280,13 +3280,13 @@ RTLIL::SigSpec RTLIL::Module::Initstate(RTLIL::IdString name, const std::string | |||
| 	return sig; | ||||
| } | ||||
| 
 | ||||
| RTLIL::SigSpec RTLIL::Module::SetTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src) | ||||
| RTLIL::SigSpec RTLIL::Module::SetTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src) | ||||
| { | ||||
| 	RTLIL::SigSpec sig = addWire(NEW_ID, sig_e.size()); | ||||
| 	RTLIL::SigSpec sig = addWire(NEW_ID, sig_a.size()); | ||||
| 	Cell *cell = addCell(name, ID($set_tag)); | ||||
| 	cell->parameters[ID::WIDTH] = sig_e.size(); | ||||
| 	cell->parameters[ID::WIDTH] = sig_a.size(); | ||||
| 	cell->parameters[ID::TAG] = tag; | ||||
| 	cell->setPort(ID::A, sig_e); | ||||
| 	cell->setPort(ID::A, sig_a); | ||||
| 	cell->setPort(ID::SET, sig_s); | ||||
| 	cell->setPort(ID::CLR, sig_c); | ||||
| 	cell->setPort(ID::Y, sig); | ||||
|  | @ -3294,37 +3294,50 @@ RTLIL::SigSpec RTLIL::Module::SetTag(RTLIL::IdString name, const std::string &ta | |||
| 	return sig; | ||||
| } | ||||
| 
 | ||||
| RTLIL::SigSpec RTLIL::Module::GetTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const std::string &src) | ||||
| RTLIL::Cell* RTLIL::Module::addSetTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const RTLIL::SigSpec &sig_y, const std::string &src) | ||||
| { | ||||
| 	RTLIL::SigSpec sig = addWire(NEW_ID, sig_e.size()); | ||||
| 	Cell *cell = addCell(name, ID($get_tag)); | ||||
| 	cell->parameters[ID::WIDTH] = sig_e.size(); | ||||
| 	Cell *cell = addCell(name, ID($set_tag)); | ||||
| 	cell->parameters[ID::WIDTH] = sig_a.size(); | ||||
| 	cell->parameters[ID::TAG] = tag; | ||||
| 	cell->setPort(ID::A, sig_e); | ||||
| 	cell->setPort(ID::A, sig_a); | ||||
| 	cell->setPort(ID::SET, sig_s); | ||||
| 	cell->setPort(ID::CLR, sig_c); | ||||
| 	cell->setPort(ID::Y, sig_y); | ||||
| 	cell->set_src_attribute(src); | ||||
| 	return cell; | ||||
| } | ||||
| 
 | ||||
| RTLIL::SigSpec RTLIL::Module::GetTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const std::string &src) | ||||
| { | ||||
| 	RTLIL::SigSpec sig = addWire(NEW_ID, sig_a.size()); | ||||
| 	Cell *cell = addCell(name, ID($get_tag)); | ||||
| 	cell->parameters[ID::WIDTH] = sig_a.size(); | ||||
| 	cell->parameters[ID::TAG] = tag; | ||||
| 	cell->setPort(ID::A, sig_a); | ||||
| 	cell->setPort(ID::Y, sig); | ||||
| 	cell->set_src_attribute(src); | ||||
| 	return sig; | ||||
| } | ||||
| 
 | ||||
| RTLIL::Cell* RTLIL::Module::addOverwriteTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src) | ||||
| RTLIL::Cell* RTLIL::Module::addOverwriteTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src) | ||||
| { | ||||
| 	RTLIL::Cell *cell = addCell(name, ID($overwrite_tag)); | ||||
| 	cell->parameters[ID::WIDTH] = sig_e.size(); | ||||
| 	cell->parameters[ID::WIDTH] = sig_a.size(); | ||||
| 	cell->parameters[ID::TAG] = tag; | ||||
| 	cell->setPort(ID::A, sig_e); | ||||
| 	cell->setPort(ID::A, sig_a); | ||||
| 	cell->setPort(ID::SET, sig_s); | ||||
| 	cell->setPort(ID::CLR, sig_c); | ||||
| 	cell->set_src_attribute(src); | ||||
| 	return cell; | ||||
| } | ||||
| 
 | ||||
| RTLIL::SigSpec RTLIL::Module::OriginalTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const std::string &src) | ||||
| RTLIL::SigSpec RTLIL::Module::OriginalTag(RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const std::string &src) | ||||
| { | ||||
| 	RTLIL::SigSpec sig = addWire(NEW_ID, sig_e.size()); | ||||
| 	RTLIL::SigSpec sig = addWire(NEW_ID, sig_a.size()); | ||||
| 	Cell *cell = addCell(name, ID($original_tag)); | ||||
| 	cell->parameters[ID::WIDTH] = sig_e.size(); | ||||
| 	cell->parameters[ID::WIDTH] = sig_a.size(); | ||||
| 	cell->parameters[ID::TAG] = tag; | ||||
| 	cell->setPort(ID::A, sig_e); | ||||
| 	cell->setPort(ID::A, sig_a); | ||||
| 	cell->setPort(ID::Y, sig); | ||||
| 	cell->set_src_attribute(src); | ||||
| 	return sig; | ||||
|  |  | |||
|  | @ -1465,10 +1465,11 @@ public: | |||
| 	RTLIL::SigSpec Allseq    (RTLIL::IdString name, int width = 1, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec Initstate (RTLIL::IdString name, const std::string &src = ""); | ||||
| 
 | ||||
| 	RTLIL::SigSpec SetTag          (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec GetTag          (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const std::string &src = ""); | ||||
| 	RTLIL::Cell*   addOverwriteTag (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec OriginalTag     (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_e, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec SetTag          (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src = ""); | ||||
| 	RTLIL::Cell*   addSetTag       (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const RTLIL::SigSpec &sig_y, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec GetTag          (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const std::string &src = ""); | ||||
| 	RTLIL::Cell*   addOverwriteTag (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_s, const RTLIL::SigSpec &sig_c, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec OriginalTag     (RTLIL::IdString name, const std::string &tag, const RTLIL::SigSpec &sig_a, const std::string &src = ""); | ||||
| 	RTLIL::SigSpec FutureFF        (RTLIL::IdString name, const RTLIL::SigSpec &sig_e, const std::string &src = ""); | ||||
| 
 | ||||
| #ifdef WITH_PYTHON | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue