mirror of https://github.com/YosysHQ/yosys.git
clockgate: add test liberty file
This commit is contained in:
parent
c921d85a85
commit
1e3f8cc630
|
@ -0,0 +1,107 @@
|
|||
library(test) {
|
||||
/* Integrated clock gating cells */
|
||||
cell (pos_big) {
|
||||
area : 10;
|
||||
clock_gating_integrated_cell : latch_posedge;
|
||||
pin (GCLK) {
|
||||
clock_gate_out_pin : true;
|
||||
direction : output;
|
||||
}
|
||||
pin (CLK) {
|
||||
clock_gate_clock_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (CE) {
|
||||
clock_gate_enable_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
}
|
||||
cell (pos_small_tielo) {
|
||||
area : 1;
|
||||
clock_gating_integrated_cell : latch_posedge_precontrol;
|
||||
pin (GCLK) {
|
||||
clock_gate_out_pin : true;
|
||||
direction : output;
|
||||
}
|
||||
pin (CLK) {
|
||||
clock_gate_clock_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (CE) {
|
||||
clock_gate_enable_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (SE) {
|
||||
clock_gate_test_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
}
|
||||
cell (pos_small) {
|
||||
area : 1;
|
||||
clock_gating_integrated_cell : latch_posedge;
|
||||
pin (GCLK) {
|
||||
clock_gate_out_pin : true;
|
||||
direction : output;
|
||||
}
|
||||
pin (CLK) {
|
||||
clock_gate_clock_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (CE) {
|
||||
clock_gate_enable_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
}
|
||||
cell (neg_big) {
|
||||
area : 10;
|
||||
clock_gating_integrated_cell : latch_negedge;
|
||||
pin (GCLK) {
|
||||
clock_gate_out_pin : true;
|
||||
direction : output;
|
||||
}
|
||||
pin (CLK) {
|
||||
clock_gate_clock_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (CE) {
|
||||
clock_gate_enable_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
}
|
||||
cell (neg_small_tielo) {
|
||||
area : 1;
|
||||
clock_gating_integrated_cell : latch_negedge_precontrol;
|
||||
pin (GCLK) {
|
||||
clock_gate_out_pin : true;
|
||||
direction : output;
|
||||
}
|
||||
pin (CLK) {
|
||||
clock_gate_clock_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (CE) {
|
||||
clock_gate_enable_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (SE) {
|
||||
clock_gate_test_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
}
|
||||
cell (neg_small) {
|
||||
area : 1;
|
||||
clock_gating_integrated_cell : latch_negedge;
|
||||
pin (GCLK) {
|
||||
clock_gate_out_pin : true;
|
||||
direction : output;
|
||||
}
|
||||
pin (CLK) {
|
||||
clock_gate_clock_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
pin (CE) {
|
||||
clock_gate_enable_pin : true;
|
||||
direction : input;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -193,4 +193,42 @@ select -assert-count 1 t:\\pdk_icg
|
|||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# TODO test -tie_lo
|
||||
design -load before
|
||||
clockgate -liberty clockgate.lib
|
||||
|
||||
# rising edge ICGs
|
||||
select -module dffe_00 -assert-count 0 t:\\pos_small
|
||||
select -module dffe_01 -assert-count 0 t:\\pos_small
|
||||
|
||||
select -module dffe_10 -assert-count 1 t:\\pos_small
|
||||
select -module dffe_11 -assert-count 1 t:\\pos_small
|
||||
|
||||
# falling edge ICGs
|
||||
select -module dffe_00 -assert-count 1 t:\\neg_small
|
||||
select -module dffe_01 -assert-count 1 t:\\neg_small
|
||||
|
||||
select -module dffe_10 -assert-count 0 t:\\neg_small
|
||||
select -module dffe_11 -assert-count 0 t:\\neg_small
|
||||
|
||||
# and nothing else
|
||||
select -module dffe_00 -assert-count 0 t:\\pos_big
|
||||
select -module dffe_01 -assert-count 0 t:\\pos_big
|
||||
select -module dffe_10 -assert-count 0 t:\\pos_big
|
||||
select -module dffe_11 -assert-count 0 t:\\pos_big
|
||||
select -module dffe_00 -assert-count 0 t:\\pos_small_tielo
|
||||
select -module dffe_01 -assert-count 0 t:\\pos_small_tielo
|
||||
select -module dffe_10 -assert-count 0 t:\\pos_small_tielo
|
||||
select -module dffe_11 -assert-count 0 t:\\pos_small_tielo
|
||||
select -module dffe_00 -assert-count 0 t:\\neg_big
|
||||
select -module dffe_01 -assert-count 0 t:\\neg_big
|
||||
select -module dffe_10 -assert-count 0 t:\\neg_big
|
||||
select -module dffe_11 -assert-count 0 t:\\neg_big
|
||||
select -module dffe_00 -assert-count 0 t:\\neg_small_tielo
|
||||
select -module dffe_01 -assert-count 0 t:\\neg_small_tielo
|
||||
select -module dffe_10 -assert-count 0 t:\\neg_small_tielo
|
||||
select -module dffe_11 -assert-count 0 t:\\neg_small_tielo
|
||||
|
||||
# if necessary, EN is inverted, since the given ICG
|
||||
# is assumed to have an active-high EN
|
||||
select -module dffe_10 -assert-count 1 t:\$_NOT_
|
||||
select -module dffe_11 -assert-count 0 t:\$_NOT_
|
||||
|
|
Loading…
Reference in New Issue