c2b040193a777c09bdc595c95492b57a2521db87
Stefan Schuermans added file headers

Stefan Schuermans authored 12 years ago

1) -- MIPS I system
2) -- Copyright 2011-2012 Stefan Schuermans <stefan@schuermans.info>
3) -- Copyleft GNU public license V2 or later
4) --          http://www.gnu.org/copyleft/gpl.html
5) 
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

6) LIBRARY IEEE;
7) USE IEEE.STD_LOGIC_1164.ALL;
8) USE IEEE.NUMERIC_STD.ALL;
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

9) USE work.io_lcd_pins.all;
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

10) USE work.io_switches_pins.all;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

11) 
12) ENTITY e_system IS
13)     PORT (
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

14)         clk:              IN  std_logic;
15)         pin_o_leds:       OUT std_logic_vector(7 DOWNTO 0);
16)         pin_o_lcd:        OUT t_io_lcd_pins;
17)         pin_i_switches:   IN  t_io_switches_pins;
18)         pin_i_uart_rx:    IN  std_logic;
19)         pin_o_uart_tx:    OUT std_logic;
20)         pin_o_eth_nrst:   OUT std_logic;
21)         pin_i_eth_rx_clk: IN  std_logic;
22)         pin_i_eth_rxd:    IN  std_logic_vector(4 DOWNTO 0);
23)         pin_i_eth_rx_dv:  IN  std_logic;
24)         pin_i_eth_crs:    IN  std_logic;
25)         pin_i_eth_col:    IN  std_logic;
26)         pin_i_eth_tx_clk: IN  std_logic;
27)         pin_o_eth_txd:    OUT std_logic_vector(3 DOWNTO 0);
28)         pin_o_eth_tx_en:  OUT std_logic
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

29)     );
30) END ENTITY e_system;
31) 
32) ARCHITECTURE a_system OF e_system IS
33) 
Stefan Schuermans progmem 8KB -> 16KB

Stefan Schuermans authored 12 years ago

34)     CONSTANT c_instr_addr_width: natural := 14;
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

35)     CONSTANT c_data_addr_width:  natural := 13;
36) 
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

37)     SIGNAL rst: std_logic := '0';
38) 
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

39)     SIGNAL s_instr_addr:   std_logic_vector(31 DOWNTO 0);
40)     SIGNAL s_instr_data:   std_logic_vector(31 DOWNTO 0);
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

41) 
42)     SIGNAL s_core_req:     std_logic;
43)     SIGNAL s_core_grant:   std_logic;
44)     SIGNAL s_core_addr:    std_logic_vector(31 DOWNTO 0);
45)     SIGNAL s_core_rd_data: std_logic_vector(31 DOWNTO 0);
46)     SIGNAL s_core_rd_en:   std_logic_vector( 3 DOWNTO 0);
47)     SIGNAL s_core_wr_data: std_logic_vector(31 DOWNTO 0);
48)     SIGNAL s_core_wr_en:   std_logic_vector( 3 DOWNTO 0);
49)     SIGNAL s_ethbm_req:     std_logic;
50)     SIGNAL s_ethbm_grant:   std_logic;
51)     SIGNAL s_ethbm_addr:    std_logic_vector(31 DOWNTO 0);
52)     SIGNAL s_ethbm_rd_data: std_logic_vector(31 DOWNTO 0);
53)     SIGNAL s_ethbm_rd_en:   std_logic_vector( 3 DOWNTO 0);
54)     SIGNAL s_ethbm_wr_data: std_logic_vector(31 DOWNTO 0);
55)     SIGNAL s_ethbm_wr_en:   std_logic_vector( 3 DOWNTO 0);
56) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

57)     SIGNAL s_dbus_addr:    std_logic_vector(31 DOWNTO 0);
58)     SIGNAL s_dbus_rd_data: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

59)     SIGNAL s_dbus_rd_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

60)     SIGNAL s_dbus_wr_data: std_logic_vector(31 DOWNTO 0);
61)     SIGNAL s_dbus_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans removed bottleneck from dat...

Stefan Schuermans authored 12 years ago

62) 
63)     SIGNAL r_dbus_addr_delay: std_logic_vector(31 DOWNTO 0) := (OTHERS => '0');
64) 
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

65)     SIGNAL s_data_addr:    std_logic_vector(31 DOWNTO 0);
66)     SIGNAL s_data_rd_data: std_logic_vector(31 DOWNTO 0);
67)     SIGNAL s_data_wr_data: std_logic_vector(31 DOWNTO 0);
68)     SIGNAL s_data_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

69)     SIGNAL s_leds_rd_data: std_logic_vector( 7 DOWNTO 0);
70)     SIGNAL s_leds_wr_data: std_logic_vector( 7 DOWNTO 0);
71)     SIGNAL s_leds_wr_en:   std_logic;
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

72)     SIGNAL s_lcd_rd_data: std_logic_vector(31 DOWNTO 0);
73)     SIGNAL s_lcd_wr_data: std_logic_vector(31 DOWNTO 0);
74)     SIGNAL s_lcd_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

75)     SIGNAL s_switches_addr:    std_logic_vector( 2 DOWNTO 0);
76)     SIGNAL s_switches_rd_data: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

77)     SIGNAL s_uart_addr:    std_logic_vector( 3 DOWNTO 0);
78)     SIGNAL s_uart_rd_data: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

79)     SIGNAL s_uart_rd_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

80)     SIGNAL s_uart_wr_data: std_logic_vector(31 DOWNTO 0);
81)     SIGNAL s_uart_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented ethernet TX fra...

Stefan Schuermans authored 12 years ago

82)     SIGNAL s_eth_addr:    std_logic_vector( 5 DOWNTO 0);
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

83)     SIGNAL s_eth_rd_data: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

84)     SIGNAL s_eth_rd_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

85)     SIGNAL s_eth_wr_data: std_logic_vector(31 DOWNTO 0);
86)     SIGNAL s_eth_wr_en:   std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

87)     SIGNAL s_cyc_cnt_rd_data: std_logic_vector(31 DOWNTO 0);
88)     SIGNAL s_cyc_cnt_wr_data: std_logic_vector(31 DOWNTO 0);
89)     SIGNAL s_cyc_cnt_wr_en:   std_logic;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

90) 
91)     COMPONENT e_mips_core IS
92)         PORT (
93)             rst:            IN  std_logic;
94)             clk:            IN  std_logic;
95)             o_instr_addr:   OUT std_logic_vector(31 DOWNTO 0);
96)             i_instr_data:   IN  std_logic_vector(31 DOWNTO 0);
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

97)             o_data_req:     OUT std_logic;
98)             i_data_grant:   IN  std_logic;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

99)             o_data_addr:    OUT std_logic_vector(31 DOWNTO 0);
100)             i_data_rd_data: IN  std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

101)             o_data_rd_en:   OUT std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

102)             o_data_wr_data: OUT std_logic_vector(31 DOWNTO 0);
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

103)             o_data_wr_en:   OUT std_logic_vector( 3 DOWNTO 0)
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

104)         );
105)     END COMPONENT e_mips_core;
106) 
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

107)     COMPONENT e_rom IS
108)         GENERIC (
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

110)         );
111)         PORT (
112)             clk:    IN  std_logic;
113)             i_addr: IN  std_logic_vector(addr_width - 1 DOWNTO 0);
114)             o_data: OUT std_logic_vector(            31 DOWNTO 0)
115)         );
116)     END COMPONENT e_rom;
117) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

121)         );
122)         PORT (
123)             clk:       IN  std_logic;
124)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

127)             i_wr_en:   IN  std_logic
128)         );
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

