zhangyanjun1984的个人空间 https://blog.eetop.cn/1055545 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

VHDL

已有 18 次阅读| 2022-1-24 17:31 |系统分类:芯片设计

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.all;

use IEEE.STD_LOGIC_UNSIGNED.all;

use work.ARRAY_TYPE.all;

use work.RU_FPGA_FNC.all;

use work.RU_FPGA_CONFIG.all;   

entity TRAFFIC_SELECTION is

    generic (

        NUM_ANTENNA                 : natural := 4

    );

    port (

        RESET                       : in  std_logic;

        CLK                          : in  std_logic;


        signal_a                    : out std_logic_vector(23 downto 0);


        signal_b                    : in  std_logic_vector(3 downto 0)

    );

end TRAFFIC_SELECTION;

architecture ARC_TRAFFIC_SEL of TRAFFIC_SEL is

signal tp_data                  : std_logic_vector(15 downto 0) := (others => '0');




component cc is

generic (

dddd                 : natural := 4

);

port (

CLK                         : in  std_logic;

ENABLE                      : in  std_logic;


OUT_DATA                    : out std_logic_vector(14 downto 0)

);

end component;

begin


end ARC_TRAFFIC_SEL ;


constant RAM_DEPTH              : integer := DEPTH;--2**log2(BUFF_DEPTH);

type ram_type                   is array (DEPTH-1 downto 0) of std_logic_vector(WIDTH-1 downto 0);

signal RAM                      : ram_type := (others => (others => '0'));

type std_logic_array2        is array(natural range <>) of std_logic_vector(  1 downto 0);

signal dl_proc_dly_w          : std_logic_array2(7 downto 0);


 u_CW : dddd

    generic map(

        dddd   => dddd                              --: natural := 4

    )

    port map(

        CLK                         => CLK                                     ,--: in  std_logic;

        ENABLE                      => enable_cw                               ,--: in  std_logic;


        OUT_DATA                    => pattern_cw                               --: out std_logic_vector(15 downto 0)

    );


PROCESSING_DELAY_DL <= conv_std_logic_vector(67, 24)  WHEN CPRI_SPEED = "000" ELSE

   conv_std_logic_vector(69, 24)  WHEN CPRI_SPEED = "001" ELSE

   conv_std_logic_vector(70, 24)  WHEN CPRI_SPEED = "010" ELSE

   conv_std_logic_vector(70, 24);


process (CLK)

begin

if (CLK'event and CLK = '1') then

if (aa= "10") then

bb<= '1';

elsif (aa= "11") then

bb<= '1';

else

bb<= '0';

end if;

end if;

end process;


---FOR LOOP------

    process(CLK)

    begin

        if (CLK'event and CLK = '1') then

            for i in 0 to 3 loop

                if aa(i) = '1') then

                    bb(i) <= cc(i);

                end if;

            end loop;

            end if;

    end process;


delay_value_tdd  <= limit_sync(log2(MAX_SYNC_DELAY)-1 downto 0) + conv_std_logic_vector(3, log2(MAX_SYNC_DELAY));


G_xx : for i in 0 to 5 generate

begin

    cc(i)                <= dd(i)(14 downto 0);

end generate G_xx;




-- all the internal clock

type internal_clk_type is record

     clk_cpuif       : std_logic;

     clk_sys         : std_logic;

     clk_sysx2       : std_logic;

     clk_sysx3       : std_logic;

     clk_sysx4       : std_logic;

     clk_sysx5       : std_logic;

     clk_sysx6       : std_logic;

     clk_sysx8       : std_logic;

     clk_sysx10      : std_logic;

     clk_sysx12      : std_logic;

     clk_sysx16      : std_logic;

     clk_sysx20      : std_logic;

     initial_clk     : std_logic;

end record;



-- local bus output

type local_bus_master_out_type is record

   clk    : std_logic;

   rst    : std_logic;

   addr   : std_logic_vector(19 downto 0 );

   cs     : std_logic;

   rden   : std_logic;

   wdata  : std_logic_vector(31 downto 0 );

   wren   : std_logic;

end record;


-- local bus input 

type local_bus_master_in_type is record

   rdata  : std_logic_vector(31 downto 0 );

end record;


library work;

use work.ARRAY_TYPE.all;


entity bbctrl_top is

    port (

        rst         : in  internal_rst_type ;

        clk         : in  internal_clk_type ;

        cpuo        : in  cpuif_out_type    ;

        cpui        : out cpuif_in_type     ;


rdval_gen: process(rst.rst_cpuif, clk.clk_cpuif)

  begin

      if (rst.rst_cpuif = '1') 

      then

          rden_dly  <= (others => '0');

          rdval_pls <= '0';

      elsif (clk.clk_cpuif'event and clk.clk_cpuif = '1') 

      then

          rden_dly  <= rden_dly(4 downto 0) & cpuo.rden;

          if (rden_dly(3) = '1' and rden_dly(4) = '0') then -- 1 clock duration

              rdval_pls <= '1';

          else

              rdval_pls <= '0';

          end if;

      end if;

  end process;


package xxx is

constant GEM_TEMP_VER                   : boolean := TRUE  ; 

end xxx;

package body xxx is


end xxx;


全部作者的其他最新日志

评论 (0 个评论)

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 1

    好友
  • 1

    获赞
  • 0

    评论
  • 3

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-8 17:25 , Processed in 0.028383 second(s), 16 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部