OpenCores
URL https://opencores.org/ocsvn/802154phycore/802154phycore/trunk

Subversion Repositories 802154phycore

[/] [802154phycore/] [trunk/] [rtl/] [tx_core.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 entactogen
-- Copyright (c) 2010 Antonio de la Piedra
2
 
3
-- This program is free software: you can redistribute it and/or modify
4
-- it under the terms of the GNU General Public License as published by
5
-- the Free Software Foundation, either version 3 of the License, or
6
-- (at your option) any later version.
7
 
8
-- This program is distributed in the hope that it will be useful,
9
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
-- GNU General Public License for more details.
12
 
13
-- You should have received a copy of the GNU General Public License
14
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
16
-- A VHDL model of the IEEE 802.15.4 physical layer.
17
 
18
library IEEE;
19
use IEEE.STD_LOGIC_1164.ALL;
20
use IEEE.STD_LOGIC_ARITH.ALL;
21
use IEEE.STD_LOGIC_UNSIGNED.ALL;
22
 
23
entity tx_core is
24
 
25
        port(   clk_1_mhz : in std_logic;
26
                clk_8_mhz : in std_logic;
27
 
28
                tx_core_start : in std_logic;
29
                tx_core_rst : in std_logic;
30
                tx_core_symbol : in std_logic_vector(3 downto 0);
31
 
32
                tx_core_i_out : out std_logic_vector(9 downto 0);
33
                tx_core_q_out : out std_logic_vector(9 downto 0));
34
 
35
end tx_core;
36
 
37
architecture Behavioral of tx_core is
38
 constant N : integer := 5;
39
 
40
 type delay_buffer_t is array(N-1 downto 0) of
41
  std_logic_vector(9 downto 0);
42
 
43
 signal chip_i, chip_q : std_logic;
44
 signal upsampler_i, upsampler_q : std_logic_vector(1 downto 0);
45
 signal tx_core_q_out_tmp : std_logic_vector(9 downto 0);
46
 signal delay_buffer : delay_buffer_t;
47
 
48
begin
49
 
50
  CHIP_GEN : entity work.chip_gen(Behavioral) port map (tx_core_rst,
51
                                                                  clk_1_mhz,
52
                                                                 tx_core_symbol,
53
                                                                 chip_i,
54
                                                                 chip_q);
55
  UPSAMPLER_CH_I : entity work.upsampler(Behavioral) port map (upsampler_i,
56
                                               chip_i,
57
                                               clk_8_mhz,
58
                                               tx_core_start);
59
 
60
  UPSAMPLER_CH_Q : entity work.upsampler(Behavioral) port map (upsampler_q,
61
                                               chip_q,
62
                                               clk_8_mhz,
63
                                               tx_core_start);
64
 
65
  FIR_CH_I : entity work.tx_fir(Behavioral) port map (upsampler_i,
66
                                               clk_8_mhz,
67
                                               tx_core_rst,
68
                                               tx_core_i_out);
69
 
70
  FIR_CH_Q : entity work.tx_fir(Behavioral) port map (upsampler_q,
71
                                               clk_8_mhz,
72
                                               tx_core_rst,
73
                                               tx_core_q_out_tmp);
74
 
75
  -- Q Channel delay by T_sym/2: O-QPSK modulator will need the Q channel 
76
  -- delayed by T_sym/2 (0.5 us).
77
 
78
  delay_buffer(0) <= tx_core_q_out_tmp;
79
 
80
  gen_delay: for i in 1 to N-1 generate
81
   q_ch_delay: process(clk_8_mhz)
82
   begin
83
    if rising_edge(clk_8_mhz) then
84
     delay_buffer(i) <= delay_buffer(i-1);
85
    end if;
86
   end process q_ch_delay;
87
  end generate gen_delay;
88
 
89
  tx_core_q_out <= delay_buffer(N-1);
90
 
91
end Behavioral;
92
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.