From eb96123030b253590009e56784876bd5b0da752d Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Tue, 14 Jul 2026 18:02:02 +0200 Subject: [PATCH] dfflibmap: add regression test for resetval clobber --- tests/techmap/dfflibmap_resetval_clobber.lib | 52 ++++++++++++++++++++ tests/techmap/dfflibmap_resetval_clobber.ys | 13 +++++ 2 files changed, 65 insertions(+) create mode 100644 tests/techmap/dfflibmap_resetval_clobber.lib create mode 100644 tests/techmap/dfflibmap_resetval_clobber.ys diff --git a/tests/techmap/dfflibmap_resetval_clobber.lib b/tests/techmap/dfflibmap_resetval_clobber.lib new file mode 100644 index 000000000..dcf4e4402 --- /dev/null +++ b/tests/techmap/dfflibmap_resetval_clobber.lib @@ -0,0 +1,52 @@ +library(test) { + cell (bad_dff) { + area : 1; + ff("IQ", "IQN") { + next_state : "!D"; // Look here + clocked_on : "CLK"; + preset : "!RST"; // Look here + } + pin(D) { + direction : input; + } + pin(CLK) { + direction : input; + } + pin(RST) { + direction : input; + } + pin(Q) { + direction: output; + function : "IQ"; + } + pin(QN) { + direction: output; + function : "IQN"; + } + } + cell (good_dff) { + area : 1; + ff("IQ", "IQN") { + next_state : "D"; // Look here + clocked_on : "CLK"; + clear : "RST"; // Look here + } + pin(D) { + direction : input; + } + pin(CLK) { + direction : input; + } + pin(RST) { + direction : input; + } + pin(Q) { + direction: output; + function : "IQ"; + } + pin(QN) { + direction: output; + function : "IQN"; + } + } +} diff --git a/tests/techmap/dfflibmap_resetval_clobber.ys b/tests/techmap/dfflibmap_resetval_clobber.ys new file mode 100644 index 000000000..aacf40f6c --- /dev/null +++ b/tests/techmap/dfflibmap_resetval_clobber.ys @@ -0,0 +1,13 @@ +read_verilog -icells <