otsdaq_prepmodernization  v2_05_02_indev
burst_throughput_test_blk.vhd
1 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer:
4 --
5 -- Create Date: 14:05:57 11/07/2008
6 -- Design Name:
7 -- Module Name: burst_throughput_test_blk - Behavioral
8 -- Project Name:
9 -- Target Devices:
10 -- Tool versions:
11 -- Description:
12 --
13 -- Dependencies:
14 --
15 -- Revision:
16 -- Revision 0.01 - File Created
17 -- Additional Comments:
18 --
19 ----------------------------------------------------------------------------------
20 library IEEE;
21 use IEEE.STD_LOGIC_1164.ALL;
22 use IEEE.STD_LOGIC_ARITH.ALL;
23 use IEEE.STD_LOGIC_UNSIGNED.ALL;
24 
25 ---- Uncomment the following library declaration if instantiating
26 ---- any Xilinx primitives in this code.
27 --library UNISIM;
28 --use UNISIM.VComponents.all;
29 
31  Port ( write_clk : in STD_LOGIC;
32  reset_n : in STD_LOGIC;
33  data_out : out STD_LOGIC_VECTOR (63 downto 0);
34  we_out : out STD_LOGIC
35  );
36 end burst_throughput_test_blk;
37 
38 -- Note: this block assumes write_clk is slower than read_clk
39 architecture Behavioral of burst_throughput_test_blk is
40 signal data_to_read : std_logic;
41 signal data_to_write: std_logic;
42 signal identifier : STD_LOGIC_VECTOR (3 downto 0);
43 signal we_counter : integer range 15 downto 0;
44 signal we_out_sig : std_logic;
45 begin
46  data_out(63 downto 4) <= (others=>'0');
47  data_out(3 downto 0) <= identifier;
48  we_out <= we_out_sig;
49 
50  process(reset_n,write_clk)
51  begin
52  if reset_n = '0' then
53  we_counter <= 0;
54  identifier <= (others=>'0');
55  we_out_sig <= '0';
56  elsif rising_edge(write_clk) then
57 
58 
59  we_counter <= we_counter + 1;
60  if we_counter = 7 then
61  we_counter <= 0;
62  we_out_sig <= '1';
63  identifier <= identifier + 1;
64  end if;
65 
66  if we_out_sig = '1' then
67  we_out_sig <= '0';
68  end if;
69  end if;
70  end process;
71 
72 end Behavioral;
73