mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Improve Verific SVA importer
This commit is contained in:
		
							parent
							
								
									877ff1f75e
								
							
						
					
					
						commit
						c1cfca8f54
					
				
					 2 changed files with 42 additions and 7 deletions
				
			
		|  | @ -1275,6 +1275,40 @@ struct VerificSvaImporter | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		if (inst->Type() == PRIM_SVA_SEQ_CONCAT) | ||||||
|  | 		{ | ||||||
|  | 			int sva_low = atoi(inst->GetAttValue("sva:low")); | ||||||
|  | 			int sva_high = atoi(inst->GetAttValue("sva:low")); | ||||||
|  | 
 | ||||||
|  | 			if (sva_low != sva_high) | ||||||
|  | 				log_error("Ranges on SVA sequence concatenation operator are not supported at the moment.\n"); | ||||||
|  | 
 | ||||||
|  | 			parse_sequence(seq, inst->GetInput1()); | ||||||
|  | 
 | ||||||
|  | 			for (int i = 0; i < sva_low; i++) | ||||||
|  | 				sequence_ff(seq); | ||||||
|  | 
 | ||||||
|  | 			parse_sequence(seq, inst->GetInput2()); | ||||||
|  | 			return; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		if (inst->Type() == PRIM_SVA_CONSECUTIVE_REPEAT) | ||||||
|  | 		{ | ||||||
|  | 			int sva_low = atoi(inst->GetAttValue("sva:low")); | ||||||
|  | 			int sva_high = atoi(inst->GetAttValue("sva:low")); | ||||||
|  | 
 | ||||||
|  | 			if (sva_low != sva_high) | ||||||
|  | 				log_error("Ranges on SVA consecutive repeat operator are not supported at the moment.\n"); | ||||||
|  | 
 | ||||||
|  | 			parse_sequence(seq, inst->GetInput()); | ||||||
|  | 
 | ||||||
|  | 			for (int i = 1; i < sva_low; i++) { | ||||||
|  | 				sequence_ff(seq); | ||||||
|  | 				parse_sequence(seq, inst->GetInput()); | ||||||
|  | 			} | ||||||
|  | 			return; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		if (!importer->mode_keep) | 		if (!importer->mode_keep) | ||||||
| 			log_error("Unsupported Verific SVA primitive %s of type %s.\n", inst->Name(), inst->View()->Owner()->Name()); | 			log_error("Unsupported Verific SVA primitive %s of type %s.\n", inst->Name(), inst->View()->Owner()->Name()); | ||||||
| 		log_warning("Unsupported Verific SVA primitive %s of type %s.\n", inst->Name(), inst->View()->Owner()->Name()); | 		log_warning("Unsupported Verific SVA primitive %s of type %s.\n", inst->Name(), inst->View()->Owner()->Name()); | ||||||
|  |  | ||||||
|  | @ -11,19 +11,20 @@ module top (input clk, reset, up, down, output reg [7:0] cnt); | ||||||
| 	default clocking @(posedge clk); endclocking | 	default clocking @(posedge clk); endclocking | ||||||
| 	default disable iff (reset); | 	default disable iff (reset); | ||||||
| 
 | 
 | ||||||
| 	assert property (up |=> cnt == $past(cnt) + 8'd1); | 	assert property (up |=> cnt == $past(cnt) + 8'd 1); | ||||||
| 	// assert property (up [*2] |=> cnt == $past(cnt, 2) + 8'd2);
 | 	assert property (up [*2] |=> cnt == $past(cnt, 2) + 8'd 2); | ||||||
| 	// assert property (up ##1 up |=> cnt == $past(cnt, 2) + 8'd2);
 | 	assert property (up ##1 up |=> cnt == $past(cnt, 2) + 8'd 2); | ||||||
| 
 | 
 | ||||||
| `ifndef FAIL | `ifndef FAIL | ||||||
| 	assume property (down |-> !up); | 	assume property (down |-> !up); | ||||||
| `endif | `endif | ||||||
| 	assert property (down |=> cnt == $past(cnt) - 8'd1); | 	assert property (up ##1 down |=> cnt == $past(cnt, 2)); | ||||||
|  | 	assert property (down |=> cnt == $past(cnt) - 8'd 1); | ||||||
| 
 | 
 | ||||||
| 	property down_n(n); | 	property down_n(n); | ||||||
| 		down [*n] |=> cnt == $past(cnt, n) + n; | 		down [*n] |=> cnt == $past(cnt, n) - n; | ||||||
| 	endproperty | 	endproperty | ||||||
| 
 | 
 | ||||||
| 	// assert property (down_n(3));
 | 	assert property (down_n(8'd 3)); | ||||||
| 	// assert property (down_n(5));
 | 	assert property (down_n(8'd 5)); | ||||||
| endmodule | endmodule | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue