source: PROJECT_CORE_MPI/SWITCH_GEN/BRANCHES/OLD_VERSION/stimuli1.v @ 24

Last change on this file since 24 was 24, checked in by rolagamo, 12 years ago
File size: 1.6 KB
Line 
1-- GENERATEUR DE STIMILUS POUR LE TEST DU SWITCH CROSSBAR
2
3library ieee;
4use ieee.std_logic_1164.all;
5use ieee.std_logic_unsigned.all;
6use IEEE.STD_LOGIC_ARITH.ALL;
7
8entity stimuli45 is
9port (clk : in std_logic;
10      reset : in std_logic;
11       wr_en : out std_logic;
12      data : out std_logic_vector(7 downto 0));
13end stimuli45;
14
15architecture behavioral of stimuli45 is
16type rom_type is array (69 downto 0) of std_logic_vector (7 downto 0);
17signal ROM : rom_type:= (
18                                                X"01", X"28", X"00" ,X"01" ,X"02" ,X"03" ,
19                                                X"04" ,X"05" ,X"06" ,X"07" ,X"08" ,X"09" ,
20                                                X"0a" ,X"0b" ,X"0c" ,X"0d" ,X"0e" ,X"0f" ,
21                                                X"10" ,X"11" ,X"12" ,X"13" ,X"14" ,X"15" ,
22                                                X"16" ,X"17" ,X"18" ,X"19" ,X"1a" ,X"1b" ,
23                                                X"1c" ,X"1d" ,X"1e" ,X"1f" ,X"20" ,X"21" ,
24                                                X"22" ,X"23" ,X"24" ,X"25" ,X"02", X"1e", 
25                                                X"00" ,X"01" ,X"02" ,X"03" ,X"04" ,X"05" ,
26                                                X"06" ,X"07" ,X"08" ,X"09" ,X"0a" ,X"0b" ,
27                                                X"0c" ,X"0d" ,X"0e" ,X"0f" ,X"10" ,X"11" ,
28                                                X"12" ,X"13" ,X"14" ,X"15" ,X"16" ,X"17" ,
29                                                X"18" ,X"19" ,X"1a" ,X"1b" );
30
31constant max_address : std_logic_vector(6 downto 0) :="1000101";
32signal address_counter : std_logic_vector(6 downto 0) := (others => '0');
33begin
34
35data <= ROM(conv_integer(address_counter));
36process (clk)
37  begin
38     if rising_edge(clk) then
39        if reset = '1' then
40            wr_en <='1';
41            address_counter <= (others=>'0');
42        elsif address_counter < max_address then
43             wr_en <='1';
44              address_counter <= address_counter +1;
45             else
46             wr_en <='0';
47             end if;
48    end if;
49  end process;
50end behavioral;
Note: See TracBrowser for help on using the repository browser.