Browse Source

Add example for locical implication

* Add example for -> operator
* Add formal test for -> operator example
* Sort entries in README lists
master
T. Meissner 5 years ago
parent
commit
1a37ad78be
4 changed files with 72 additions and 4 deletions
  1. +5
    -4
      README.md
  2. +18
    -0
      formal/psl_logical_implication.sby
  3. +1
    -0
      formal/tests.mk
  4. +48
    -0
      src/psl_logical_implication.vhd

+ 5
- 4
README.md View File

@ -23,9 +23,12 @@ The next two lists will grow during further development
* cover directive * cover directive
* assume directive (synthesis) * assume directive (synthesis)
* restrict directive (synthesis) * restrict directive (synthesis)
* always operator * always operator
* before operator (GHDL crash with a specific property, see psl_before.vhd)
* eventually! operator (simulation, synthesis produces a GHDL crash, see psl_eventually.vhd)
* logical implication operator
* never operator * never operator
* implication operator
* next operator * next operator
* next[n] operator * next[n] operator
* next_a[i to j] operator * next_a[i to j] operator
@ -35,13 +38,11 @@ The next two lists will grow during further development
* next_event_e[i to j] operator * next_event_e[i to j] operator
* until operator * until operator
* until_ operator * until_ operator
* before operator (GHDL crash with a specific property, see psl_before.vhd)
* eventually! operator (simulation, synthesis produces a GHDL crash, see psl_eventually.vhd)
## PSL features not yet supported by GHDL: ## PSL features not yet supported by GHDL:
* Synthesis of strong operator versions
* forall statement * forall statement
* Synthesis of strong operator versions
## PSL features supported by GHDL but with wrong behaviour ## PSL features supported by GHDL but with wrong behaviour


+ 18
- 0
formal/psl_logical_implication.sby View File

@ -0,0 +1,18 @@
[tasks]
prove
[options]
depth 25
prove: mode bmc
[engines]
prove: smtbmc z3
[script]
prove: ghdl --std=08 pkg.vhd sequencer.vhd psl_logical_implication.vhd -e psl_logical_implication
prep -top psl_logical_implication
[files]
../src/pkg.vhd
../src/sequencer.vhd
../src/psl_logical_implication.vhd

+ 1
- 0
formal/tests.mk View File

@ -1,5 +1,6 @@
psl_tests := \ psl_tests := \
psl_always \ psl_always \
psl_logical_implication \
psl_never \ psl_never \
psl_next \ psl_next \
psl_next_3 \ psl_next_3 \


+ 48
- 0
src/psl_logical_implication.vhd View File

@ -0,0 +1,48 @@
library ieee;
use ieee.std_logic_1164.all;
use work.pkg.all;
entity psl_logical_implication is
port (
clk : in std_logic
);
end entity psl_logical_implication;
architecture psl of psl_logical_implication is
signal a, b, c, d : std_logic;
begin
-- 012345
SEQ_A : sequencer generic map ("_-__-___-__") port map (clk, a);
SEQ_B : sequencer generic map ("_-______-__") port map (clk, b);
SEQ_C : sequencer generic map ("_-__-______") port map (clk, c);
SEQ_D : sequencer generic map ("___________") port map (clk, d);
-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);
-- This assertion holds
IMPLICATION_0_a : assert always (a -> b or c);
-- This assertion doesn't hold at cycle 4
IMPLICATION_1_a : assert always (a -> b and c);
-- This assertion holds because RHS of implication always holds
IMPLICATION_2_a : assert always (a -> true);
-- This assertion doesn't hold at cycle 1 because RHS of implication never holds
IMPLICATION_3_a : assert always (a -> false);
-- This assertion holds because LHS of implication never holds
IMPLICATION_4_a : assert always (d -> (a and b and c));
end architecture psl;

Loading…
Cancel
Save