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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.communication/] [pkt_codec_mk2/] [1.0/] [vhd/] [addr_gen.vhd] - Diff between revs 145 and 147

Show entire file | Details | Blame | View Log

Rev 145 Rev 147
Line 4... Line 4...
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- File       : addr_gen.vhd
-- File       : addr_gen.vhd
-- Author     : Lasse Lehtonen
-- Author     : Lasse Lehtonen
-- Company    : 
-- Company    : 
-- Created    : 2011-10-12
-- Created    : 2011-10-12
-- Last update: 2011-10-25
-- Last update: 2012-05-10
-- Platform   : 
-- Platform   : 
-- Standard   : VHDL'87
-- Standard   : VHDL'87
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Description:
-- Description:
--  Handles address flit repeating when data comes slowly from IP and
--  Handles address flit repeating when data comes slowly from IP and
Line 29... Line 29...
entity addr_gen is
entity addr_gen is
 
 
  generic (
  generic (
    cmd_width_g    : positive;
    cmd_width_g    : positive;
    data_width_g   : positive;
    data_width_g   : positive;
    addr_flit_en_g : natural);
    addr_flit_en_g : natural;
 
    noc_type_g     : natural);
 
 
  port (
  port (
    clk          : in  std_logic;
    clk          : in  std_logic;
    rst_n        : in  std_logic;
    rst_n        : in  std_logic;
    -- from IP side
    -- from IP side
Line 74... Line 75...
      first_data_r <= '0';
      first_data_r <= '0';
      net_cmd_out  <= (others => '0');
      net_cmd_out  <= (others => '0');
      net_data_out <= (others => '0');
      net_data_out <= (others => '0');
    elsif clk'event and clk = '1' then  -- rising clock edge
    elsif clk'event and clk = '1' then  -- rising clock edge
 
 
 
      -- FH mesh
 
      if noc_type_g = 3 then
 
        if net_stall_in = '0' then
 
          net_cmd_out <= ip_cmd_in;
 
          net_data_out <= ip_data_in;
 
        end if;
 
      end if;
 
 
 
      -- ase nocs
 
      if noc_type_g /= 3 then
 
 
      -- default
      -- default
      if net_stall_in = '0' then
      if net_stall_in = '0' then
        stall_r <= '0';
        stall_r <= '0';
      end if;
      end if;
 
 
      case state_r is
      case state_r is
        -----------------------------------------------------------------------
          ---------------------------------------------------------------------
        -- IDLE
        -- IDLE
        -----------------------------------------------------------------------
          ---------------------------------------------------------------------
        when idle =>
        when idle =>
          if net_stall_in = '0' then
          if net_stall_in = '0' then
            if ip_cmd_in = "00" then
            if ip_cmd_in = "00" then
              net_cmd_out  <= "00";
              net_cmd_out  <= "00";
              first_data_r <= '0';
              first_data_r <= '0';
Line 102... Line 114...
              net_data_out <= addr_r;
              net_data_out <= addr_r;
              state_r      <= data;
              state_r      <= data;
            end if;
            end if;
          end if;
          end if;
 
 
          ---------------------------------------------------------------------
            -------------------------------------------------------------------
          -- ADDR
          -- ADDR
          ---------------------------------------------------------------------
            -------------------------------------------------------------------
        when addr =>
        when addr =>
          if net_stall_in = '0' then
          if net_stall_in = '0' then
            if ip_cmd_in = "00" then
            if ip_cmd_in = "00" then
              state_r      <= idle;
              state_r      <= idle;
              net_cmd_out  <= "00";
              net_cmd_out  <= "00";
Line 124... Line 136...
              data_r       <= ip_data_in;
              data_r       <= ip_data_in;
              state_r      <= data;
              state_r      <= data;
            end if;
            end if;
          end if;
          end if;
 
 
          ---------------------------------------------------------------------
            -------------------------------------------------------------------
          -- DATA
          -- DATA
          ---------------------------------------------------------------------
            -------------------------------------------------------------------
        when data =>
        when data =>
          if net_stall_in = '0' then
          if net_stall_in = '0' then
            if ip_cmd_in = "00" then
            if ip_cmd_in = "00" then
              if first_data_r = '1' and addr_flit_en_g = 1 then
              if first_data_r = '1' and addr_flit_en_g = 1 then
                stall_r      <= '1';
                stall_r      <= '1';
Line 170... Line 182...
          end if;
          end if;
 
 
        when others => null;
        when others => null;
      end case;
      end case;
 
 
 
      end if;
 
 
    end if;
    end if;
  end process fsm_p;
  end process fsm_p;
 
 
end rtl;
end rtl;

powered by: WebSVN 2.1.0

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