1 |
2 |
entactogen |
|
2 |
|
|
-- Copyright (c) 2013 Antonio de la Piedra
|
3 |
|
|
|
4 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
5 |
|
|
-- it under the terms of the GNU General Public License as published by
|
6 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
7 |
|
|
-- (at your option) any later version.
|
8 |
|
|
|
9 |
|
|
-- This program is distributed in the hope that it will be useful,
|
10 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
|
|
-- GNU General Public License for more details.
|
13 |
|
|
|
14 |
|
|
-- You should have received a copy of the GNU General Public License
|
15 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16 |
|
|
|
17 |
|
|
library IEEE;
|
18 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
19 |
|
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
20 |
|
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
21 |
|
|
|
22 |
|
|
entity d_encoder_d_decoder is
|
23 |
|
|
port(tx_tetra_clk_36_KHz : in std_logic;
|
24 |
|
|
tx_tetra_clk_18_KHz : in std_logic;
|
25 |
|
|
tx_tetra_rst : in std_logic;
|
26 |
|
|
tx_tetra_bit_stream_input : in STD_LOGIC;
|
27 |
|
|
tx_tetra_valid_input : in STD_LOGIC;
|
28 |
|
|
tx_tetra_debug_dbit_output : out std_logic_vector(1 downto 0);
|
29 |
|
|
tx_tetra_diffPhaseEncoder_output_0 : out std_logic_vector(7 downto 0);
|
30 |
|
|
tx_tetra_diffPhaseEncoder_output_1 : out std_logic_vector(7 downto 0);
|
31 |
|
|
rx_clk_18_KHz: in std_logic;
|
32 |
|
|
rx_rst: in std_logic;
|
33 |
|
|
rx_en: in std_logic;
|
34 |
|
|
rx_a_k : out std_logic_vector(7 downto 0);
|
35 |
|
|
rx_b_k : out std_logic_vector(7 downto 0);
|
36 |
|
|
rx_i_k : in std_logic_vector(7 downto 0);
|
37 |
|
|
rx_q_k : in std_logic_vector(7 downto 0)
|
38 |
|
|
);
|
39 |
|
|
end d_encoder_d_decoder;
|
40 |
|
|
|
41 |
|
|
architecture Behavioral of d_encoder_d_decoder is
|
42 |
|
|
|
43 |
|
|
component TETRA_phy is
|
44 |
|
|
port(tetra_clk_36_KHz : in std_logic;
|
45 |
|
|
tetra_clk_18_KHz : in std_logic;
|
46 |
|
|
tetra_rst : in std_logic;
|
47 |
|
|
tetra_bit_stream_input : in STD_LOGIC;
|
48 |
|
|
tetra_valid_input : in STD_LOGIC;
|
49 |
|
|
tetra_debug_dbit_output : out std_logic_vector(1 downto 0);
|
50 |
|
|
tetra_diffPhaseEncoder_output_0 : out std_logic_vector(7 downto 0);
|
51 |
|
|
tetra_diffPhaseEncoder_output_1 : out std_logic_vector(7 downto 0)
|
52 |
|
|
);
|
53 |
|
|
end component;
|
54 |
|
|
|
55 |
|
|
component diffPhaseDecoder is
|
56 |
|
|
port(clk_18_KHz: in std_logic;
|
57 |
|
|
rst: in std_logic;
|
58 |
|
|
en: in std_logic;
|
59 |
|
|
a_k : out std_logic_vector(7 downto 0);
|
60 |
|
|
b_k : out std_logic_vector(7 downto 0);
|
61 |
|
|
i_k : in std_logic_vector(7 downto 0);
|
62 |
|
|
q_k : in std_logic_vector(7 downto 0));
|
63 |
|
|
end component;
|
64 |
|
|
|
65 |
|
|
begin
|
66 |
|
|
|
67 |
|
|
TETRA_TX : TETRA_phy port map (tx_tetra_clk_36_KHz,
|
68 |
|
|
tx_tetra_clk_18_KHz,
|
69 |
|
|
tx_tetra_rst,
|
70 |
|
|
tx_tetra_bit_stream_input,
|
71 |
|
|
tx_tetra_valid_input,
|
72 |
|
|
tx_tetra_debug_dbit_output,
|
73 |
|
|
tx_tetra_diffPhaseEncoder_output_0,
|
74 |
|
|
tx_tetra_diffPhaseEncoder_output_1);
|
75 |
|
|
|
76 |
|
|
TETRA_RX : diffPhaseDecoder port map (rx_clk_18_KHz,
|
77 |
|
|
rx_rst,
|
78 |
|
|
rx_en,
|
79 |
|
|
rx_a_k,
|
80 |
|
|
rx_b_k,
|
81 |
|
|
rx_i_k,
|
82 |
|
|
rx_q_k);
|
83 |
|
|
|
84 |
|
|
end Behavioral;
|
85 |
|
|
|