From 4a2605e66484d012ffd47d48d031774928c7b35e Mon Sep 17 00:00:00 2001 From: tmeissner Date: Tue, 2 Jun 2020 21:05:00 +0200 Subject: [PATCH] Add example for SERE non-length-matching and (&) operator --- README.md | 3 +- formal/psl_sere_non_len_matching_and.sby | 18 ++++++++++ formal/tests.mk | 1 + sim/tests.mk | 3 +- src/psl_sere_non_len_matching_and.vhd | 46 ++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 formal/psl_sere_non_len_matching_and.sby create mode 100644 src/psl_sere_non_len_matching_and.vhd diff --git a/README.md b/README.md index 87f63ec..6bc4a28 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ The next lists will grow during further development * Non consecutive repetition operator (`[=n]`, `[=i to j]`) * Non consecutive goto repetition operator (`[->]`, `[->n]`, `[->i to j]`) * Length-matching and operator (`&&`) +* Non-length-matching and operator (`&`) * or operator (`|`) * `within` operator @@ -63,7 +64,7 @@ The next lists will grow during further development * `forall` statement * Synthesis of strong operator versions -* PSL functions (`prev()` partially implemented) +* PSL functions (`prev()` implemented) ## Under investigation diff --git a/formal/psl_sere_non_len_matching_and.sby b/formal/psl_sere_non_len_matching_and.sby new file mode 100644 index 0000000..47fcbaa --- /dev/null +++ b/formal/psl_sere_non_len_matching_and.sby @@ -0,0 +1,18 @@ +[tasks] +bmc + +[options] +depth 25 +bmc: mode bmc + +[engines] +bmc: smtbmc z3 + +[script] +bmc: ghdl --std=08 pkg.vhd sequencer.vhd psl_sere_non_len_matching_and.vhd -e psl_sere_non_len_matching_and +prep -top psl_sere_non_len_matching_and + +[files] +../src/pkg.vhd +../src/sequencer.vhd +../src/psl_sere_non_len_matching_and.vhd diff --git a/formal/tests.mk b/formal/tests.mk index 8db0ab7..c5de8b5 100644 --- a/formal/tests.mk +++ b/formal/tests.mk @@ -23,4 +23,5 @@ psl_cover \ psl_sere_within \ psl_sere_or \ psl_sere_len_matching_and \ +psl_sere_non_len_matching_and \ psl_prev diff --git a/sim/tests.mk b/sim/tests.mk index 1d939df..8e54e0d 100644 --- a/sim/tests.mk +++ b/sim/tests.mk @@ -22,4 +22,5 @@ psl_sere_non_consecutive_goto_repetition \ psl_cover \ psl_sere_within \ psl_sere_or \ -psl_sere_len_matching_and +psl_sere_len_matching_and \ +psl_sere_non_len_matching_and diff --git a/src/psl_sere_non_len_matching_and.vhd b/src/psl_sere_non_len_matching_and.vhd new file mode 100644 index 0000000..6396412 --- /dev/null +++ b/src/psl_sere_non_len_matching_and.vhd @@ -0,0 +1,46 @@ +library ieee; + use ieee.std_logic_1164.all; + +use work.pkg.all; + + +entity psl_sere_non_len_matching_and is + port ( + clk : in std_logic + ); +end entity psl_sere_non_len_matching_and; + + +architecture psl of psl_sere_non_len_matching_and is + + signal req, done0, done1, done2, ack : std_logic; + +begin + + + -- 01234567890 + SEQ_REQ : sequencer generic map ("_-_________") port map (clk, req); + SEQ_DONE0 : sequencer generic map ("______-____") port map (clk, done0); + SEQ_DONE1 : sequencer generic map ("________-__") port map (clk, done1); + SEQ_DONE2 : sequencer generic map ("____-______") port map (clk, done2); + SEQ_ACK : sequencer generic map ("_________-_") port map (clk, ack); + + + -- All is sensitive to rising edge of clk + default clock is rising_edge(clk); + + -- Non length matching AND three SERE + -- Each of done0, done1 & done2 has to hold a cycle after + -- req holded. Transfer is ended by ack holding one cycle + -- after last done holded + -- This assertion holds + SERE_0_a : assert always {req} |=> {{done0[->] & done1[->] & done2[->]}; ack}; + + -- Stop simulation after longest running sequencer is finished + -- Simulation only code by using pragmas + -- synthesis translate_off + stop_sim(clk, 11); + -- synthesis translate_on + + +end architecture psl;