mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Merge remote-tracking branch 'origin/master' into xaig
This commit is contained in:
		
						commit
						1abe93e48d
					
				
					 15 changed files with 447 additions and 60 deletions
				
			
		| 
						 | 
				
			
			@ -372,6 +372,18 @@ void json_import(Design *design, string &modname, JsonNode *node)
 | 
			
		|||
			if (wire == nullptr)
 | 
			
		||||
				wire = module->addWire(net_name, GetSize(bits_node->data_array));
 | 
			
		||||
 | 
			
		||||
			if (net_node->data_dict.count("upto") != 0) {
 | 
			
		||||
				JsonNode *val = net_node->data_dict.at("upto");
 | 
			
		||||
				if (val->type == 'N')
 | 
			
		||||
					wire->upto = val->data_number != 0;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (net_node->data_dict.count("offset") != 0) {
 | 
			
		||||
				JsonNode *val = net_node->data_dict.at("offset");
 | 
			
		||||
				if (val->type == 'N')
 | 
			
		||||
					wire->start_offset = val->data_number;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			for (int i = 0; i < GetSize(bits_node->data_array); i++)
 | 
			
		||||
			{
 | 
			
		||||
				JsonNode *bitval_node = bits_node->data_array.at(i);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -204,7 +204,7 @@ AstNode *VERILOG_FRONTEND::const2ast(std::string code, char case_type, bool warn
 | 
			
		|||
	{
 | 
			
		||||
		std::vector<RTLIL::State> data;
 | 
			
		||||
		bool is_signed = false;
 | 
			
		||||
		bool is_unsized = false;
 | 
			
		||||
		bool is_unsized = len_in_bits < 0;
 | 
			
		||||
		if (*(endptr+1) == 's') {
 | 
			
		||||
			is_signed = true;
 | 
			
		||||
			endptr++;
 | 
			
		||||
| 
						 | 
				
			
			@ -213,25 +213,25 @@ AstNode *VERILOG_FRONTEND::const2ast(std::string code, char case_type, bool warn
 | 
			
		|||
		{
 | 
			
		||||
		case 'b':
 | 
			
		||||
		case 'B':
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 2, case_type, false);
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 2, case_type, is_unsized);
 | 
			
		||||
			break;
 | 
			
		||||
		case 'o':
 | 
			
		||||
		case 'O':
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 8, case_type, false);
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 8, case_type, is_unsized);
 | 
			
		||||
			break;
 | 
			
		||||
		case 'd':
 | 
			
		||||
		case 'D':
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 10, case_type, false);
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 10, case_type, is_unsized);
 | 
			
		||||
			break;
 | 
			
		||||
		case 'h':
 | 
			
		||||
		case 'H':
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 16, case_type, false);
 | 
			
		||||
			my_strtobin(data, endptr+2, len_in_bits, 16, case_type, is_unsized);
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			char next_char = char(tolower(*(endptr+1)));
 | 
			
		||||
			if (next_char == '0' || next_char == '1' || next_char == 'x' || next_char == 'z') {
 | 
			
		||||
				my_strtobin(data, endptr+1, 1, 2, case_type, true);
 | 
			
		||||
				is_unsized = true;
 | 
			
		||||
				my_strtobin(data, endptr+1, 1, 2, case_type, is_unsized);
 | 
			
		||||
			} else {
 | 
			
		||||
				return NULL;
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -517,6 +517,7 @@ wire_type_token:
 | 
			
		|||
	TOK_GENVAR {
 | 
			
		||||
		astbuf3->type = AST_GENVAR;
 | 
			
		||||
		astbuf3->is_reg = true;
 | 
			
		||||
		astbuf3->is_signed = true;
 | 
			
		||||
		astbuf3->range_left = 31;
 | 
			
		||||
		astbuf3->range_right = 0;
 | 
			
		||||
	} |
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue