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 cycle counter 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_cyc_cnt IS
11)     PORT (
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

12)         rst:       IN  std_logic;
13)         clk:       IN  std_logic;
14)         o_rd_data: OUT std_logic_vector(31 DOWNTO 0);
15)         i_wr_data: IN  std_logic_vector(31 DOWNTO 0);
16)         i_wr_en:   IN  std_logic
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

17)     );
18) END ENTITY e_io_cyc_cnt;
19) 
20) ARCHITECTURE a_io_cyc_cnt OF e_io_cyc_cnt IS
21) 
22)     SIGNAL n_cnt: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

23)     SIGNAL r_cnt: std_logic_vector(31 DOWNTO 0) := (OTHERS => '0');
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

24) 
25) BEGIN
26) 
27)     p_write: PROCESS(r_cnt, i_wr_data, i_wr_en)
28)     BEGIN
29)         IF i_wr_en = '1' THEN
30)             n_cnt <= i_wr_data;
31)         ELSE
32)             n_cnt <= std_logic_vector(unsigned(r_cnt) + to_unsigned(1, 32));
33)         END IF;
34)     END PROCESS p_write;
35) 
36)     p_sync: PROCESS(rst, clk)
37)     BEGIN
38)         IF rst = '1' THEN
39)             r_cnt <= (OTHERS => '0');
40)         ELSIF rising_edge(clk) THEN
41)             r_cnt <= n_cnt;
42)         END IF;
43)     END PROCESS p_sync;
44) 
Stefan Schuermans read peripherals with one c...

Stefan Schuermans authored 12 years ago

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