129)     END COMPONENT e_ram_0;
130) 
131)     COMPONENT e_ram_1 IS
132)         GENERIC (
133)             addr_width: natural
134)         );
135)         PORT (
136)             clk:       IN  std_logic;
137)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
138)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
139)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
140)             i_wr_en:   IN  std_logic
141)         );
142)     END COMPONENT e_ram_1;
143) 
144)     COMPONENT e_ram_2 IS
145)         GENERIC (
146)             addr_width: natural
147)         );
148)         PORT (
149)             clk:       IN  std_logic;
150)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
151)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
152)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
153)             i_wr_en:   IN  std_logic
154)         );
155)     END COMPONENT e_ram_2;
156) 
157)     COMPONENT e_ram_3 IS
158)         GENERIC (
159)             addr_width: natural
160)         );
161)         PORT (
162)             clk:       IN  std_logic;
163)             i_addr:    IN  std_logic_vector(addr_width - 1 DOWNTO 0);
164)             o_rd_data: OUT std_logic_vector(             7 DOWNTO 0);
165)             i_wr_data: IN  std_logic_vector(             7 DOWNTO 0);
166)             i_wr_en:   IN  std_logic
167)         );
168)     END COMPONENT e_ram_3;
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

172)             rst:        IN  std_logic;
173)             clk:        IN  std_logic;
174)             o_rd_data:  OUT std_logic_vector(7 DOWNTO 0);
175)             i_wr_data:  IN  std_logic_vector(7 DOWNTO 0);
176)             i_wr_en:    IN  std_logic;
177)             pin_o_leds: OUT std_logic_vector(7 DOWNTO 0)
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

180) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

181)     COMPONENT e_io_lcd IS
182)         PORT (
183)             rst:       IN  std_logic;
184)             clk:       IN  std_logic;
185)             o_rd_data: OUT std_logic_vector(31 DOWNTO 0);
186)             i_wr_data: IN  std_logic_vector(31 DOWNTO 0);
187)             i_wr_en:   IN  std_logic_vector( 3 DOWNTO 0);
188)             pin_o_lcd: OUT t_io_lcd_pins
189)         );
190)     END COMPONENT e_io_lcd;
191) 
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

192)     COMPONENT e_io_switches IS
193)         PORT (
194)             rst:            IN  std_logic;
195)             clk:            IN  std_logic;
196)             i_addr:         IN  std_logic_vector( 0 DOWNTO 0);
197)             o_rd_data:      OUT std_logic_vector(31 DOWNTO 0);
198)             pin_i_switches: IN  t_io_switches_pins
199)         );
200)     END COMPONENT e_io_switches;
201) 
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

202)     COMPONENT e_io_uart IS
203)         PORT (
204)             rst:       IN  std_logic;
205)             clk:       IN  std_logic;
206)             i_addr:    IN  std_logic_vector( 1 DOWNTO 0);
207)             o_rd_data: OUT std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

208)             i_rd_en:   IN  std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

209)             i_wr_data: IN  std_logic_vector(31 DOWNTO 0);
210)             i_wr_en:   IN  std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented RX part of UART...

Stefan Schuermans authored 12 years ago

211)             pin_i_rx:  IN  std_logic;
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

212)             pin_o_tx:  OUT std_logic
213)         );
214)     END COMPONENT e_io_uart;
215) 
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

216)     COMPONENT e_io_eth IS
217)         PORT (
218)             rst:          IN  std_logic;
219)             clk:          IN  std_logic;
Stefan Schuermans implemented ethernet TX fra...

Stefan Schuermans authored 12 years ago

220)             i_addr:       IN  std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

221)             o_rd_data:    OUT std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

222)             i_rd_en:      IN  std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

223)             i_wr_data:    IN  std_logic_vector(31 DOWNTO 0);
224)             i_wr_en:      IN  std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

225)             o_bm_req:     OUT std_logic;
226)             i_bm_grant:   IN  std_logic;
227)             o_bm_addr:    OUT std_logic_vector(31 DOWNTO 0);
228)             i_bm_rd_data: IN  std_logic_vector(31 DOWNTO 0);
229)             o_bm_rd_en:   OUT std_logic_vector( 3 DOWNTO 0);
230)             o_bm_wr_data: OUT std_logic_vector(31 DOWNTO 0);
231)             o_bm_wr_en:   OUT std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

