Hallo, ist dies eurer Meinung nach eine effektive Art zwei Zeitstempel zu vergleichen? Die Zeitstempel sind von einem zyklischen Zähler abgeleitet.
1 | entity sort_element is |
2 | port ( |
3 | clk : in std_logic_vector; |
4 | ...
|
5 | timestamp1_in : in std_logic_vector(31 downto 0); |
6 | timestamp2_in : in std_logic_vector(31 downto 0); |
7 | |
8 | ...
|
9 | );
|
10 | |
11 | architecture sort_element_architecture of sort_element is |
12 | |
13 | signal timestamp_diff_s : std_logic_vector(31 downto 0); |
14 | signal timestamp2_is_older_s : std_logic_vector; |
15 | |
16 | begin
|
17 | |
18 | -- combinatoric part to find out if timestamp2_in is
|
19 | -- earlier in time than timestamp1_in.
|
20 | -- (timestamps are derived from a counter that increments
|
21 | -- by clk and wraps back to 0 when 2^32 is reached.
|
22 | --
|
23 | timestamp_diff_s := (timestamp1_in - timestamp2_in); |
24 | timestamp2_is_older_s := timestamp_diff_s(31); |
25 | |
26 | demo_only : process(clk): |
27 | begin
|
28 | if rising_edge(clk) |
29 | ...
|
30 | -- pseudo code to say that timestamp2_is_older_s
|
31 | -- is only used while both timestamps are valid
|
32 | if (both_timestamps_valid) |
33 | if (timestamp2_is_older_s) |
34 | :
|
35 | end if; |
36 | end if; |
37 | ...
|
38 | end demo_only; |
39 | |
40 | end sort_element_architecture; |