1 | -- GENERATEUR DE STIMILUS POUR LE TEST DU SWITCH CROSSBAR |
---|
2 | |
---|
3 | library ieee; |
---|
4 | use ieee.std_logic_1164.all; |
---|
5 | use ieee.std_logic_unsigned.all; |
---|
6 | use IEEE.STD_LOGIC_ARITH.ALL; |
---|
7 | |
---|
8 | entity stimuli45 is |
---|
9 | port (clk : in std_logic; |
---|
10 | reset : in std_logic; |
---|
11 | wr_en : out std_logic; |
---|
12 | data : out std_logic_vector(7 downto 0)); |
---|
13 | end stimuli45; |
---|
14 | |
---|
15 | architecture behavioral of stimuli45 is |
---|
16 | type rom_type is array (0 to 69) of std_logic_vector (7 downto 0); |
---|
17 | signal ROM : rom_type:= ( |
---|
18 | X"55", 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"52", 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 | |
---|
31 | constant max_address : std_logic_vector(6 downto 0) :="1000101"; |
---|
32 | signal address_counter : std_logic_vector(6 downto 0) := (others => '0'); |
---|
33 | begin |
---|
34 | |
---|
35 | data <= ROM(conv_integer(address_counter)); |
---|
36 | process (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; |
---|
50 | end behavioral; |
---|