1 |
2 |
zguig52 |
-------------------------------
|
2 |
|
|
---- Project: EurySPACE CCSDS RX/TX with wishbone interface
|
3 |
|
|
---- Design Name: ccsds_tx_footer
|
4 |
|
|
---- Version: 1.0.0
|
5 |
|
|
---- Description:
|
6 |
|
|
---- TBD
|
7 |
|
|
-------------------------------
|
8 |
|
|
---- Author(s):
|
9 |
|
|
---- Guillaume REMBERT
|
10 |
|
|
-------------------------------
|
11 |
|
|
---- Licence:
|
12 |
|
|
---- MIT
|
13 |
|
|
-------------------------------
|
14 |
|
|
---- Changes list:
|
15 |
|
|
---- 2016/02/28: initial release
|
16 |
|
|
---- 2016/10/21: rework
|
17 |
|
|
-------------------------------
|
18 |
|
|
--TODO: operationnal control field
|
19 |
|
|
--TODO: security trailer
|
20 |
|
|
--[OPT] SECURITY TRAILER
|
21 |
|
|
--[OPT] TRANSFER FRAME TRAILER (2 to 6 octets)
|
22 |
|
|
-- \ [OPT] OPERATIONAL CONTROL FIELD => 4 octets
|
23 |
|
|
-- \ [OPT] Frame error control field => 2 octets
|
24 |
|
|
|
25 |
|
|
-- libraries used
|
26 |
|
|
library ieee;
|
27 |
|
|
use ieee.std_logic_1164.all;
|
28 |
|
|
|
29 |
|
|
--=============================================================================
|
30 |
|
|
-- Entity declaration for ccsds_tx / unitary tx footer inputs and outputs
|
31 |
|
|
--=============================================================================
|
32 |
|
|
entity ccsds_tx_footer is
|
33 |
|
|
generic(
|
34 |
|
|
constant CCSDS_TX_FOOTER_DATA_LENGTH: integer; -- in Bytes
|
35 |
|
|
constant CCSDS_TX_FOOTER_LENGTH: integer -- in Bytes
|
36 |
|
|
);
|
37 |
|
|
port(
|
38 |
|
|
-- inputs
|
39 |
|
|
clk_i: in std_logic;
|
40 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_FOOTER_DATA_LENGTH*8-1 downto 0);
|
41 |
|
|
nxt_i: in std_logic;
|
42 |
|
|
rst_i: in std_logic;
|
43 |
|
|
-- outputs
|
44 |
|
|
bus_o: out std_logic;
|
45 |
|
|
dat_o: out std_logic_vector((CCSDS_TX_FOOTER_DATA_LENGTH+CCSDS_TX_FOOTER_LENGTH)*8-1 downto 0);
|
46 |
|
|
dat_val_o: out std_logic
|
47 |
|
|
);
|
48 |
|
|
end ccsds_tx_footer;
|
49 |
|
|
|
50 |
|
|
--=============================================================================
|
51 |
|
|
-- architecture declaration / internal components and connections
|
52 |
|
|
--=============================================================================
|
53 |
|
|
architecture structure of ccsds_tx_footer is
|
54 |
|
|
component ccsds_rxtx_crc is
|
55 |
|
|
generic(
|
56 |
|
|
constant CCSDS_RXTX_CRC_LENGTH: integer;
|
57 |
|
|
constant CCSDS_RXTX_CRC_DATA_LENGTH: integer
|
58 |
|
|
);
|
59 |
|
|
port(
|
60 |
|
|
clk_i: in std_logic;
|
61 |
|
|
rst_i: in std_logic;
|
62 |
|
|
nxt_i: in std_logic;
|
63 |
|
|
pad_dat_i: in std_logic_vector(CCSDS_RXTX_CRC_LENGTH*8-1 downto 0);
|
64 |
|
|
pad_dat_val_i: in std_logic;
|
65 |
|
|
dat_i: in std_logic_vector(CCSDS_RXTX_CRC_DATA_LENGTH*8-1 downto 0);
|
66 |
|
|
bus_o: out std_logic;
|
67 |
|
|
crc_o: out std_logic_vector(CCSDS_RXTX_CRC_LENGTH*8-1 downto 0);
|
68 |
|
|
dat_o: out std_logic_vector(CCSDS_RXTX_CRC_DATA_LENGTH*8-1 downto 0);
|
69 |
|
|
dat_val_o: out std_logic
|
70 |
|
|
);
|
71 |
|
|
end component;
|
72 |
|
|
-- internal variable signals
|
73 |
|
|
-- components instanciation and mapping
|
74 |
|
|
begin
|
75 |
|
|
tx_footer_crc_0: ccsds_rxtx_crc
|
76 |
|
|
generic map(
|
77 |
|
|
CCSDS_RXTX_CRC_DATA_LENGTH => CCSDS_TX_FOOTER_DATA_LENGTH,
|
78 |
|
|
CCSDS_RXTX_CRC_LENGTH => CCSDS_TX_FOOTER_LENGTH
|
79 |
|
|
)
|
80 |
|
|
port map(
|
81 |
|
|
clk_i => clk_i,
|
82 |
|
|
rst_i => rst_i,
|
83 |
|
|
nxt_i => nxt_i,
|
84 |
|
|
pad_dat_i => (others => '0'),
|
85 |
|
|
pad_dat_val_i => '0',
|
86 |
|
|
bus_o => bus_o,
|
87 |
|
|
dat_i => dat_i,
|
88 |
|
|
crc_o => dat_o(CCSDS_TX_FOOTER_LENGTH*8-1 downto 0),
|
89 |
|
|
dat_o => dat_o((CCSDS_TX_FOOTER_DATA_LENGTH+CCSDS_TX_FOOTER_LENGTH)*8-1 downto CCSDS_TX_FOOTER_LENGTH*8),
|
90 |
|
|
dat_val_o => dat_val_o
|
91 |
|
|
);
|
92 |
|
|
-- internal processing
|
93 |
|
|
end structure;
|