232)             pin_o_nrst:   OUT std_logic;
233)             pin_i_rx_clk: IN  std_logic;
234)             pin_i_rxd:    IN  std_logic_vector(4 DOWNTO 0);
235)             pin_i_rx_dv:  IN  std_logic;
236)             pin_i_crs:    IN  std_logic;
237)             pin_i_col:    IN  std_logic;
238)             pin_i_tx_clk: IN  std_logic;
239)             pin_o_txd:    OUT std_logic_vector(3 DOWNTO 0);
240)             pin_o_tx_en:  OUT std_logic
241)         );
242)     END COMPONENT e_io_eth;
243) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

244)     COMPONENT e_io_cyc_cnt IS
245)         PORT (
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

246)             rst:       IN  std_logic;
247)             clk:       IN  std_logic;
248)             o_rd_data: OUT std_logic_vector(31 DOWNTO 0);
249)             i_wr_data: IN  std_logic_vector(31 DOWNTO 0);
250)             i_wr_en:   IN  std_logic
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

251)         );
252)     END COMPONENT e_io_cyc_cnt;
253) 
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

254) BEGIN
255) 
256)     core: e_mips_core
257)         PORT MAP (
258)             rst            => rst,
259)             clk            => clk,
260)             o_instr_addr   => s_instr_addr,
261)             i_instr_data   => s_instr_data,
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

262)             o_data_req     => s_core_req,
263)             i_data_grant   => s_core_grant,
264)             o_data_addr    => s_core_addr,
265)             i_data_rd_data => s_core_rd_data,
266)             o_data_rd_en   => s_core_rd_en,
267)             o_data_wr_data => s_core_wr_data,
268)             o_data_wr_en   => s_core_wr_en
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

272)         GENERIC MAP (
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

273)             addr_width => c_instr_addr_width - 2
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

274)         )
275)         PORT MAP (
276)             clk    => clk,
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

277)             i_addr => s_instr_addr(c_instr_addr_width - 1 DOWNTO 2),
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

278)             o_data => s_instr_data
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

279)         );
280) 
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

281)     p_dbus_arbit: PROCESS(s_ethbm_req, s_core_req)
282)     BEGIN
283)         s_ethbm_grant <= '0';
284)         s_core_grant  <= '0';
285)         IF s_ethbm_req = '1' THEN
286)             s_ethbm_grant <= '1';
287)         ELSIF s_core_req = '1' THEN
288)             s_core_grant <= '1';
289)         END IF;
290)     END PROCESS p_dbus_arbit;
291) 
292)     p_dbus_arbit_wr: PROCESS(s_ethbm_grant, s_ethbm_addr, s_ethbm_rd_en,
293)                                             s_ethbm_wr_data, s_ethbm_wr_en,
294)                              s_core_grant, s_core_addr, s_core_rd_en,
295)                                            s_core_wr_data, s_core_wr_en)
296)     BEGIN
297)         s_dbus_addr    <= (OTHERS => '0');
298)         s_dbus_rd_en   <= (OTHERS => '0');
299)         s_dbus_wr_data <= (OTHERS => '0');
300)         s_dbus_wr_en   <= (OTHERS => '0');
301)         IF s_ethbm_grant = '1' THEN
302)             s_dbus_addr    <= s_ethbm_addr;
303)             s_dbus_rd_en   <= s_ethbm_rd_en;
304)             s_dbus_wr_data <= s_ethbm_wr_data;
305)             s_dbus_wr_en   <= s_ethbm_wr_en;
306)         ELSIF s_core_grant = '1' THEN
307)             s_dbus_addr    <= s_core_addr;
308)             s_dbus_rd_en   <= s_core_rd_en;
309)             s_dbus_wr_data <= s_core_wr_data;
310)             s_dbus_wr_en   <= s_core_wr_en;
311)         END IF;
312)     END PROCESS p_dbus_arbit_wr;
313) 
314)     s_ethbm_rd_data <= s_dbus_rd_data;
315)     s_core_rd_data  <= s_dbus_rd_data;
316) 
Stefan Schuermans removed bottleneck from dat...

Stefan Schuermans authored 12 years ago

317)     p_dbus_rd_sync: PROCESS(rst, clk)
318)     BEGIN
319)         IF rst = '1' THEN
320)             r_dbus_addr_delay <= (OTHERS => '0');
321)         ELSIF rising_edge(clk) THEN
322)             r_dbus_addr_delay <= s_dbus_addr;
323)         END IF;
324)     END PROCESS p_dbus_rd_sync;
325) 
326)     p_dbus_rd: PROCESS(r_dbus_addr_delay,
327)                        s_data_rd_data,
328)                        s_leds_rd_data,
329)                        s_lcd_rd_data,
330)                        s_switches_rd_data,
331)                        s_uart_rd_data,
332)                        s_eth_rd_data,
333)                        s_cyc_cnt_rd_data)
334)     BEGIN
335)         s_dbus_rd_data <= (OTHERS => '0');
336)         IF r_dbus_addr_delay(31) = '0' THEN
337)             s_dbus_rd_data <= s_data_rd_data;
338)         ELSIF r_dbus_addr_delay(31 DOWNTO 16) = X"8000" THEN
339)             CASE r_dbus_addr_delay(15 DOWNTO 8) IS
340)                 WHEN X"00" =>
341)                     s_dbus_rd_data <= X"000000" & s_leds_rd_data;
342)                 WHEN X"01" =>
343)                     s_dbus_rd_data <= s_lcd_rd_data;
344)                 WHEN X"02" =>
345)                     s_dbus_rd_data <= s_switches_rd_data;
346)                 WHEN X"03" =>
347)                     s_dbus_rd_data <= s_uart_rd_data;
348)                 WHEN X"04" =>
349)                     s_dbus_rd_data <= s_eth_rd_data;
350)                 WHEN X"10" =>
351)                     s_dbus_rd_data <= s_cyc_cnt_rd_data;
352)                 WHEN OTHERS => NULL;
353)             END CASE;
354)         END IF;
355)     END PROCESS p_dbus_rd;
356) 
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

357)     p_dbus_wr: PROCESS(s_dbus_addr, s_dbus_rd_en,
358)                        s_dbus_wr_data, s_dbus_wr_en)
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

360)     BEGIN
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

363)         s_data_addr    <= (OTHERS => '0');
364)         s_data_wr_data <= (OTHERS => '0');
365)         s_data_wr_en   <= (OTHERS => '0');
366)         s_leds_wr_data <= (OTHERS => '0');
367)         s_leds_wr_en   <= '0';
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

368)         s_lcd_wr_data <= (OTHERS => '0');
369)         s_lcd_wr_en   <= (OTHERS => '0');
Stefan Schuermans remove unwanted latch

Stefan Schuermans authored 12 years ago

370)         s_switches_addr <= (OTHERS => '0');
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

371)         s_uart_addr    <= (OTHERS => '0');
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

372)         s_uart_rd_en   <= (OTHERS => '0');
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

373)         s_uart_wr_data <= (OTHERS => '0');
374)         s_uart_wr_en   <= (OTHERS => '0');
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

375)         s_eth_addr    <= (OTHERS => '0');
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

376)         s_eth_rd_en   <= (OTHERS => '0');
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

377)         s_eth_wr_data <= (OTHERS => '0');
378)         s_eth_wr_en   <= (OTHERS => '0');
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

379)         s_cyc_cnt_wr_data <= (OTHERS => '0');
380)         s_cyc_cnt_wr_en   <= '0';
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

381)         IF s_dbus_addr(31) = '0' THEN
382)             s_data_addr    <= s_dbus_addr;
383)             s_data_wr_data <= s_dbus_wr_data;
384)             s_data_wr_en   <= s_dbus_wr_en;
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

385)         ELSIF s_dbus_addr(31 DOWNTO 16) = X"8000" THEN
386)             CASE s_dbus_addr(15 DOWNTO 8) IS
387)                 WHEN X"00" =>
388)                     s_leds_wr_data <= s_dbus_wr_data(7 DOWNTO 0);
389)                     s_leds_wr_en   <= s_dbus_wr_en(0);
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

390)                 WHEN X"01" =>
Stefan Schuermans removed bottleneck from dat...

Stefan Schuermans authored 12 years ago

