Skip to content
Snippets Groups Projects
Select Git revision
  • 27e3fd05090f9ffe39b112290b5e5a5c966734ee
  • master default protected
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • control-single-hba-and-lba
  • 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
  • L2SS-2153-Add-Grpc-Gateway-support
  • 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
  • v0.51.9-6 protected
  • v0.51.9-5 protected
  • v0.51.9-4 protected
  • v0.51.9-3 protected
  • v0.51.9-2 protected
  • v0.51.9-1 protected
  • v0.51.9 protected
  • v0.51.8 protected
  • v0.39.15-wsrttwo protected
  • v0.39.15-wsrt protected
41 results

devices.rst

  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    tb_common_async.vhd 2.89 KiB
    -------------------------------------------------------------------------------
    --
    -- Copyright (C) 2012
    -- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.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/>.
    --
    -------------------------------------------------------------------------------
    
    -- Purpose: Test bench to compare common_async with common_areset
    -- Usage:
    --   > as 1
    --   > run -all
    --
    -- Description:
    
    LIBRARY IEEE;
    USE IEEE.std_logic_1164.ALL;
    USE IEEE.numeric_std.ALL;
    USE work.common_pkg.ALL;
    USE work.tb_common_pkg.ALL;
    
    ENTITY tb_common_async IS
    END tb_common_async;
    
    
    ARCHITECTURE tb OF tb_common_async IS
    
      CONSTANT clk_period   : TIME := 10 ns;
      
      CONSTANT c_delay_len  : NATURAL := 3;
    
      SIGNAL dbg_state                : NATURAL;
      
      SIGNAL tb_end                   : STD_LOGIC := '0';
      SIGNAL clk                      : STD_LOGIC := '0';
      
      SIGNAL in_rst                   : STD_LOGIC;
      SIGNAL in_dat                   : STD_LOGIC;
      
      SIGNAL out_async                : STD_LOGIC;
      SIGNAL out_areset               : STD_LOGIC;
    
    BEGIN
    
      clk  <= NOT clk OR tb_end AFTER clk_period/2;
        
      p_in_stimuli : PROCESS
      BEGIN
        dbg_state <= 0;
        in_dat <= '1';
        in_rst <= '1';
        proc_common_wait_some_cycles(clk, 5);
        in_dat <= '0';
        in_rst <= '0';
        proc_common_wait_some_cycles(clk, 50);
    
        dbg_state <= 1;
        in_dat <= '1';
        proc_common_wait_some_cycles(clk, 5);
        in_dat <= '0';
        proc_common_wait_some_cycles(clk, 50);
        
        dbg_state <= 2;
        in_rst <= '1';
        proc_common_wait_some_cycles(clk, 5);
        in_rst <= '0';
        proc_common_wait_some_cycles(clk, 50);
        
        dbg_state <= 9;
        proc_common_wait_some_cycles(clk, 10);
        tb_end <= '1';
        WAIT;
      END PROCESS;
    
      u_async : ENTITY work.common_async
      GENERIC MAP (
        g_rst_level => '1',
        g_delay_len => c_delay_len
      )
      PORT MAP (
        rst  => in_rst,
        clk  => clk,
        din  => in_dat,
        dout => out_async
      );
            
      u_areset : ENTITY work.common_areset
      GENERIC MAP (
        g_rst_level => '1',
        g_delay_len => c_delay_len
      )
      PORT MAP (
        in_rst    => in_rst,
        clk       => clk,
        out_rst   => out_areset
      );
      
    END tb;