OpenCores
URL https://opencores.org/ocsvn/ccsds_rxtxsoc/ccsds_rxtxsoc/trunk

Subversion Repositories ccsds_rxtxsoc

[/] [ccsds_rxtxsoc/] [trunk/] [ccsds_rx.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 zguig52
-------------------------------
2
---- Project: EurySPACE CCSDS RX/TX with wishbone interface
3
---- Design Name: ccsds_rx
4
---- Version: 1.0.0
5
---- Description:
6
---- TO BE DONE
7
-------------------------------
8
---- Author(s):
9
---- Guillaume REMBERT
10
-------------------------------
11
---- Licence:
12
---- MIT
13
-------------------------------
14
---- Changes list:
15
---- 2015/11/17: initial release
16
-------------------------------
17
 
18
-- libraries used
19
library ieee;
20
use ieee.std_logic_1164.all;
21
 
22
-- unitary rx external physical inputs and outputs
23
entity ccsds_rx is
24
  generic (
25
    CCSDS_RX_PHYS_SIG_QUANT_DEPTH : integer := 16;
26
    CCSDS_RX_DATA_BUS_SIZE: integer := 32
27
  );
28
  port(
29
    -- inputs
30
    clk_i: in std_logic; -- input samples clock
31
    dat_nxt_i: in std_logic; -- next data
32
    ena_i: in std_logic; -- system enable input
33
    rst_i: in std_logic; -- system reset input
34
    sam_i_i: in std_logic_vector(CCSDS_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0); -- in-phased parallel complex samples
35
    sam_q_i: in std_logic_vector(CCSDS_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0); -- quadrature-phased parallel complex samples
36
    -- outputs
37
    buf_bit_ful_o: out std_logic; -- bits buffer status indicator
38
    buf_dat_ful_o: out std_logic; -- data buffer status indicator
39
    buf_fra_ful_o: out std_logic; -- frames buffer status indicator
40
    dat_o: out std_logic_vector(CCSDS_RX_DATA_BUS_SIZE-1 downto 0); -- received data parallel output
41
    dat_val_o: out std_logic; -- data valid
42
    ena_o: out std_logic; -- enabled status indicator
43
    irq_o: out std_logic -- data ready to be read / IRQ signal
44
  );
45
end ccsds_rx;
46
 
47
architecture structure of ccsds_rx is
48
  component ccsds_rx_datalink_layer is
49
    generic(
50
      CCSDS_RX_DATALINK_DATA_BUS_SIZE : integer
51
    );
52
    port(
53
      clk_i: in std_logic;
54
      rst_i: in std_logic;
55
      dat_i: in std_logic_vector(CCSDS_RX_DATA_BUS_SIZE-1 downto 0);
56
      dat_o: out std_logic_vector(CCSDS_RX_DATA_BUS_SIZE-1 downto 0);
57
      buf_dat_ful_o: out std_logic;
58
      buf_fra_ful_o: out std_logic;
59
      buf_bit_ful_o: out std_logic
60
    );
61
  end component;
62
  component ccsds_rx_physical_layer is
63
    generic(
64
      CCSDS_RX_PHYSICAL_SIG_QUANT_DEPTH : integer;
65
      CCSDS_RX_PHYSICAL_DATA_BUS_SIZE : integer
66
    );
67
    port(
68
      clk_i: in std_logic;
69
      clk_o: out std_logic;
70
      rst_i: in std_logic;
71
      sam_i_i: in std_logic_vector(CCSDS_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
72
      sam_q_i: in std_logic_vector(CCSDS_RX_PHYS_SIG_QUANT_DEPTH-1 downto 0);
73
      dat_o: out std_logic_vector(CCSDS_RX_DATA_BUS_SIZE-1 downto 0)
74
    );
75
  end component;
76
 
77
  signal wire_data_m: std_logic_vector(CCSDS_RX_DATA_BUS_SIZE-1 downto 0);
78
  signal wire_clk_m: std_logic;
79
  signal wire_clk_i: std_logic;
80
 
81
begin
82
  rx_datalink_layer_1: ccsds_rx_datalink_layer
83
    generic map(
84
      CCSDS_RX_DATALINK_DATA_BUS_SIZE => CCSDS_RX_DATA_BUS_SIZE
85
    )
86
    port map(
87
      clk_i => wire_clk_m,
88
      rst_i => rst_i,
89
      dat_i => wire_data_m,
90
      dat_o => dat_o,
91
      buf_dat_ful_o => buf_dat_ful_o,
92
      buf_fra_ful_o => buf_fra_ful_o,
93
      buf_bit_ful_o => buf_bit_ful_o
94
    );
95
  rx_physical_layer_1: ccsds_rx_physical_layer
96
    generic map(
97
      CCSDS_RX_PHYSICAL_SIG_QUANT_DEPTH => CCSDS_RX_PHYS_SIG_QUANT_DEPTH,
98
      CCSDS_RX_PHYSICAL_DATA_BUS_SIZE => CCSDS_RX_DATA_BUS_SIZE
99
    )
100
    port map(
101
      clk_i => wire_clk_i,
102
      clk_o => wire_clk_m,
103
      rst_i => rst_i,
104
      sam_i_i => sam_i_i,
105
      sam_q_i => sam_q_i,
106
      dat_o => wire_data_m
107
    );
108
 
109
    --=============================================================================
110
    -- Begin of enablep
111
    -- Enable/disable clk forwarding
112
    --=============================================================================
113
    -- read: clk_i, ena_i
114
    -- write: wire_clk_i
115
    -- r/w: 
116
    ENABLEP : process (clk_i, ena_i)
117
      begin
118
        if (ena_i = '1') then
119
          wire_clk_i <= clk_i;
120
          ena_o <= '1';
121
        else
122
          wire_clk_i <= '0';
123
          ena_o <= '0';
124
        end if;
125
      end process;
126
end structure;

powered by: WebSVN 2.1.0

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