1 |
2 |
zguig52 |
-------------------------------
|
2 |
|
|
---- Project: EurySPACE CCSDS RX/TX with wishbone interface
|
3 |
|
|
---- Design Name: ccsds_tx
|
4 |
|
|
---- Version: 1.0.0
|
5 |
|
|
---- Description:
|
6 |
|
|
---- CCSDS compliant TX
|
7 |
|
|
-------------------------------
|
8 |
|
|
---- Author(s):
|
9 |
|
|
---- Guillaume Rembert
|
10 |
|
|
-------------------------------
|
11 |
|
|
---- Licence:
|
12 |
|
|
---- MIT
|
13 |
|
|
-------------------------------
|
14 |
|
|
---- Changes list:
|
15 |
|
|
---- 2015/11/17: initial release
|
16 |
|
|
---- 2016/10/19: rework
|
17 |
|
|
-------------------------------
|
18 |
|
|
|
19 |
|
|
-- libraries used
|
20 |
|
|
library ieee;
|
21 |
|
|
use ieee.std_logic_1164.all;
|
22 |
|
|
|
23 |
|
|
--=============================================================================
|
24 |
|
|
-- Entity declaration for ccsds_tx / unitary tx external physical inputs and outputs
|
25 |
|
|
--=============================================================================
|
26 |
|
|
entity ccsds_tx is
|
27 |
|
|
generic (
|
28 |
|
|
constant CCSDS_TX_BITS_PER_SYMBOL: integer := 1;
|
29 |
|
|
constant CCSDS_TX_BUFFER_SIZE: integer := 16; -- max number of words stored for burst write at full speed when datalinklayer is full
|
30 |
|
|
constant CCSDS_TX_MODULATION_TYPE: integer := 1; -- 1=QAM/QPSK / 2=BPSK
|
31 |
|
|
constant CCSDS_TX_DATA_BUS_SIZE: integer;
|
32 |
|
|
constant CCSDS_TX_OVERSAMPLING_RATIO: integer := 4; -- symbols to samples over-sampling ratio
|
33 |
|
|
constant CCSDS_TX_PHYS_SIG_QUANT_DEPTH : integer
|
34 |
|
|
);
|
35 |
|
|
port(
|
36 |
|
|
-- inputs
|
37 |
|
|
clk_i: in std_logic; -- transmitted samples clock
|
38 |
|
|
dat_par_i: in std_logic_vector(CCSDS_TX_DATA_BUS_SIZE-1 downto 0); -- transmitted parallel data input
|
39 |
|
|
dat_ser_i: in std_logic; -- transmitted serial data input
|
40 |
|
|
dat_val_i: in std_logic; -- transmitted data valid input
|
41 |
|
|
ena_i: in std_logic; -- system enable input
|
42 |
|
|
in_sel_i: in std_logic; -- parallel / serial input selection
|
43 |
|
|
rst_i: in std_logic; -- system reset input
|
44 |
|
|
-- outputs
|
45 |
|
|
buf_ful_o: out std_logic; -- buffer full indicator
|
46 |
|
|
clk_o: out std_logic; -- output samples clock
|
47 |
|
|
ena_o: out std_logic; -- enabled status indicator
|
48 |
|
|
idl_o: out std_logic; -- idle data insertion indicator
|
49 |
|
|
sam_i_o: out std_logic_vector(CCSDS_TX_PHYS_SIG_QUANT_DEPTH-1 downto 0); -- in-phased parallel complex samples
|
50 |
|
|
sam_q_o: out std_logic_vector(CCSDS_TX_PHYS_SIG_QUANT_DEPTH-1 downto 0) -- quadrature-phased parallel complex samples
|
51 |
|
|
);
|
52 |
|
|
end ccsds_tx;
|
53 |
|
|
|
54 |
|
|
--=============================================================================
|
55 |
|
|
-- architecture declaration / internal connections
|
56 |
|
|
--=============================================================================
|
57 |
|
|
architecture structure of ccsds_tx is
|
58 |
|
|
component ccsds_tx_manager is
|
59 |
|
|
generic(
|
60 |
|
|
CCSDS_TX_MANAGER_BITS_PER_SYMBOL: integer;
|
61 |
|
|
CCSDS_TX_MANAGER_MODULATION_TYPE: integer;
|
62 |
|
|
CCSDS_TX_MANAGER_DATA_BUS_SIZE : integer;
|
63 |
|
|
CCSDS_TX_MANAGER_OVERSAMPLING_RATIO: integer
|
64 |
|
|
);
|
65 |
|
|
port(
|
66 |
|
|
clk_i: in std_logic;
|
67 |
|
|
clk_bit_o: out std_logic;
|
68 |
|
|
clk_dat_o: out std_logic;
|
69 |
|
|
clk_sam_o: out std_logic;
|
70 |
|
|
clk_sym_o: out std_logic;
|
71 |
|
|
rst_i: in std_logic;
|
72 |
|
|
ena_i: in std_logic;
|
73 |
|
|
ena_o: out std_logic;
|
74 |
|
|
in_sel_i: in std_logic;
|
75 |
|
|
dat_par_i: in std_logic_vector(CCSDS_TX_MANAGER_DATA_BUS_SIZE-1 downto 0);
|
76 |
|
|
dat_ser_i: in std_logic;
|
77 |
|
|
dat_val_i: in std_logic;
|
78 |
|
|
dat_val_o: out std_logic;
|
79 |
|
|
dat_o: out std_logic_vector(CCSDS_TX_MANAGER_DATA_BUS_SIZE-1 downto 0)
|
80 |
|
|
);
|
81 |
|
|
end component;
|
82 |
|
|
component ccsds_rxtx_buffer is
|
83 |
|
|
generic(
|
84 |
|
|
constant CCSDS_RXTX_BUFFER_DATA_BUS_SIZE : integer;
|
85 |
|
|
constant CCSDS_RXTX_BUFFER_SIZE : integer
|
86 |
|
|
);
|
87 |
|
|
port(
|
88 |
|
|
clk_i: in std_logic;
|
89 |
|
|
dat_i: in std_logic_vector(CCSDS_RXTX_BUFFER_DATA_BUS_SIZE-1 downto 0);
|
90 |
|
|
dat_val_i: in std_logic;
|
91 |
|
|
dat_nxt_i: in std_logic;
|
92 |
|
|
rst_i: in std_logic;
|
93 |
|
|
buf_emp_o: out std_logic;
|
94 |
|
|
buf_ful_o: out std_logic;
|
95 |
|
|
dat_o: out std_logic_vector(CCSDS_RXTX_BUFFER_DATA_BUS_SIZE-1 downto 0);
|
96 |
|
|
dat_val_o: out std_logic
|
97 |
|
|
);
|
98 |
|
|
end component;
|
99 |
|
|
component ccsds_tx_datalink_layer is
|
100 |
|
|
generic(
|
101 |
|
|
CCSDS_TX_DATALINK_DATA_BUS_SIZE: integer;
|
102 |
|
|
CCSDS_TX_DATALINK_CODER_DIFFERENTIAL_BITS_PER_CODEWORD: integer
|
103 |
|
|
);
|
104 |
|
|
port(
|
105 |
|
|
clk_bit_i: in std_logic;
|
106 |
|
|
clk_dat_i: in std_logic;
|
107 |
|
|
rst_i: in std_logic;
|
108 |
|
|
dat_val_i: in std_logic;
|
109 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_DATALINK_DATA_BUS_SIZE-1 downto 0);
|
110 |
|
|
dat_val_o: out std_logic;
|
111 |
|
|
dat_o: out std_logic_vector(CCSDS_TX_DATALINK_DATA_BUS_SIZE-1 downto 0);
|
112 |
|
|
dat_nxt_o: out std_logic;
|
113 |
|
|
idl_o: out std_logic
|
114 |
|
|
);
|
115 |
|
|
end component;
|
116 |
|
|
component ccsds_tx_physical_layer is
|
117 |
|
|
generic(
|
118 |
|
|
CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL: integer;
|
119 |
|
|
CCSDS_TX_PHYSICAL_MODULATION_TYPE: integer;
|
120 |
|
|
CCSDS_TX_PHYSICAL_DATA_BUS_SIZE: integer;
|
121 |
|
|
CCSDS_TX_PHYSICAL_OVERSAMPLING_RATIO: integer;
|
122 |
|
|
CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH: integer
|
123 |
|
|
);
|
124 |
|
|
port(
|
125 |
|
|
clk_sam_i: in std_logic;
|
126 |
|
|
clk_sym_i: in std_logic;
|
127 |
|
|
rst_i: in std_logic;
|
128 |
|
|
sam_i_o: out std_logic_vector(CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH-1 downto 0);
|
129 |
|
|
sam_q_o: out std_logic_vector(CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH-1 downto 0);
|
130 |
|
|
dat_i: in std_logic_vector(CCSDS_TX_PHYSICAL_DATA_BUS_SIZE-1 downto 0);
|
131 |
|
|
dat_val_i: in std_logic
|
132 |
|
|
);
|
133 |
|
|
end component;
|
134 |
|
|
|
135 |
|
|
signal wire_dat_nxt_buf: std_logic;
|
136 |
|
|
signal wire_dat_val_buf: std_logic;
|
137 |
|
|
signal wire_dat_val_dat: std_logic;
|
138 |
|
|
signal wire_dat_val_man: std_logic;
|
139 |
|
|
signal wire_dat_buf: std_logic_vector(CCSDS_TX_DATA_BUS_SIZE-1 downto 0);
|
140 |
|
|
signal wire_dat_dat: std_logic_vector(CCSDS_TX_DATA_BUS_SIZE-1 downto 0);
|
141 |
|
|
signal wire_dat_man: std_logic_vector(CCSDS_TX_DATA_BUS_SIZE-1 downto 0);
|
142 |
|
|
signal wire_clk_dat: std_logic;
|
143 |
|
|
signal wire_clk_sam: std_logic;
|
144 |
|
|
signal wire_clk_sym: std_logic;
|
145 |
|
|
signal wire_clk_bit: std_logic;
|
146 |
|
|
signal wire_rst_man: std_logic;
|
147 |
|
|
|
148 |
|
|
begin
|
149 |
|
|
tx_manager_0: ccsds_tx_manager
|
150 |
|
|
generic map(
|
151 |
|
|
CCSDS_TX_MANAGER_BITS_PER_SYMBOL => CCSDS_TX_BITS_PER_SYMBOL,
|
152 |
|
|
CCSDS_TX_MANAGER_MODULATION_TYPE => CCSDS_TX_MODULATION_TYPE,
|
153 |
|
|
CCSDS_TX_MANAGER_DATA_BUS_SIZE => CCSDS_TX_DATA_BUS_SIZE,
|
154 |
|
|
CCSDS_TX_MANAGER_OVERSAMPLING_RATIO => CCSDS_TX_OVERSAMPLING_RATIO
|
155 |
|
|
)
|
156 |
|
|
port map(
|
157 |
|
|
clk_i => clk_i,
|
158 |
|
|
clk_bit_o => wire_clk_bit,
|
159 |
|
|
clk_dat_o => wire_clk_dat,
|
160 |
|
|
clk_sam_o => wire_clk_sam,
|
161 |
|
|
clk_sym_o => wire_clk_sym,
|
162 |
|
|
rst_i => rst_i,
|
163 |
|
|
ena_i => ena_i,
|
164 |
|
|
ena_o => ena_o,
|
165 |
|
|
in_sel_i => in_sel_i,
|
166 |
|
|
dat_val_i => dat_val_i,
|
167 |
|
|
dat_par_i => dat_par_i,
|
168 |
|
|
dat_ser_i => dat_ser_i,
|
169 |
|
|
dat_val_o => wire_dat_val_man,
|
170 |
|
|
dat_o => wire_dat_man
|
171 |
|
|
);
|
172 |
|
|
tx_buffer_0: ccsds_rxtx_buffer
|
173 |
|
|
generic map(
|
174 |
|
|
CCSDS_RXTX_BUFFER_DATA_BUS_SIZE => CCSDS_TX_DATA_BUS_SIZE,
|
175 |
|
|
CCSDS_RXTX_BUFFER_SIZE => CCSDS_TX_BUFFER_SIZE
|
176 |
|
|
)
|
177 |
|
|
port map(
|
178 |
|
|
clk_i => wire_clk_dat,
|
179 |
|
|
rst_i => rst_i,
|
180 |
|
|
dat_nxt_i => wire_dat_nxt_buf,
|
181 |
|
|
dat_val_i => wire_dat_val_man,
|
182 |
|
|
dat_i => wire_dat_man,
|
183 |
|
|
dat_val_o => wire_dat_val_buf,
|
184 |
|
|
-- buf_emp_o => ,
|
185 |
|
|
buf_ful_o => buf_ful_o,
|
186 |
|
|
dat_o => wire_dat_buf
|
187 |
|
|
);
|
188 |
|
|
tx_datalink_layer_0: ccsds_tx_datalink_layer
|
189 |
|
|
generic map(
|
190 |
|
|
CCSDS_TX_DATALINK_DATA_BUS_SIZE => CCSDS_TX_DATA_BUS_SIZE,
|
191 |
|
|
CCSDS_TX_DATALINK_CODER_DIFFERENTIAL_BITS_PER_CODEWORD => CCSDS_TX_BITS_PER_SYMBOL
|
192 |
|
|
)
|
193 |
|
|
port map(
|
194 |
|
|
clk_dat_i => wire_clk_dat,
|
195 |
|
|
clk_bit_i => wire_clk_bit,
|
196 |
|
|
rst_i => rst_i,
|
197 |
|
|
dat_val_i => wire_dat_val_buf,
|
198 |
|
|
dat_i => wire_dat_buf,
|
199 |
|
|
dat_val_o => wire_dat_val_dat,
|
200 |
|
|
dat_nxt_o => wire_dat_nxt_buf,
|
201 |
|
|
dat_o => wire_dat_dat,
|
202 |
|
|
idl_o => idl_o
|
203 |
|
|
);
|
204 |
|
|
tx_physical_layer_0: ccsds_tx_physical_layer
|
205 |
|
|
generic map(
|
206 |
|
|
CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH => CCSDS_TX_PHYS_SIG_QUANT_DEPTH,
|
207 |
|
|
CCSDS_TX_PHYSICAL_DATA_BUS_SIZE => CCSDS_TX_DATA_BUS_SIZE,
|
208 |
|
|
CCSDS_TX_PHYSICAL_MODULATION_TYPE => CCSDS_TX_MODULATION_TYPE,
|
209 |
|
|
CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL => CCSDS_TX_BITS_PER_SYMBOL,
|
210 |
|
|
CCSDS_TX_PHYSICAL_OVERSAMPLING_RATIO => CCSDS_TX_OVERSAMPLING_RATIO
|
211 |
|
|
)
|
212 |
|
|
port map(
|
213 |
|
|
clk_sym_i => wire_clk_sym,
|
214 |
|
|
clk_sam_i => wire_clk_sam,
|
215 |
|
|
rst_i => rst_i,
|
216 |
|
|
sam_i_o => sam_i_o,
|
217 |
|
|
sam_q_o => sam_q_o,
|
218 |
|
|
dat_i => wire_dat_dat,
|
219 |
|
|
dat_val_i => wire_dat_val_dat
|
220 |
|
|
);
|
221 |
|
|
clk_o <= wire_clk_sam;
|
222 |
|
|
end structure;
|