391)                     s_lcd_wr_data <= s_dbus_wr_data;
392)                     s_lcd_wr_en   <= s_dbus_wr_en;
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

393)                 WHEN X"02" =>
394)                     s_switches_addr <= s_dbus_addr(2 DOWNTO 0);
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

395)                 WHEN X"03" =>
396)                     s_uart_addr    <= s_dbus_addr(3 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

397)                     s_uart_rd_en   <= s_dbus_rd_en;
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

398)                     s_uart_wr_data <= s_dbus_wr_data;
399)                     s_uart_wr_en   <= s_dbus_wr_en;
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

400)                 WHEN X"04" =>
Stefan Schuermans implemented ethernet TX fra...

Stefan Schuermans authored 12 years ago

401)                     s_eth_addr    <= s_dbus_addr(5 DOWNTO 0);
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

402)                     s_eth_rd_en   <= s_dbus_rd_en;
Stefan Schuermans removed bottleneck from dat...

Stefan Schuermans authored 12 years ago

403)                     s_eth_wr_data <= s_dbus_wr_data;
404)                     s_eth_wr_en   <= s_dbus_wr_en;
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

405)                 WHEN X"10" =>
406)                     s_cyc_cnt_wr_data <= s_dbus_wr_data;
407)                     s_cyc_cnt_wr_en   <= v_wr_en_word;
408)                 WHEN OTHERS => NULL;
409)             END CASE;
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

410)         END IF;
Stefan Schuermans removed bottleneck from dat...

Stefan Schuermans authored 12 years ago

411)     END PROCESS p_dbus_wr;
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

412) 
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

413)     data_0: e_ram_0
414)         GENERIC MAP (
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

415)             addr_width => c_data_addr_width - 2
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

416)         )
417)         PORT MAP (
418)             clk       => clk,
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

419)             i_addr    => s_data_addr(c_data_addr_width - 1 DOWNTO 2),
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

420)             o_rd_data => s_data_rd_data(7 DOWNTO 0),
421)             i_wr_data => s_data_wr_data(7 DOWNTO 0),
422)             i_wr_en   => s_data_wr_en(0)
423)         );
424) 
425)     data_1: e_ram_1
426)         GENERIC MAP (
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

427)             addr_width => c_data_addr_width - 2
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

428)         )
429)         PORT MAP (
430)             clk       => clk,
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

431)             i_addr    => s_data_addr(c_data_addr_width - 1 DOWNTO 2),
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

432)             o_rd_data => s_data_rd_data(15 DOWNTO 8),
433)             i_wr_data => s_data_wr_data(15 DOWNTO 8),
434)             i_wr_en   => s_data_wr_en(1)
435)         );
436) 
437)     data_2: e_ram_2
438)         GENERIC MAP (
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

439)             addr_width => c_data_addr_width - 2
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

440)         )
441)         PORT MAP (
442)             clk       => clk,
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

443)             i_addr    => s_data_addr(c_data_addr_width - 1 DOWNTO 2),
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

444)             o_rd_data => s_data_rd_data(23 DOWNTO 16),
445)             i_wr_data => s_data_wr_data(23 DOWNTO 16),
446)             i_wr_en   => s_data_wr_en(2)
447)         );
448) 
449)     data_3: e_ram_3
450)         GENERIC MAP (
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

451)             addr_width => c_data_addr_width - 2
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

452)         )
453)         PORT MAP (
454)             clk       => clk,
Stefan Schuermans increased code and data add...

Stefan Schuermans authored 12 years ago

455)             i_addr    => s_data_addr(c_data_addr_width - 1 DOWNTO 2),
Stefan Schuermans implemented loading of data...

Stefan Schuermans authored 12 years ago

456)             o_rd_data => s_data_rd_data(31 DOWNTO 24),
457)             i_wr_data => s_data_wr_data(31 DOWNTO 24),
458)             i_wr_en   => s_data_wr_en(3)
459)         );
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 12 years ago

