From 69df81756ca692971e9b2b75ffe25859fe215207 Mon Sep 17 00:00:00 2001 From: Iztok Jeras Date: Mon, 22 Jun 2026 01:08:39 +0200 Subject: [PATCH] dlatchlibmap: making a copy of test files dfflibmap* to dlatchlibmap* --- tests/techmap/dlatchlibmap-sim.v | 31 ++ tests/techmap/dlatchlibmap.lib | 79 ++++++ tests/techmap/dlatchlibmap.ys | 99 +++++++ .../techmap/dlatchlibmap_dlatch_not_data.lib | 24 ++ tests/techmap/dlatchlibmap_dlatchn.lib | 47 +++ .../dlatchlibmap_dlatchsr_mixedpol.lib | 35 +++ .../dlatchlibmap_dlatchsr_not_data.lib | 28 ++ .../dlatchlibmap_dlatchsr_not_data_l.lib | 33 +++ tests/techmap/dlatchlibmap_dlatchsr_r.lib | 33 +++ tests/techmap/dlatchlibmap_dlatchsr_s.lib | 33 +++ tests/techmap/dlatchlibmap_dlatchsr_x.lib | 33 +++ tests/techmap/dlatchlibmap_formal.ys | 268 ++++++++++++++++++ tests/techmap/dlatchlibmap_proc_formal.ys | 100 +++++++ 13 files changed, 843 insertions(+) create mode 100644 tests/techmap/dlatchlibmap-sim.v create mode 100644 tests/techmap/dlatchlibmap.lib create mode 100644 tests/techmap/dlatchlibmap.ys create mode 100644 tests/techmap/dlatchlibmap_dlatch_not_data.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchn.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchsr_mixedpol.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchsr_not_data.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchsr_not_data_l.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchsr_r.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchsr_s.lib create mode 100644 tests/techmap/dlatchlibmap_dlatchsr_x.lib create mode 100644 tests/techmap/dlatchlibmap_formal.ys create mode 100644 tests/techmap/dlatchlibmap_proc_formal.ys diff --git a/tests/techmap/dlatchlibmap-sim.v b/tests/techmap/dlatchlibmap-sim.v new file mode 100644 index 000000000..42006a211 --- /dev/null +++ b/tests/techmap/dlatchlibmap-sim.v @@ -0,0 +1,31 @@ +module dffn(input CLK, D, output reg Q, output QN); + +always @(negedge CLK) + Q <= D; + +assign QN = ~Q; + +endmodule + +module dffsr(input CLK, D, CLEAR, PRESET, output reg Q, output QN); + +always @(posedge CLK, posedge CLEAR, posedge PRESET) + if (CLEAR) + Q <= 0; + else if (PRESET) + Q <= 1; + else + Q <= D; + +assign QN = ~Q; + +endmodule + +module dffe(input CLK, EN, D, output reg Q, output QN); + +always @(negedge CLK) + if (EN) Q <= D; + +assign QN = ~Q; + +endmodule diff --git a/tests/techmap/dlatchlibmap.lib b/tests/techmap/dlatchlibmap.lib new file mode 100644 index 000000000..54a44a296 --- /dev/null +++ b/tests/techmap/dlatchlibmap.lib @@ -0,0 +1,79 @@ +library(test) { + /* D-type flip-flop with asynchronous reset and preset */ + 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 (dffsr) { + area : 6; + ff("IQ", "IQN") { + next_state : "D"; + clocked_on : "CLK"; + 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"; + } + } + 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"; + } + } +} diff --git a/tests/techmap/dlatchlibmap.ys b/tests/techmap/dlatchlibmap.ys new file mode 100644 index 000000000..87ecc8bc7 --- /dev/null +++ b/tests/techmap/dlatchlibmap.ys @@ -0,0 +1,99 @@ +read_verilog -icells <