From 55dcf0e200421d8e73322141e940603100e2c14a Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Tue, 10 Dec 2024 15:48:23 +0100 Subject: [PATCH] tests: fix dfflibmap test - false negative conflict multiple -liberty vs enable inference --- tests/techmap/dfflibmap.ys | 9 ++--- tests/techmap/dfflibmap_dffn.lib | 23 ------------- tests/techmap/dfflibmap_dffn_dffe.lib | 47 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 27 deletions(-) delete mode 100644 tests/techmap/dfflibmap_dffn.lib create mode 100644 tests/techmap/dfflibmap_dffn_dffe.lib diff --git a/tests/techmap/dfflibmap.ys b/tests/techmap/dfflibmap.ys index 4b485a450ab..77488d60fc0 100644 --- a/tests/techmap/dfflibmap.ys +++ b/tests/techmap/dfflibmap.ys @@ -64,14 +64,15 @@ select -assert-count 1 t:dffe select -assert-none t:dffn t:dffsr t:dffe t:$_NOT_ %% %n t:* %i design -load orig -dfflibmap -prepare -liberty dfflibmap_dffn.lib -liberty dfflibmap_dffsr.lib -dfflibmap -map-only -liberty dfflibmap_dffn.lib -liberty dfflibmap_dffsr.lib +dfflibmap -prepare -liberty dfflibmap_dffn_dffe.lib -liberty dfflibmap_dffsr.lib +dfflibmap -map-only -liberty dfflibmap_dffn_dffe.lib -liberty dfflibmap_dffsr.lib clean -select -assert-count 4 t:$_NOT_ +select -assert-count 5 t:$_NOT_ select -assert-count 1 t:dffn +select -assert-count 1 t:dffe select -assert-count 4 t:dffsr -select -assert-none t:dffn t:dffsr t:$_NOT_ %% %n t:* %i +select -assert-none t:dffn t:dffsr t:dffe t:$_NOT_ %% %n t:* %i design -load orig dfflibmap -liberty dfflibmap.lib -dont_use *ffn diff --git a/tests/techmap/dfflibmap_dffn.lib b/tests/techmap/dfflibmap_dffn.lib deleted file mode 100644 index fc38fc8bf13..00000000000 --- a/tests/techmap/dfflibmap_dffn.lib +++ /dev/null @@ -1,23 +0,0 @@ -library(test) { - 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"; - } - } -} diff --git a/tests/techmap/dfflibmap_dffn_dffe.lib b/tests/techmap/dfflibmap_dffn_dffe.lib new file mode 100644 index 00000000000..832edee674e --- /dev/null +++ b/tests/techmap/dfflibmap_dffn_dffe.lib @@ -0,0 +1,47 @@ +library(test) { + 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 (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"; + } + } +}