mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	dfflibmap: test negated state next_state with mixed polarities
This commit is contained in:
		
							parent
							
								
									73cbcffbbb
								
							
						
					
					
						commit
						7fe817c52f
					
				
					 2 changed files with 51 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -81,3 +81,19 @@ clean
 | 
			
		|||
select -assert-count 0 t:dffn
 | 
			
		||||
select -assert-count 5 t:dffsr
 | 
			
		||||
select -assert-count 1 t:dffe
 | 
			
		||||
 | 
			
		||||
design -load orig
 | 
			
		||||
dfflibmap -liberty dfflibmap.lib -liberty dfflibmap_dffsr_mixedpol.lib -dont_use dffsr
 | 
			
		||||
clean
 | 
			
		||||
# We have one more _NOT_ than with the regular dffsr
 | 
			
		||||
select -assert-count 6 t:$_NOT_
 | 
			
		||||
select -assert-count 1 t:dffn
 | 
			
		||||
select -assert-count 4 t:dffsr_mixedpol
 | 
			
		||||
select -assert-count 1 t:dffe
 | 
			
		||||
# The additional NOT is on ff2.
 | 
			
		||||
# Originally, ff2.R is an active high "set".
 | 
			
		||||
# dffsr_mixedpol has functionally swapped labels due to the next_state inversion,
 | 
			
		||||
# so we use its CLEAR port for the "set",
 | 
			
		||||
# but we have to invert it because the CLEAR pin is active low.
 | 
			
		||||
# ff2.CLEAR = !R
 | 
			
		||||
select -assert-count 1 c:ff2 %x:+[CLEAR] %ci t:$_NOT_ %i
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										35
									
								
								tests/techmap/dfflibmap_dffsr_mixedpol.lib
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								tests/techmap/dfflibmap_dffsr_mixedpol.lib
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,35 @@
 | 
			
		|||
library(test) {
 | 
			
		||||
  cell (dffsr_mixedpol) {
 | 
			
		||||
    area : 6;
 | 
			
		||||
    ff("IQ", "IQN") {
 | 
			
		||||
      // look here
 | 
			
		||||
      next_state : "!D";
 | 
			
		||||
      clocked_on : "CLK";
 | 
			
		||||
      // look here
 | 
			
		||||
      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";
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue