Skip to content
Snippets Groups Projects
Select Git revision
  • c63b24acbc47005c24ee67a735aec02fe7b9ba81
  • master default protected
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • fix-build-dind
  • L2SS-2153--Improve-Error-Handling
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
  • v0.52.1-rc1 protected
41 results

README.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    tech_transceiver_rx_order.vhd 3.41 KiB
    --------------------------------------------------------------------------------
    --
    -- Copyright (C) 2013
    -- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
    -- JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
    -- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
    --
    -- This program is free software: you can redistribute it and/or modify
    -- it under the terms of the GNU General Public License as published by
    -- the Free Software Foundation, either version 3 of the License, or
    -- (at your option) any later version.
    --
    -- This program is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    -- GNU General Public License for more details.
    --
    -- You should have received a copy of the GNU General Public License
    -- along with this program.  If not, see <http://www.gnu.org/licenses/>.
    --
    --------------------------------------------------------------------------------
     
    LIBRARY IEEE, common_lib;
    USE IEEE.STD_LOGIC_1164.ALL; 
    USE common_lib.common_pkg.ALL;
    
    ENTITY tech_transceiver_rx_order IS
      GENERIC (
        g_data_w  : NATURAL := 16
      );
      PORT (
        rx_clk       : IN  STD_LOGIC;    
        rx_rst       : IN  STD_LOGIC;
    
        rx_data_in   : IN  STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0);
        rx_ctrl_in   : IN  STD_LOGIC_VECTOR(g_data_w/c_byte_w-1 DOWNTO 0);   
                   
        rx_data_out  : OUT STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0);
        rx_valid_out : OUT STD_LOGIC
      );
    END ENTITY;
    
    ARCHITECTURE rtl OF tech_transceiver_rx_order IS
    
      SIGNAL in_hi_dat   : STD_LOGIC_VECTOR(g_data_w/2-1 DOWNTO 0);
      SIGNAL in_lo_dat   : STD_LOGIC_VECTOR(g_data_w/2-1 DOWNTO 0);
      SIGNAL in_hi_val   : STD_LOGIC;
      SIGNAL in_lo_val   : STD_LOGIC;
    
      SIGNAL nxt_rx_data_out : STD_LOGIC_VECTOR(rx_data_out'RANGE);
      SIGNAL nxt_rx_valid_out : STD_LOGIC;
      SIGNAL odd_dat     : STD_LOGIC_VECTOR(in_lo_dat'RANGE);
      SIGNAL nxt_odd_dat : STD_LOGIC_VECTOR(odd_dat'RANGE);
      SIGNAL odd_val     : STD_LOGIC;
      SIGNAL nxt_odd_val : STD_LOGIC;
    
    BEGIN
    
      in_hi_dat <= rx_data_in(g_data_w-1 DOWNTO g_data_w/2);
      in_hi_val <= NOT rx_ctrl_in(rx_ctrl_in'HIGH);
    
      in_lo_dat <= rx_data_in(g_data_w/2-1 DOWNTO 0);
      in_lo_val <= NOT rx_ctrl_in(rx_ctrl_in'LOW);
    
      regs: PROCESS (rx_rst, rx_clk)
      BEGIN
        IF rx_rst='1' THEN
          rx_valid_out <= '0';
          rx_data_out <= (OTHERS => '0');
          odd_val <= '0';
          odd_dat <= (OTHERS => '0');
        ELSIF rising_edge(rx_clk) THEN
          rx_valid_out <= nxt_rx_valid_out;
          rx_data_out <= nxt_rx_data_out;
          odd_val <= nxt_odd_val;
          odd_dat <= nxt_odd_dat;
        END IF;
      END PROCESS;
    
      odd_proc : PROCESS (in_hi_dat, in_hi_val, in_lo_dat, in_lo_val, odd_dat, odd_val)
      BEGIN
        nxt_odd_val <= '0';
    
        IF in_hi_val = '1' AND in_lo_val = '0' AND odd_val = '0' THEN
          nxt_odd_val <= '1';
        ELSIF in_hi_val = '1' AND in_lo_val = '1' AND odd_val = '1' THEN
          nxt_odd_val <= '1';
        END IF;
    
        nxt_odd_dat <= in_hi_dat;
      END PROCESS;
    
    
      out_proc : PROCESS (in_hi_dat, in_hi_val, in_lo_dat, in_lo_val, odd_dat, odd_val)
      BEGIN
        nxt_rx_valid_out <= (in_hi_val AND in_lo_val) OR (odd_val AND (in_hi_val OR in_lo_val));
        nxt_rx_data_out <= (OTHERS => '0');
    
        IF odd_val='0' THEN
          nxt_rx_data_out(2*g_data_w/2-1 DOWNTO 0) <= in_hi_dat & in_lo_dat;
        ELSE
          nxt_rx_data_out(2*g_data_w/2-1 DOWNTO 0) <= in_lo_dat & odd_dat;
        END IF;
      END PROCESS;
    
    END rtl;