mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	functional backend: make Memory in the C++ simulation library read-only again
This commit is contained in:
		
							parent
							
								
									99effb6789
								
							
						
					
					
						commit
						95d28c22a2
					
				
					 2 changed files with 17 additions and 5 deletions
				
			
		|  | @ -400,6 +400,8 @@ template<size_t a, size_t d> | |||
| class Memory { | ||||
|     std::array<Signal<d>, 1<<a> _contents; | ||||
| public: | ||||
|     Memory() {} | ||||
|     Memory(std::array<Signal<d>, 1<<a> const &contents) : _contents(contents) {} | ||||
|     Signal<d> read(Signal<a> addr) const | ||||
|     { | ||||
|         return _contents[addr.template as_numeric<size_t>()]; | ||||
|  | @ -410,9 +412,6 @@ public: | |||
|         ret._contents[addr.template as_numeric<size_t>()] = data; | ||||
|         return ret; | ||||
|     } | ||||
|     // mutating methods for initializing a state
 | ||||
|     void fill(Signal<d> data) { _contents.fill(data); } | ||||
|     Signal<d> &operator[](Signal<a> addr) { return _contents[addr.template as_numeric<size_t>()]; } | ||||
| }; | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue