0e00df4ec71e883b658e8099259c566572f272de
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

1) LIBRARY IEEE;
2) USE IEEE.STD_LOGIC_1164.ALL;
3) USE IEEE.NUMERIC_STD.ALL;
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

4) USE work.io_lcd_pins.all;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

5) 
6) ENTITY e_system IS
7)     PORT (
Stefan Schuermans whitespace fix

Stefan Schuermans authored 12 years ago

8)         rst:        IN  std_logic;
9)         clk:        IN  std_logic;
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

10)         pin_o_leds: OUT std_logic_vector(7 DOWNTO 0);
11)         pin_o_lcd:  OUT t_io_lcd_pins
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

12)     );
13) END ENTITY e_system;
14) 
15) ARCHITECTURE a_system OF e_system IS
16) 
17)     SIGNAL s_instr_addr:   std_logic_vector(31 DOWNTO 0);
18)     SIGNAL s_instr_data:   std_logic_vector(31 DOWNTO 0);
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

19)     SIGNAL s_dbus_addr:    std_logic_vector(31 DOWNTO 0);
20)     SIGNAL s_dbus_rd_data: std_logic_vector(31 DOWNTO 0);
21)     SIGNAL s_dbus_wr_data: std_logic_vector(31 DOWNTO 0);
22)     SIGNAL s_dbus_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

23)     SIGNAL s_data_addr:    std_logic_vector(31 DOWNTO 0);
24)     SIGNAL s_data_rd_data: std_logic_vector(31 DOWNTO 0);
25)     SIGNAL s_data_wr_data: std_logic_vector(31 DOWNTO 0);
26)     SIGNAL s_data_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

27)     SIGNAL s_leds_rd_data: std_logic_vector( 7 DOWNTO 0);
28)     SIGNAL s_leds_wr_data: std_logic_vector( 7 DOWNTO 0);
29)     SIGNAL s_leds_wr_en:   std_logic;
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

30)     SIGNAL s_lcd_rd_data: std_logic_vector(31 DOWNTO 0);
31)     SIGNAL s_lcd_wr_data: std_logic_vector(31 DOWNTO 0);
32)     SIGNAL s_lcd_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

33)     SIGNAL s_cyc_cnt_rd_data: std_logic_vector(31 DOWNTO 0);
34)     SIGNAL s_cyc_cnt_wr_data: std_logic_vector(31 DOWNTO 0);
35)     SIGNAL s_cyc_cnt_wr_en:   std_logic;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

36) 
37)     COMPONENT e_mips_core IS
38)         PORT (
39)             rst:            IN  std_logic;
40)             clk:            IN  std_logic;
41)             i_stall:        IN  std_logic;
42)             o_instr_addr:   OUT std_logic_vector(31 DOWNTO 0);
43)             i_instr_data:   IN  std_logic_vector(31 DOWNTO 0);
44)             o_data_addr:    OUT std_logic_vector(31 DOWNTO 0);
45)             i_data_rd_data: IN  std_logic_vector(31 DOWNTO 0);
46)             o_data_wr_data: OUT std_logic_vector(31 DOWNTO 0);
47)             o_data_wr_en:   OUT std_logic_vector( 3 DOWNTO 0)
48)         );
49)     END COMPONENT e_mips_core;
50) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

51)     COMPONENT e_rom IS
52)         GENERIC (
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

53)             addr_width: natural
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

54)         );
55)         PORT (
56)             clk:    IN  std_logic;
57)             i_addr: IN  std_logic_vector(addr_width - 1 DOWNTO 0);
58)             o_data: OUT std_logic_vector(            31 DOWNTO 0)
59)         );
60)     END COMPONENT e_rom;
61) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

62)     COMPONENT e_ram_0 IS
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

63)         GENERIC (
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

64)             addr_width: natural
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

65)         );
66)         PORT (
67)             clk:       IN  std_logic;
68)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

69)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
70)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

71)             i_wr_en:   IN  std_logic
72)         );
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

