Browse Source

Add fell() example to formal tests after it was implemented by ghdl/ghdl#1357

master
T. Meissner 5 years ago
parent
commit
2cec27d081
3 changed files with 23 additions and 8 deletions
  1. +2
    -1
      README.md
  2. +2
    -1
      formal/tests.mk
  3. +19
    -6
      src/psl_fell.vhd

+ 2
- 1
README.md View File

@ -63,12 +63,13 @@ The next lists will grow during further development
* `prev()` function (Synthesis only, see [prev() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_prev.vhd)) * `prev()` function (Synthesis only, see [prev() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_prev.vhd))
* `stable()` function (Synthesis only, see [stable() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_stable.vhd)) * `stable()` function (Synthesis only, see [stable() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_stable.vhd))
* `rose()` function (Synthesis only, see [rose() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_rose.vhd)) * `rose()` function (Synthesis only, see [rose() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_rose.vhd))
* `fell()` function (Synthesis only, see [fell() example](https://github.com/tmeissner/psl_with_ghdl/blob/master/src/psl_fell.vhd))
## Not yet supported by GHDL: ## Not yet supported by GHDL:
* `forall` statement * `forall` statement
* Synthesis of strong operator versions * Synthesis of strong operator versions
* PSL functions (`prev()`, `stable()` & `rose()` are implemented for synthesis)
* PSL functions (`prev()`, `stable()`,`rose()` & `fell()` are implemented for synthesis)
## Under investigation ## Under investigation


+ 2
- 1
formal/tests.mk View File

@ -28,4 +28,5 @@ psl_sere_concat \
psl_sere_fusion \ psl_sere_fusion \
psl_prev \ psl_prev \
psl_stable \ psl_stable \
psl_rose
psl_rose \
psl_fell

+ 19
- 6
src/psl_fell.vhd View File

@ -13,21 +13,28 @@ end entity psl_fell;
architecture psl of psl_fell is architecture psl of psl_fell is
signal a, b : std_logic;
signal a, b, c : std_logic;
begin begin
-- 01234567890 -- 01234567890
SEQ_A : sequencer generic map ("_-__-_---__") port map (clk, a);
SEQ_B : sequencer generic map ("__-__-___-_") port map (clk, b);
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);
-- All is sensitive to rising edge of clk -- All is sensitive to rising edge of clk
default clock is rising_edge(clk); default clock is rising_edge(clk);
-- This assertion holds -- This assertion holds
FELL_0_a : assert always (fell(a) -> b);
FELL_0_a : assert always (fell(a) -> c);
-- This assertion holds
FELL_1_a : assert always {a; not a} |-> fell(a);
-- This assertion holds
FELL_2_a : assert always (fell(a) -> (prev(a) and not a));
-- Workaround needed before fell() is implemented -- Workaround needed before fell() is implemented
-- With VHDL glue logic generating the -- With VHDL glue logic generating the
@ -41,11 +48,17 @@ begin
a_prev <= a; a_prev <= a;
end if; end if;
end process; end process;
FELL_1_a : assert always (not a and a_prev -> b);
FELL_3_a : assert always (not a and a_prev -> c);
end block d_reg; end block d_reg;
-- Another workaround by using simple SERE concatenation on LHS -- Another workaround by using simple SERE concatenation on LHS
FELL_2_a : assert always {a; not a} |-> b;
FELL_4_a : assert always {a; not a} |-> c;
-- This assertion doesn't in formal tests
-- in the 1st cycle. Problem is the value of
-- a in the 0th cycle. So fell() can be safely
-- used from the 2nd cycle on only
FELL_5_a : assert always (fell(b) -> c);
-- Stop simulation after longest running sequencer is finished -- Stop simulation after longest running sequencer is finished
-- Simulation only code by using pragmas -- Simulation only code by using pragmas


Loading…
Cancel
Save