902aa402b3830b9c9aa26758390b6eb93b42a0f5
Stefan Schuermans added file headers

Stefan Schuermans authored 12 years ago

1) -- MIPS I system
Stefan Schuermans replace email address in he...

Stefan Schuermans authored 12 years ago

2) -- Copyright 2011-2012 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans added file headers

Stefan Schuermans authored 12 years ago

3) -- Copyleft GNU public license V2 or later
4) --          http://www.gnu.org/copyleft/gpl.html
5) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

6) LIBRARY IEEE;
7) USE IEEE.STD_LOGIC_1164.ALL;
8) USE IEEE.NUMERIC_STD.ALL;
9) 
10) ENTITY e_io_leds IS
11)     PORT (
12)         rst:        IN  std_logic;
13)         clk:        IN  std_logic;
14)         o_rd_data:  OUT std_logic_vector(7 DOWNTO 0);
15)         i_wr_data:  IN  std_logic_vector(7 DOWNTO 0);
16)         i_wr_en:    IN  std_logic;
17)         pin_o_leds: OUT std_logic_vector(7 DOWNTO 0)
18)     );
19) END ENTITY e_io_leds;
20) 
21) ARCHITECTURE a_io_leds OF e_io_leds IS
22) 
23)     SIGNAL n_leds: std_logic_vector(7 DOWNTO 0);
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

24)     SIGNAL r_leds: std_logic_vector(7 DOWNTO 0) := (OTHERS => '0');
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

25) 
26) BEGIN
27) 
Stefan Schuermans read peripherals with one c...

Stefan Schuermans authored 12 years ago

28)     p_next: PROCESS(r_leds, i_wr_data, i_wr_en)
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

29)     BEGIN
30)         IF i_wr_en = '1' THEN
31)             n_leds <= i_wr_data;
32)         ELSE
33)             n_leds <= r_leds;
34)         END IF;
Stefan Schuermans read peripherals with one c...

Stefan Schuermans authored 12 years ago

35)     END PROCESS p_next;
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

36) 
37)     p_sync: PROCESS(rst, clk)
38)     BEGIN
39)         IF rst = '1' THEN
40)             r_leds <= (OTHERS => '0');
41)         ELSIF rising_edge(clk) THEN
42)             r_leds <= n_leds;
43)         END IF;
44)     END PROCESS p_sync;
45) 
Stefan Schuermans read peripherals with one c...

Stefan Schuermans authored 12 years ago

46)     p_read: PROCESS(rst, clk)
47)     BEGIN
48)         IF rst = '1' THEN
49)             o_rd_data <= (OTHERS => '0');
50)         ELSIF rising_edge(clk) THEN
51)             o_rd_data <= r_leds;
52)         END IF;
53)     END PROCESS p_read;
54) 
55)     pin_o_leds <= r_leds;
56)