73)     END COMPONENT e_ram_0;
74) 
75)     COMPONENT e_ram_1 IS
76)         GENERIC (
77)             addr_width: natural
78)         );
79)         PORT (
80)             clk:       IN  std_logic;
81)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
82)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
83)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
84)             i_wr_en:   IN  std_logic
85)         );
86)     END COMPONENT e_ram_1;
87) 
88)     COMPONENT e_ram_2 IS
89)         GENERIC (
90)             addr_width: natural
91)         );
92)         PORT (
93)             clk:       IN  std_logic;
94)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
95)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
96)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
97)             i_wr_en:   IN  std_logic
98)         );
99)     END COMPONENT e_ram_2;
100) 
101)     COMPONENT e_ram_3 IS
102)         GENERIC (
103)             addr_width: natural
104)         );
105)         PORT (
106)             clk:       IN  std_logic;
107)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
108)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
109)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
110)             i_wr_en:   IN  std_logic
111)         );
112)     END COMPONENT e_ram_3;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

113) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

114)     COMPONENT e_io_leds IS
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

115)         PORT (
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

116)             rst:        IN  std_logic;
117)             clk:        IN  std_logic;
118)             o_rd_data:  OUT std_logic_vector(7 DOWNTO 0);
119)             i_wr_data:  IN  std_logic_vector(7 DOWNTO 0);
120)             i_wr_en:    IN  std_logic;
121)             pin_o_leds: OUT std_logic_vector(7 DOWNTO 0)
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

122)         );
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

123)     END COMPONENT e_io_leds;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

124) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

125)     COMPONENT e_io_lcd IS
126)         PORT (
127)             rst:       IN  std_logic;
128)             clk:       IN  std_logic;
129)             o_rd_data: OUT std_logic_vector(31 DOWNTO 0);
130)             i_wr_data: IN  std_logic_vector(31 DOWNTO 0);
131)             i_wr_en:   IN  std_logic_vector( 3 DOWNTO 0);
132)             pin_o_lcd: OUT t_io_lcd_pins
133)         );
134)     END COMPONENT e_io_lcd;
135) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

136)     COMPONENT e_io_cyc_cnt IS
137)         PORT (
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

138)             rst:       IN  std_logic;
139)             clk:       IN  std_logic;
140)             o_rd_data: OUT std_logic_vector(31 DOWNTO 0);
141)             i_wr_data: IN  std_logic_vector(31 DOWNTO 0);
142)             i_wr_en:   IN  std_logic
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

143)         );
144)     END COMPONENT e_io_cyc_cnt;
145) 
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

146) BEGIN
147) 
148)     core: e_mips_core
149)         PORT MAP (
150)             rst            => rst,
151)             clk            => clk,
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

152)             i_stall        => '0',
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

153)             o_instr_addr   => s_instr_addr,
154)             i_instr_data   => s_instr_data,
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

155)             o_data_addr    => s_dbus_addr,
156)             i_data_rd_data => s_dbus_rd_data,
157)             o_data_wr_data => s_dbus_wr_data,
158)             o_data_wr_en   => s_dbus_wr_en
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

159)         );
160) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

161)     instr: e_rom
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

162)         GENERIC MAP (
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

163)             addr_width => 10
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

164)         )
165)         PORT MAP (
166)             clk    => clk,
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

167)             i_addr => s_instr_addr(11 DOWNTO 2),
168)             o_data => s_instr_data
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

169)         );
170) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

171)     p_dbus: PROCESS(s_dbus_addr, s_dbus_wr_data, s_dbus_wr_en,
172)                     s_data_rd_data,
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

173)                     s_leds_rd_data,
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

174)                     s_lcd_rd_data,
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

175)                     s_cyc_cnt_rd_data)
176)         VARIABLE v_wr_en_word: std_logic;
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

177)     BEGIN
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

178)         v_wr_en_word := s_dbus_wr_en(0) AND s_dbus_wr_en(1) AND
179)                         s_dbus_wr_en(2) AND s_dbus_wr_en(3);
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

180)         s_dbus_rd_data <= (OTHERS => '0');
181)         s_data_addr    <= (OTHERS => '0');
182)         s_data_wr_data <= (OTHERS => '0');
183)         s_data_wr_en   <= (OTHERS => '0');
184)         s_leds_wr_data <= (OTHERS => '0');
185)         s_leds_wr_en   <= '0';
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

186)         s_lcd_wr_data <= (OTHERS => '0');
187)         s_lcd_wr_en   <= (OTHERS => '0');
188)         s_cyc_cnt_wr_data <= (OTHERS => '0');
189)         s_cyc_cnt_wr_en   <= '0';
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

