From 356f6a16784b7e7b2e268b4ac4812165323c3f34 Mon Sep 17 00:00:00 2001 From: tmeissner Date: Wed, 20 May 2020 14:39:55 +0200 Subject: [PATCH] Add example for SERE within operator --- formal/psl_sere_within.sby | 18 ++++++++++++++++++ formal/tests.mk | 3 ++- src/psl_sere_within.vhd | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 formal/psl_sere_within.sby create mode 100644 src/psl_sere_within.vhd diff --git a/formal/psl_sere_within.sby b/formal/psl_sere_within.sby new file mode 100644 index 0000000..fc951d2 --- /dev/null +++ b/formal/psl_sere_within.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_within.vhd -e psl_sere_within +prep -top psl_sere_within + +[files] +../src/pkg.vhd +../src/sequencer.vhd +../src/psl_sere_within.vhd diff --git a/formal/tests.mk b/formal/tests.mk index f8ee64b..d3b24fc 100644 --- a/formal/tests.mk +++ b/formal/tests.mk @@ -19,4 +19,5 @@ psl_sere_non_overlapping_suffix_impl \ psl_sere_consecutive_repetition \ psl_sere_non_consecutive_repeat_repetition \ psl_sere_non_consecutive_goto_repetition \ -psl_cover \ No newline at end of file +psl_cover \ +psl_sere_within \ No newline at end of file diff --git a/src/psl_sere_within.vhd b/src/psl_sere_within.vhd new file mode 100644 index 0000000..f968aa9 --- /dev/null +++ b/src/psl_sere_within.vhd @@ -0,0 +1,37 @@ +library ieee; + use ieee.std_logic_1164.all; + +use work.pkg.all; + + +entity psl_sere_within is + port ( + clk : in std_logic + ); +end entity psl_sere_within; + + +architecture psl of psl_sere_within is + + signal req, busy, valid, done : std_logic; + +begin + + + -- 0123456789 + SEQ_REQ : sequencer generic map ("_-________") port map (clk, req); + SEQ_BUSY : sequencer generic map ("__------__") port map (clk, busy); + SEQ_VALID : sequencer generic map ("___-_-_-__") port map (clk, valid); + SEQ_DONE : sequencer generic map ("________-_") port map (clk, done); + + + -- All is sensitive to rising edge of clk + default clock is rising_edge(clk); + + -- Occurrance of a SERE during another SERE + -- valid has to hold 3 times during busy holds and done does't hold + -- This assertion doesn't hold at cycle 3 + SERE_0_a : assert always {req} |=> {{valid[=3]} within {(busy and not done)[+]}; not busy and done}; + + +end architecture psl;