diff --git a/tests/techmap/clockgate.lib b/tests/techmap/clockgate.lib new file mode 100644 index 000000000..f231a131d --- /dev/null +++ b/tests/techmap/clockgate.lib @@ -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; + } + } +} \ No newline at end of file diff --git a/tests/techmap/clockgate.ys b/tests/techmap/clockgate.ys index 84ccc0e92..34963adc4 100644 --- a/tests/techmap/clockgate.ys +++ b/tests/techmap/clockgate.ys @@ -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_