190)         IF s_dbus_addr(31) = '0' THEN
191)             s_dbus_rd_data <= s_data_rd_data;
192)             s_data_addr    <= s_dbus_addr;
193)             s_data_wr_data <= s_dbus_wr_data;
194)             s_data_wr_en   <= s_dbus_wr_en;
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

195)         ELSIF s_dbus_addr(31 DOWNTO 16) = X"8000" THEN
196)             CASE s_dbus_addr(15 DOWNTO 8) IS
197)                 WHEN X"00" =>
198)                     s_dbus_rd_data <= X"000000" & s_leds_rd_data;
199)                     s_leds_wr_data <= s_dbus_wr_data(7 DOWNTO 0);
200)                     s_leds_wr_en   <= s_dbus_wr_en(0);
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

201)                 WHEN X"01" =>
202)                     s_dbus_rd_data <= s_lcd_rd_data;
203)                     s_lcd_wr_data  <= s_dbus_wr_data;
204)                     s_lcd_wr_en    <= s_dbus_wr_en;
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

205)                 WHEN X"10" =>
206)                     s_dbus_rd_data    <= s_cyc_cnt_rd_data;
207)                     s_cyc_cnt_wr_data <= s_dbus_wr_data;
208)                     s_cyc_cnt_wr_en   <= v_wr_en_word;
209)                 WHEN OTHERS => NULL;
210)             END CASE;
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

211)         END IF;
212)     END PROCESS p_dbus;
213) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

214)     data_0: e_ram_0
215)         GENERIC MAP (
216)             addr_width => 10
217)         )
218)         PORT MAP (
219)             clk       => clk,
220)             i_addr    => s_data_addr(11 DOWNTO 2),
221)             o_rd_data => s_data_rd_data(7 DOWNTO 0),
222)             i_wr_data => s_data_wr_data(7 DOWNTO 0),
223)             i_wr_en   => s_data_wr_en(0)
224)         );
225) 
226)     data_1: e_ram_1
227)         GENERIC MAP (
228)             addr_width => 10
229)         )
230)         PORT MAP (
231)             clk       => clk,
232)             i_addr    => s_data_addr(11 DOWNTO 2),
233)             o_rd_data => s_data_rd_data(15 DOWNTO 8),
234)             i_wr_data => s_data_wr_data(15 DOWNTO 8),
235)             i_wr_en   => s_data_wr_en(1)
236)         );
237) 
238)     data_2: e_ram_2
239)         GENERIC MAP (
240)             addr_width => 10
241)         )
242)         PORT MAP (
243)             clk       => clk,
244)             i_addr    => s_data_addr(11 DOWNTO 2),
245)             o_rd_data => s_data_rd_data(23 DOWNTO 16),
246)             i_wr_data => s_data_wr_data(23 DOWNTO 16),
247)             i_wr_en   => s_data_wr_en(2)
248)         );
249) 
250)     data_3: e_ram_3
251)         GENERIC MAP (
252)             addr_width => 10
253)         )
254)         PORT MAP (
255)             clk       => clk,
256)             i_addr    => s_data_addr(11 DOWNTO 2),
257)             o_rd_data => s_data_rd_data(31 DOWNTO 24),
258)             i_wr_data => s_data_wr_data(31 DOWNTO 24),
259)             i_wr_en   => s_data_wr_en(3)
260)         );
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

261) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

262)     leds: e_io_leds
263)         PORT MAP (
264)             rst        => rst,
265)             clk        => clk,
266)             o_rd_data  => s_leds_rd_data,
267)             i_wr_data  => s_leds_wr_data,
268)             i_wr_en    => s_leds_wr_en,
269)             pin_o_leds => pin_o_leds
270)         );
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

271) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

272)     lcd: e_io_lcd
273)         PORT MAP (
274)             rst       => rst,
275)             clk       => clk,
276)             o_rd_data => s_lcd_rd_data,
277)             i_wr_data => s_lcd_wr_data,
278)             i_wr_en   => s_lcd_wr_en,
279)             pin_o_lcd => pin_o_lcd
280)         );
281) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

282)     cyc_cnt: e_io_cyc_cnt
283)         PORT MAP (
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

284)             rst       => rst,
285)             clk       => clk,
286)             o_rd_data => s_cyc_cnt_rd_data,
287)             i_wr_data => s_cyc_cnt_wr_data,
288)             i_wr_en   => s_cyc_cnt_wr_en
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

289)         );
290)