Skip to content
Snippets Groups Projects
Select Git revision
  • cc80250f55ddafdf92d5ea47a7e08d3da9b51b32
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

CMakeLists.txt

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    pft_unswitch(rtl).vhd 2.00 KiB
    library IEEE;
    use IEEE.std_logic_1164.all;
    use IEEE.numeric_std.all;
    
    library pft2_lib;
    use pft2_lib.all;
    
    architecture rtl of pft_unswitch is
    
    signal cnt          : std_logic_vector(g_fft_sz_w downto 0);
    signal nxt_cnt      : std_logic_vector(cnt'range);
    
    signal lfsr_bit1    : std_logic;
    signal lfsr_bit2    : std_logic;
    
    signal lfsr_en      : std_logic;
    
    signal nxt_out_val  : std_logic;
    signal nxt_out_sync : std_logic;
    signal nxt_out_re   : std_logic_vector(in_re'range);
    signal nxt_out_im   : std_logic_vector(in_im'range);
    
    begin
    
      registers : process (rst, clk)
      begin
        if rst = '1' then
          cnt      <= (others => '0');
          out_val  <= '0';
          out_sync <= '0';
          out_re   <= (others => '0');
          out_im   <= (others => '0');
        elsif rising_edge(clk) then
          cnt      <= nxt_cnt;
          out_val  <= nxt_out_val;
          out_sync <= nxt_out_sync;
          out_re   <= nxt_out_re;
          out_im   <= nxt_out_im;
        end if;
      end process;
    
      counter: process(cnt, in_val, in_sync)
      begin
        nxt_cnt <= cnt;
        if in_sync = '1' then
          nxt_cnt <= (others => '0');
        elsif in_val = '1' then
          nxt_cnt <= std_logic_vector(unsigned(cnt) + 1);
        end if;
      end process;
    
      lfsr_ctrl: process(cnt,in_val)
      begin
        if signed(cnt) = -1 and in_val = '1' then
          lfsr_en <= '1';
        else
          lfsr_en <= '0';
        end if;
      end process;
    
      proc: process(in_re, in_im, in_val, in_sync, cnt, lfsr_bit1, lfsr_bit2, switch_en)
      begin
        nxt_out_val  <= in_val;
        nxt_out_sync <= in_sync and in_val;
        nxt_out_re   <= in_re;
        nxt_out_im   <= in_im;
        if    ((cnt(0) = '0' and cnt(cnt'high) = lfsr_bit1)
           or (cnt(0) = '1' and cnt(cnt'high) = lfsr_bit2)) and (switch_en = '1') then
            nxt_out_re <= std_logic_vector(-signed(in_re));
            nxt_out_im <= std_logic_vector(-signed(in_im));
        end if;
      end process;
    
      lfsr: entity pft2_lib.pft_lfsr
      port map (
        clk      => clk,
        rst      => rst,
        in_en    => lfsr_en,
        out_bit1 => lfsr_bit1,
        out_bit2 => lfsr_bit2
      );
    
    
    end rtl;