mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			79 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| library(test) {
 | |
|   /* D-type flip-flop with asynchronous reset and preset */
 | |
|   cell (dffn) {
 | |
|     area : 6;
 | |
|     ff("IQ", "IQN") {
 | |
|       next_state : "D";
 | |
|       clocked_on : "!CLK";
 | |
|     }
 | |
|     pin(D) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(CLK) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(Q) {
 | |
|       direction: output;
 | |
|       function : "IQ";
 | |
|     }
 | |
|     pin(QN) {
 | |
|       direction: output;
 | |
|       function : "IQN";
 | |
|     }
 | |
|   }
 | |
|   cell (dffsr) {
 | |
|     area : 6;
 | |
|     ff("IQ", "IQN") {
 | |
|       next_state : "D";
 | |
|       clocked_on : "CLK";
 | |
|       clear      : "CLEAR";
 | |
|       preset     : "PRESET";
 | |
|       clear_preset_var1 : L;
 | |
|       clear_preset_var2 : L;
 | |
|     }
 | |
|     pin(D) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(CLK) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(CLEAR) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(PRESET) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(Q) {
 | |
|       direction: output;
 | |
|       function : "IQ";
 | |
|     }
 | |
|     pin(QN) {
 | |
|       direction: output;
 | |
|       function : "IQN";
 | |
|     }
 | |
|   }
 | |
|   cell (dffe) {
 | |
|     area : 6;
 | |
|     ff("IQ", "IQN") {
 | |
|       next_state : "(D EN) | (IQ !EN)";
 | |
|       clocked_on : "!CLK";
 | |
|     }
 | |
|     pin(D) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(EN) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(CLK) {
 | |
|       direction : input;
 | |
|     }
 | |
|     pin(Q) {
 | |
|       direction: output;
 | |
|       function : "IQ";
 | |
|     }
 | |
|     pin(QN) {
 | |
|       direction: output;
 | |
|       function : "IQN";
 | |
|     }
 | |
|   }
 | |
| }
 |