Skip to content

Commit

Permalink
Move default_clock declarations to architecture declaration section, …
Browse files Browse the repository at this point in the history
…for #6
  • Loading branch information
tmeissner committed Feb 2, 2025
1 parent 00b124e commit 91e04b6
Show file tree
Hide file tree
Showing 38 changed files with 114 additions and 116 deletions.
6 changes: 3 additions & 3 deletions src/psl_abort.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_abort is

signal a, b, c, d : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin

-- Creating an abort signal which is asynchronously set & reset
Expand All @@ -26,9 +29,6 @@ begin
SEQ_C : sequencer generic map ("-_________") port map (clk, c);
-- D : _|________

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion doesn't hold at cycle 4
WITHOUT_ABORT_a : assert (always a -> next (b before a));

Expand Down
6 changes: 3 additions & 3 deletions src/psl_always.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ architecture psl of psl_always is

signal a : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


-- 012345
SEQ : sequencer generic map ("--____") port map (clk, a);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- Beware: potential pitfall!
-- Every time a PSL assertion is similar to a concurrent
-- VHDL assertion at that place, it is interpreted as such
Expand Down
6 changes: 3 additions & 3 deletions src/psl_before.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ architecture psl of psl_before is
signal c, d : std_logic;
signal e, f : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -33,9 +36,6 @@ begin
SEQ_F : sequencer generic map ("_-_______-_") port map (clk, f);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
BEFORE_0_a : assert always (a -> next (b before a))
report "BEFORE_0_a failed";
Expand Down
6 changes: 3 additions & 3 deletions src/psl_cover.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_cover is

signal req, busy, done : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -24,9 +27,6 @@ begin
SEQ_DONE : sequencer generic map ("________-_") port map (clk, done);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- Covers a transfer request
-- This cover directive holds at cycle 1
COVER_0_c : cover {req}
Expand Down
6 changes: 3 additions & 3 deletions src/psl_endpoint.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ architecture psl of psl_endpoint is
signal a, b : std_logic;
signal c, d : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -26,9 +29,6 @@ begin
SEQ_D : sequencer generic map ("____________-_") port map (clk, d);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- only endpoint in psl comment works
-- psl endpoint ENDPOINT_1_e is {a; b[*3]; c};

Expand Down
6 changes: 3 additions & 3 deletions src/psl_eventually.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_eventually is

signal a, b : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -23,9 +26,6 @@ begin
SEQ_B : sequencer generic map ("_______-______-_") port map (clk, b);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
-- This assertion leads to a GHDL synthesis crash with bug report
EVENTUALLY_a : assert always (a -> eventually! b);
Expand Down
6 changes: 3 additions & 3 deletions src/psl_fell.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_fell is

signal a, b, c : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -24,9 +27,6 @@ begin
SEQ_C : sequencer generic map ("__-__-___-_") port map (clk, c);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
FELL_0_a : assert always (fell(a) -> c);

Expand Down
6 changes: 3 additions & 3 deletions src/psl_logical_iff.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_logical_iff is

signal a, b, c : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -24,9 +27,6 @@ begin
SEQ_C : sequencer generic map ("_-__-______") port map (clk, c);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
IFF_0_a : assert always (a <-> b or c);

Expand Down
6 changes: 3 additions & 3 deletions src/psl_logical_implication.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_logical_implication is

signal a, b, c, d : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -25,9 +28,6 @@ begin
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);

Expand Down
6 changes: 3 additions & 3 deletions src/psl_never.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_never is

signal a, b : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -23,9 +26,6 @@ begin
SEQ_B : sequencer generic map ("__-_") port map (clk, b);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
NEVER_0_a : assert never a;

Expand Down
6 changes: 3 additions & 3 deletions src/psl_next.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ architecture psl of psl_next is
signal a, b : std_logic;
signal c, d : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -28,9 +31,6 @@ begin
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
NEXT_0_a : assert always (a -> next b);

Expand Down
6 changes: 3 additions & 3 deletions src/psl_next_3.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ architecture psl of psl_next_3 is
signal c, d : std_logic;
signal e, f : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -33,9 +36,6 @@ begin
SEQ_F : sequencer generic map ("_____-----_") port map (clk, f);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
NEXT_0_a : assert always (a -> next[3] (b));

Expand Down
6 changes: 3 additions & 3 deletions src/psl_next_a.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ architecture psl of psl_next_a is
signal i, j : std_logic;
signal k, l : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand Down Expand Up @@ -48,9 +51,6 @@ begin
SEQ_L : sequencer generic map ("_______-__") port map (clk, l);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion doesn't hold at cycle 6
NEXT_0_a : assert always (a -> next_a[3 to 5] (b));

Expand Down
6 changes: 3 additions & 3 deletions src/psl_next_e.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ architecture psl of psl_next_e is
signal i, j : std_logic;
signal k, l : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand Down Expand Up @@ -48,9 +51,6 @@ begin
SEQ_L : sequencer generic map ("_______-__") port map (clk, l);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
NEXT_0_a : assert always (a -> next_e[3 to 5] (b));

Expand Down
6 changes: 3 additions & 3 deletions src/psl_next_event.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ architecture psl of psl_next_event is
signal a, b, c : std_logic;
signal d, e, f : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin

-- 012345678901234
Expand All @@ -29,9 +32,6 @@ begin
SEQ_F : sequencer generic map ("____-___-__-___") port map (clk, f);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
NEXT_EVENT_0_a : assert always (a -> next_event(b)(c));

Expand Down
6 changes: 3 additions & 3 deletions src/psl_next_event_4.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ architecture psl of psl_next_event_4 is
signal a, b, c : std_logic;
signal d, e, f : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin

-- 0123456789012345
Expand All @@ -24,9 +27,6 @@ begin
SEQ_C : sequencer generic map ("_____-_________-") port map (clk, c);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
NEXT_EVENT_0_a : assert always (a -> next_event(b)[4](c));

Expand Down
7 changes: 3 additions & 4 deletions src/psl_next_event_a.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ architecture psl of psl_next_event_a is
signal a, c : std_logic;
signal b : std_logic_vector(3 downto 0);

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -27,10 +30,6 @@ begin
SEQ_C : sequencer generic map ("_____-___---______--_--_") port map (clk, c);



-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- Check for one possible value of b
-- Both assertions hold (see ghdl/ghdl#2157)
NEXT_EVENT_0_a : assert always ((a and b = x"4") -> next_event_a(c)[1 to 4](b = x"4"))
Expand Down
6 changes: 3 additions & 3 deletions src/psl_next_event_e.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_next_event_e is

signal a, b, c : std_logic;

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -24,9 +27,6 @@ begin
SEQ_C : sequencer generic map ("______-___-____") port map (clk, c);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
NEXT_EVENT_0_a : assert always (a -> next_event_e(b)[1 to 2](c));

Expand Down
6 changes: 3 additions & 3 deletions src/psl_onehot.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ architecture psl of psl_onehot is

signal a, b : std_logic_vector(3 downto 0);

-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

begin


Expand All @@ -23,9 +26,6 @@ begin
SEQ_B : hex_sequencer generic map ("111222444888999") port map (clk, b);


-- All is sensitive to rising edge of clk
default clock is rising_edge(clk);

-- This assertion holds
ONEHOT_0_a : assert always onehot(a);

Expand Down
Loading

0 comments on commit 91e04b6

Please sign in to comment.