461)     leds: e_io_leds
462)         PORT MAP (
463)             rst        => rst,
464)             clk        => clk,
465)             o_rd_data  => s_leds_rd_data,
466)             i_wr_data  => s_leds_wr_data,
467)             i_wr_en    => s_leds_wr_en,
468)             pin_o_leds => pin_o_leds
469)         );
Stefan Schuermans implented basic system with...

Stefan Schuermans authored 12 years ago

470) 
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

471)     lcd: e_io_lcd
472)         PORT MAP (
473)             rst       => rst,
474)             clk       => clk,
475)             o_rd_data => s_lcd_rd_data,
476)             i_wr_data => s_lcd_wr_data,
477)             i_wr_en   => s_lcd_wr_en,
478)             pin_o_lcd => pin_o_lcd
479)         );
480) 
Stefan Schuermans implemented switches

Stefan Schuermans authored 12 years ago

481)     switches: e_io_switches
482)         PORT MAP (
483)             rst            => rst,
484)             clk            => clk,
485)             i_addr         => s_switches_addr(2 DOWNTO 2),
486)             o_rd_data      => s_switches_rd_data,
487)             pin_i_switches => pin_i_switches
488)         );
489) 
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

490)     uart: e_io_uart
491)         PORT MAP (
492)             rst       => rst,
493)             clk       => clk,
494)             i_addr    => s_uart_addr(3 DOWNTO 2),
495)             o_rd_data => s_uart_rd_data,
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

496)             i_rd_en   => s_uart_rd_en,
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

497)             i_wr_data => s_uart_wr_data,
498)             i_wr_en   => s_uart_wr_en,
Stefan Schuermans implemented RX part of UART...

Stefan Schuermans authored 12 years ago

499)             pin_i_rx  => pin_i_uart_rx,
Stefan Schuermans implemented TX part of UART...

Stefan Schuermans authored 12 years ago

500)             pin_o_tx  => pin_o_uart_tx
501)         );
502) 
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

503)     eth: e_io_eth
504)         PORT MAP (
505)             rst          => rst,
506)             clk          => clk,
Stefan Schuermans implemented ethernet TX fra...

Stefan Schuermans authored 12 years ago

507)             i_addr       => s_eth_addr(5 DOWNTO 2),
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

508)             o_rd_data    => s_eth_rd_data,
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

509)             i_rd_en      => s_eth_rd_en,
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

510)             i_wr_data    => s_eth_wr_data,
511)             i_wr_en      => s_eth_wr_en,
Stefan Schuermans implemented multi-master fe...

Stefan Schuermans authored 12 years ago

512)             o_bm_req     => s_ethbm_req,
513)             i_bm_grant   => s_ethbm_grant,
514)             o_bm_addr    => s_ethbm_addr,
515)             i_bm_rd_data => s_ethbm_rd_data,
516)             o_bm_rd_en   => s_ethbm_rd_en,
517)             o_bm_wr_data => s_ethbm_wr_data,
518)             o_bm_wr_en   => s_ethbm_wr_en,
Stefan Schuermans begin of ethernet RX implem...

Stefan Schuermans authored 12 years ago

519)             pin_o_nrst   => pin_o_eth_nrst,
520)             pin_i_rx_clk => pin_i_eth_rx_clk,
521)             pin_i_rxd    => pin_i_eth_rxd,
522)             pin_i_rx_dv  => pin_i_eth_rx_dv,
523)             pin_i_crs    => pin_i_eth_crs,
524)             pin_i_col    => pin_i_eth_col,
525)             pin_i_tx_clk => pin_i_eth_tx_clk,
526)             pin_o_txd    => pin_o_eth_txd,
527)             pin_o_tx_en  => pin_o_eth_tx_en
528)         );
529) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

530)     cyc_cnt: e_io_cyc_cnt
531)         PORT MAP (
Stefan Schuermans implemented LCD peripheral

Stefan Schuermans authored 12 years ago

532)             rst       => rst,
533)             clk       => clk,
534)             o_rd_data => s_cyc_cnt_rd_data,
535)             i_wr_data => s_cyc_cnt_wr_data,
536)             i_wr_en   => s_cyc_cnt_wr_en
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

537)         );
538)