mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Disabled broken $mem support in verilog backend
This commit is contained in:
		
							parent
							
								
									e47218e9ea
								
							
						
					
					
						commit
						9e56739634
					
				
					 1 changed files with 11 additions and 11 deletions
				
			
		| 
						 | 
					@ -790,15 +790,15 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (cell->type == "$mem")
 | 
						if (cell->type == "$mem" && false) // FIXME!
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		RTLIL::IdString memid = cell->parameters["\\MEMID"].decode_string();
 | 
							RTLIL::IdString memid = cell->parameters["\\MEMID"].decode_string();
 | 
				
			||||||
		std::string mem_id = id( cell->parameters["\\MEMID"].decode_string() );
 | 
							std::string mem_id = id(cell->parameters["\\MEMID"].decode_string());
 | 
				
			||||||
		int abits = cell->parameters["\\ABITS"].as_int();
 | 
							int abits = cell->parameters["\\ABITS"].as_int();
 | 
				
			||||||
		int size = cell->parameters["\\SIZE"].as_int();
 | 
							int size = cell->parameters["\\SIZE"].as_int();
 | 
				
			||||||
		int width = cell->parameters["\\WIDTH"].as_int();
 | 
							int width = cell->parameters["\\WIDTH"].as_int();
 | 
				
			||||||
		int offset = cell->parameters["\\OFFSET"].as_int();
 | 
							int offset = cell->parameters["\\OFFSET"].as_int();
 | 
				
			||||||
		bool use_init = !(RTLIL::SigSpec( cell->parameters["\\INIT"] ).is_fully_undef());
 | 
							bool use_init = !(RTLIL::SigSpec(cell->parameters["\\INIT"]).is_fully_undef());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// for memory block make something like:
 | 
							// for memory block make something like:
 | 
				
			||||||
		//  reg [7:0] memid [3:0];
 | 
							//  reg [7:0] memid [3:0];
 | 
				
			||||||
| 
						 | 
					@ -849,8 +849,8 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
 | 
				
			||||||
				f << stringf(" <= %s[", mem_id.c_str());
 | 
									f << stringf(" <= %s[", mem_id.c_str());
 | 
				
			||||||
				dump_sigspec(f, sig_rd_addr);
 | 
									dump_sigspec(f, sig_rd_addr);
 | 
				
			||||||
				f << stringf("];\n");
 | 
									f << stringf("];\n");
 | 
				
			||||||
			}else{
 | 
								} else {
 | 
				
			||||||
				if (rd_transparent){
 | 
									if (rd_transparent) {
 | 
				
			||||||
					// for rd-transparent read-ports make something like:
 | 
										// for rd-transparent read-ports make something like:
 | 
				
			||||||
					//   reg [..] new-id;
 | 
										//   reg [..] new-id;
 | 
				
			||||||
					//   always @(posedge clk)
 | 
										//   always @(posedge clk)
 | 
				
			||||||
| 
						 | 
					@ -868,7 +868,7 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
 | 
				
			||||||
					f << stringf("%s" "assign ", indent.c_str());
 | 
										f << stringf("%s" "assign ", indent.c_str());
 | 
				
			||||||
					dump_sigspec(f, sig_rd_data);
 | 
										dump_sigspec(f, sig_rd_data);
 | 
				
			||||||
					f << stringf(" = %s[%s];\n", mem_id.c_str(), id(new_id).c_str());
 | 
										f << stringf(" = %s[%s];\n", mem_id.c_str(), id(new_id).c_str());
 | 
				
			||||||
				}else{
 | 
									} else {
 | 
				
			||||||
					// for non-clocked read-ports make something like:
 | 
										// for non-clocked read-ports make something like:
 | 
				
			||||||
					//   assign r_data = array_reg[r_addr];
 | 
										//   assign r_data = array_reg[r_addr];
 | 
				
			||||||
					f << stringf("%s" "assign ", indent.c_str());
 | 
										f << stringf("%s" "assign ", indent.c_str());
 | 
				
			||||||
| 
						 | 
					@ -905,12 +905,12 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
 | 
				
			||||||
			last_bit = sig_wr_en.extract(0);
 | 
								last_bit = sig_wr_en.extract(0);
 | 
				
			||||||
			lof_wen.append_bit(last_bit);
 | 
								lof_wen.append_bit(last_bit);
 | 
				
			||||||
			wen_to_width[last_bit] = 0;
 | 
								wen_to_width[last_bit] = 0;
 | 
				
			||||||
			for(int j=0; j<width; j++)
 | 
								for (int j=0; j<width; j++)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				current_bit = sig_wr_en.extract(j);
 | 
									current_bit = sig_wr_en.extract(j);
 | 
				
			||||||
				if ( sigmap(current_bit) == sigmap(last_bit) ){
 | 
									if (sigmap(current_bit) == sigmap(last_bit)){
 | 
				
			||||||
					wen_to_width[current_bit] += 1;
 | 
										wen_to_width[current_bit] += 1;
 | 
				
			||||||
				}else{
 | 
									} else {
 | 
				
			||||||
					lof_wen.append_bit(current_bit);
 | 
										lof_wen.append_bit(current_bit);
 | 
				
			||||||
					wen_to_width[current_bit] = 1;
 | 
										wen_to_width[current_bit] = 1;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
| 
						 | 
					@ -924,12 +924,12 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
 | 
				
			||||||
			n = 0;
 | 
								n = 0;
 | 
				
			||||||
			for (auto &wen_bit : lof_wen) {
 | 
								for (auto &wen_bit : lof_wen) {
 | 
				
			||||||
				wen_width = wen_to_width[wen_bit];
 | 
									wen_width = wen_to_width[wen_bit];
 | 
				
			||||||
				if ( !(wen_bit == RTLIL::SigBit(false)) )
 | 
									if (!(wen_bit == RTLIL::SigBit(false)))
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					f << stringf("%s" "always @(%sedge ", indent.c_str(), wr_clk_posedge ? "pos" : "neg");
 | 
										f << stringf("%s" "always @(%sedge ", indent.c_str(), wr_clk_posedge ? "pos" : "neg");
 | 
				
			||||||
					dump_sigspec(f, sig_wr_clk);
 | 
										dump_sigspec(f, sig_wr_clk);
 | 
				
			||||||
					f << stringf(")\n");
 | 
										f << stringf(")\n");
 | 
				
			||||||
					if ( !(wen_bit == RTLIL::SigBit(true)) )
 | 
										if (!(wen_bit == RTLIL::SigBit(true)))
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
						f << stringf("%s" "  if (", indent.c_str());
 | 
											f << stringf("%s" "  if (", indent.c_str());
 | 
				
			||||||
						dump_sigspec(f, wen_bit);
 | 
											dump_sigspec(f, wen_bit);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue