22b456946e289c89da296dcaceeb18de71761713
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

1) LIBRARY ieee;
2) USE ieee.std_logic_1164.all;
3) USE ieee.numeric_std.all;
4) USE work.mips_types.all;
5) 
6) ENTITY e_mips_core IS
7)     PORT (
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

8)         rst:            IN  std_logic;
9)         clk:            IN  std_logic;
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

10)         i_stall:        IN  std_logic;
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

11)         o_instr_addr:   OUT std_logic_vector(31 DOWNTO 0);
12)         i_instr_data:   IN  std_logic_vector(31 DOWNTO 0);
13)         o_data_addr:    OUT std_logic_vector(31 DOWNTO 0);
14)         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

15)         o_data_rd_en:   OUT std_logic_vector( 3 DOWNTO 0);
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

16)         o_data_wr_data: OUT std_logic_vector(31 DOWNTO 0);
17)         o_data_wr_en:   OUT std_logic_vector( 3 DOWNTO 0)
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

18)     );
19) END ENTITY e_mips_core;
20) 
21) ARCHITECTURE a_mips_core OF e_mips_core IS
22) 
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

23)     SIGNAL s_stall:         std_logic;
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

24)     SIGNAL r_stall_reset:   std_logic := '1';
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

25)     SIGNAL s_stall_data_rd: std_logic;
26) 
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

27)     SIGNAL r_pc:         std_logic_vector(31 DOWNTO 0) := X"FFFFFFFC";
28)     SIGNAL n_pc:         std_logic_vector(31 DOWNTO 0);
29)     SIGNAL r_instr_data: std_logic_vector(31 DOWNTO 0) := X"00000000";
30)     SIGNAL s_instr:      std_logic_vector(31 DOWNTO 0);
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

31) 
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

32)     SIGNAL n_reg_s:  std_logic_vector( 4 DOWNTO 0);
33)     SIGNAL n_reg_t:  std_logic_vector( 4 DOWNTO 0);
34)     SIGNAL n_reg_d:  std_logic_vector( 4 DOWNTO 0);
35)     SIGNAL n_imm_a:  std_logic_vector( 4 DOWNTO 0);
36)     SIGNAL n_imm_16: std_logic_vector(15 DOWNTO 0);
37)     SIGNAL n_imm_26: std_logic_vector(25 DOWNTO 0);
38)     SIGNAL n_op:     t_op;
39)     SIGNAL n_link:   t_link;
40)     SIGNAL n_cmp:    t_cmp;
41)     SIGNAL n_alu:    t_alu;
42)     SIGNAL n_imm:    t_imm;
Stefan Schuermans added decoding of simple lo...

Stefan Schuermans authored 12 years ago

43)     SIGNAL n_ldst:   t_ldst;
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

44) 
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

45)     SIGNAL r_reg_s:  std_logic_vector( 4 DOWNTO 0) := (OTHERS => '0');
46)     SIGNAL r_reg_t:  std_logic_vector( 4 DOWNTO 0) := (OTHERS => '0');
47)     SIGNAL r_reg_d:  std_logic_vector( 4 DOWNTO 0) := (OTHERS => '0');
48)     SIGNAL r_imm_a:  std_logic_vector( 4 DOWNTO 0) := (OTHERS => '0');
49)     SIGNAL r_imm_16: std_logic_vector(15 DOWNTO 0) := (OTHERS => '0');
50)     SIGNAL r_imm_26: std_logic_vector(25 DOWNTO 0) := (OTHERS => '0');
51)     SIGNAL r_op:     t_op                          := op_none;
52)     SIGNAL r_link:   t_link                        := link_none;
53)     SIGNAL r_cmp:    t_cmp                         := cmp_none;
54)     SIGNAL r_alu:    t_alu                         := alu_none;
55)     SIGNAL r_imm:    t_imm                         := imm_none;
56)     SIGNAL r_ldst:   t_ldst                        := ldst_none;
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

57) 
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

58)     SIGNAL s_val_s: std_logic_vector(31 DOWNTO 0);
59)     SIGNAL s_val_t: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

60) 
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

61)     SIGNAL s_alu_op1: std_logic_vector(31 DOWNTO 0);
62)     SIGNAL s_alu_op2: std_logic_vector(31 DOWNTO 0);
63)     SIGNAL s_alu_res: std_logic_vector(31 DOWNTO 0);
64) 
65)     SIGNAL s_cmp_op1: std_logic_vector(31 DOWNTO 0);
66)     SIGNAL s_cmp_op2: std_logic_vector(31 DOWNTO 0);
67)     SIGNAL s_cmp_res: std_logic;
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

68) 
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

69)     SIGNAL s_reg_wr_alu_no:   std_logic_vector( 4 DOWNTO 0);
70)     SIGNAL s_reg_wr_alu_data: std_logic_vector(31 DOWNTO 0);
71)     SIGNAL s_reg_wr_alu_en:   std_logic;
72) 
73)     SIGNAL s_reg_wr_data_no:   std_logic_vector( 4 DOWNTO 0);
74)     SIGNAL s_reg_wr_data_data: std_logic_vector(31 DOWNTO 0);
75)     SIGNAL s_reg_wr_data_en:   std_logic;
76) 
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

77)     SIGNAL s_reg_wr_hi_lo_no:   std_logic_vector( 4 DOWNTO 0);
78)     SIGNAL s_reg_wr_hi_lo_data: std_logic_vector(31 DOWNTO 0);
79)     SIGNAL s_reg_wr_hi_lo_en:   std_logic;
80) 
Stefan Schuermans implemented ... and link ->...

Stefan Schuermans authored 12 years ago

81)     SIGNAL s_reg_wr_link_no:   std_logic_vector( 4 DOWNTO 0);
82)     SIGNAL s_reg_wr_link_data: std_logic_vector(31 DOWNTO 0);
83)     SIGNAL s_reg_wr_link_en:   std_logic;
84) 
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

85)     SIGNAL s_reg_wr_no:   std_logic_vector( 4 DOWNTO 0);
86)     SIGNAL s_reg_wr_data: std_logic_vector(31 DOWNTO 0);
87)     SIGNAL s_reg_wr_en:   std_logic;
88) 
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

89)     SIGNAL s_data_addr: std_logic_vector(31 DOWNTO 0);
90) 
91)     TYPE t_data_rd IS (data_rd_idle, data_rd_read);
92)     SIGNAL n_data_rd: t_data_rd;
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

93)     SIGNAL r_data_rd: t_data_rd := data_rd_idle;
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

94) 
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

95)     SIGNAL n_reg_lo: std_logic_vector(31 DOWNTO 0);
96)     SIGNAL n_reg_hi: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans add initial values for regi...

Stefan Schuermans authored 12 years ago

97)     SIGNAL r_reg_lo: std_logic_vector(31 DOWNTO 0) := (OTHERS => '0');
98)     SIGNAL r_reg_hi: std_logic_vector(31 DOWNTO 0) := (OTHERS => '0');
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

99) 
Stefan Schuermans moved multiplier to own module

Stefan Schuermans authored 12 years ago

100)     SIGNAL s_mul_signed: std_logic;
101)     SIGNAL s_mul_start:  std_logic;
102)     SIGNAL s_mul_busy:   std_logic;
103)     SIGNAL s_mul_res:    std_logic_vector(63 DOWNTO 0);
Stefan Schuermans implemented multiplier

Stefan Schuermans authored 12 years ago

104) 
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

105)     SIGNAL s_div_signed: std_logic;
106)     SIGNAL s_div_start:  std_logic;
107)     SIGNAL s_div_busy:   std_logic;
108)     SIGNAL s_div_res:    std_logic_vector(31 DOWNTO 0);
109)     SIGNAL s_div_rem:    std_logic_vector(31 DOWNTO 0);
110) 
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

111)     COMPONENT e_mips_decoder IS
112)         PORT (
113)             i_instr:  IN  std_logic_vector(31 DOWNTO 0);
Stefan Schuermans rename src/dest to more gen...

Stefan Schuermans authored 12 years ago

114)             o_reg_s:  OUT std_logic_vector( 4 DOWNTO 0);
115)             o_reg_t:  OUT std_logic_vector( 4 DOWNTO 0);
116)             o_reg_d:  OUT std_logic_vector( 4 DOWNTO 0);
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

117)             o_imm_a:  OUT std_logic_vector( 4 DOWNTO 0);
118)             o_imm_16: OUT std_logic_vector(15 DOWNTO 0);
119)             o_imm_26: OUT std_logic_vector(25 DOWNTO 0);
120)             o_op:     OUT t_op;
121)             o_link:   OUT t_link;
122)             o_cmp:    OUT t_cmp;
123)             o_alu:    OUT t_alu;
Stefan Schuermans added decoding of simple lo...

Stefan Schuermans authored 12 years ago

124)             o_imm:    OUT t_imm;
125)             o_ldst:   OUT t_ldst
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

126)         );
127)     END COMPONENT e_mips_decoder;
128) 
Stefan Schuermans added register file

Stefan Schuermans authored 12 years ago

129)     COMPONENT e_mips_regs IS
130)         PORT (
131)             clk:         IN  std_logic;
132)             i_rd_a_no:   IN  std_logic_vector( 4 DOWNTO 0);
133)             o_rd_a_data: OUT std_logic_vector(31 DOWNTO 0);
134)             i_rd_b_no:   IN  std_logic_vector( 4 DOWNTO 0);
135)             o_rd_b_data: OUT std_logic_vector(31 DOWNTO 0);
136)             i_wr_no:     IN  std_logic_vector( 4 DOWNTO 0);
137)             i_wr_data:   IN  std_logic_vector(31 DOWNTO 0);
138)             i_wr_en:     IN  std_logic
139)         );
140)     END COMPONENT e_mips_regs;
141) 
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

142)     COMPONENT e_mips_alu IS
143)         PORT (
144)             i_alu: IN  t_alu;
145)             i_op1: IN  std_logic_vector(31 DOWNTO 0);
146)             i_op2: IN  std_logic_vector(31 DOWNTO 0);
147)             o_res: OUT std_logic_vector(31 DOWNTO 0)
148)         );
149)     END COMPONENT e_mips_alu;
150) 
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

151)     COMPONENT e_mips_cmp IS
152)         PORT (
153)             i_cmp: IN  t_cmp;
154)             i_op1: IN  std_logic_vector(31 DOWNTO 0);
155)             i_op2: IN  std_logic_vector(31 DOWNTO 0);
156)             o_res: OUT std_logic
157)         );
158)     END COMPONENT e_mips_cmp;
159) 
Stefan Schuermans moved multiplier to own module

Stefan Schuermans authored 12 years ago

160)     COMPONENT e_mips_mul IS
161)         PORT (
162)             rst:      IN  std_logic;
163)             clk:      IN  std_logic;
164)             i_a:      IN  std_logic_vector(31 DOWNTO 0);
165)             i_b:      IN  std_logic_vector(31 DOWNTO 0);
166)             i_signed: IN  std_logic;
167)             i_start:  IN  std_logic;
168)             o_busy:   OUT std_logic;
169)             o_res:    OUT std_logic_vector(63 DOWNTO 0)
170)         );
171)     END COMPONENT e_mips_mul;
172) 
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

173)     COMPONENT e_mips_div IS
174)         PORT (
175)             rst:      IN  std_logic;
176)             clk:      IN  std_logic;
177)             i_num:    IN  std_logic_vector(31 DOWNTO 0);
178)             i_denom:  IN  std_logic_vector(31 DOWNTO 0);
179)             i_signed: IN  std_logic;
180)             i_start:  IN  std_logic;
181)             o_busy:   OUT std_logic;
182)             o_res:    OUT std_logic_vector(31 DOWNTO 0);
183)             o_rem:    OUT std_logic_vector(31 DOWNTO 0)
184)         );
185)     END COMPONENT e_mips_div;
186) 
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

187) BEGIN
188) 
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

189)     s_stall <= i_stall OR r_stall_reset OR s_stall_data_rd OR s_mul_busy OR s_div_busy;
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

190) 
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

191)     decoder: e_mips_decoder
192)         PORT MAP (
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

193)             i_instr  => s_instr,
194)             o_reg_s  => n_reg_s,
195)             o_reg_t  => n_reg_t,
196)             o_reg_d  => n_reg_d,
197)             o_imm_a  => n_imm_a,
198)             o_imm_16 => n_imm_16,
199)             o_imm_26 => n_imm_26,
200)             o_op     => n_op,
201)             o_link   => n_link,
202)             o_cmp    => n_cmp,
203)             o_alu    => n_alu,
Stefan Schuermans added decoding of simple lo...

Stefan Schuermans authored 12 years ago

204)             o_imm    => n_imm,
205)             o_ldst   => n_ldst
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

206)         );
207) 
Stefan Schuermans added register file

Stefan Schuermans authored 12 years ago

208)     regs: e_mips_regs
209)         PORT MAP (
210)             clk         => clk,
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

211)             i_rd_a_no   => r_reg_s,
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

212)             o_rd_a_data => s_val_s,
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

213)             i_rd_b_no   => r_reg_t,
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

214)             o_rd_b_data => s_val_t,
215)             i_wr_no     => s_reg_wr_no,
216)             i_wr_data   => s_reg_wr_data,
217)             i_wr_en     => s_reg_wr_en
Stefan Schuermans added register file

Stefan Schuermans authored 12 years ago

218)         );
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

219) 
220)     alu: e_mips_alu
221)         PORT MAP (
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

222)             i_alu => r_alu,
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

223)             i_op1 => s_alu_op1,
224)             i_op2 => s_alu_op2,
225)             o_res => s_alu_res
226)         );
227) 
228)     cmp: e_mips_cmp
229)         PORT MAP (
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

230)             i_cmp => r_cmp,
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

231)             i_op1 => s_cmp_op1,
232)             i_op2 => s_cmp_op2,
233)             o_res => s_cmp_res
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

234)         );
235) 
Stefan Schuermans moved multiplier to own module

Stefan Schuermans authored 12 years ago

236)     mul: e_mips_mul
237)         PORT MAP (
238)             rst      => rst,
239)             clk      => clk,
240)             i_a      => s_val_s,
241)             i_b      => s_val_t,
242)             i_signed => s_mul_signed,
243)             i_start  => s_mul_start,
244)             o_busy   => s_mul_busy,
245)             o_res    => s_mul_res
246)         );
247) 
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

248)     div: e_mips_div
249)         PORT MAP (
250)             rst      => rst,
251)             clk      => clk,
252)             i_num    => s_val_s,
253)             i_denom  => s_val_t,
254)             i_signed => s_div_signed,
255)             i_start  => s_div_start,
256)             o_busy   => s_div_busy,
257)             o_res    => s_div_res,
258)             o_rem    => s_div_rem
259)         );
260) 
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

261)     p_sync_pc: PROCESS(rst, clk)
262)     BEGIN
263)         IF rst = '1' THEN
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

264)             r_stall_reset <= '1';
265)             r_pc          <= X"FFFFFFFC";
266)             r_instr_data  <= X"00000000";
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

267)         ELSIF rising_edge(clk) THEN
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

268)             r_stall_reset <= '0';
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

269)             IF s_stall = '0' THEN
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

270)                 r_pc         <= n_pc;
271)                 r_instr_data <= i_instr_data;
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

272)             END IF;
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

273)         END IF;
274)     END PROCESS p_sync_pc;
275) 
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

276)     p_fetch: PROCESS(s_stall, r_pc, n_pc, r_instr_data, i_instr_data)
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

277)     BEGIN
Stefan Schuermans fixed instruction fetch dur...

Stefan Schuermans authored 12 years ago

278)         IF s_stall = '1' THEN
279)             o_instr_addr <= r_pc;
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

280)             s_instr      <= r_instr_data;
Stefan Schuermans fixed instruction fetch dur...

Stefan Schuermans authored 12 years ago

281)         ELSE
282)             o_instr_addr <= n_pc;
Stefan Schuermans fixed instruction word inpu...

Stefan Schuermans authored 12 years ago

283)             s_instr      <= i_instr_data;
Stefan Schuermans fixed instruction fetch dur...

Stefan Schuermans authored 12 years ago

284)         END IF;
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

285)     END PROCESS p_fetch;
286) 
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

287)     p_sync_dec2ex: PROCESS(rst, clk)
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

288)     BEGIN
289)         IF rst = '1' THEN
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

290)             r_reg_s  <= (OTHERS => '0');
291)             r_reg_t  <= (OTHERS => '0');
292)             r_reg_d  <= (OTHERS => '0');
293)             r_imm_a  <= (OTHERS => '0');
294)             r_imm_16 <= (OTHERS => '0');
295)             r_imm_26 <= (OTHERS => '0');
296)             r_op     <= op_none;
297)             r_link   <= link_none;
298)             r_cmp    <= cmp_none;
299)             r_alu    <= alu_none;
300)             r_imm    <= imm_none;
Stefan Schuermans added decoding of simple lo...

Stefan Schuermans authored 12 years ago

301)             r_ldst   <= ldst_none;
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

302)         ELSIF rising_edge(clk) THEN
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

303)             IF s_stall = '0' THEN
304)                 r_reg_s  <= n_reg_s;
305)                 r_reg_t  <= n_reg_t;
306)                 r_reg_d  <= n_reg_d;
307)                 r_imm_a  <= n_imm_a;
308)                 r_imm_16 <= n_imm_16;
309)                 r_imm_26 <= n_imm_26;
310)                 r_op     <= n_op;
311)                 r_link   <= n_link;
312)                 r_cmp    <= n_cmp;
313)                 r_alu    <= n_alu;
314)                 r_imm    <= n_imm;
315)                 r_ldst   <= n_ldst;
316)             END IF;
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

317)         END IF;
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

318)     END PROCESS p_sync_dec2ex;
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

319) 
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

320)     p_alu_in: PROCESS(r_op, r_imm, s_val_s, s_val_t, r_imm_a, r_imm_16)
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

321)     BEGIN
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

322)         s_alu_op1 <= (OTHERS => '0');
323)         s_alu_op2 <= (OTHERS => '0');
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

324)         IF r_op = op_alu THEN
325)             CASE r_imm IS
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

326)                 WHEN imm_none =>
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

327)                     s_alu_op1 <= s_val_s;
328)                     s_alu_op2 <= s_val_t;
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

329)                 WHEN imm_a =>
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

330)                     s_alu_op1(4 DOWNTO 0) <= r_imm_a;
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

331)                     s_alu_op2 <= s_val_t;
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

332)                 WHEN imm_16se =>
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

333)                     s_alu_op1 <= s_val_s;
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

334)                     s_alu_op2(15 DOWNTO 0) <= r_imm_16;
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

335)                     s_alu_op2(31 DOWNTO 16) <= (OTHERS => r_imm_16(15));
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

336)                 WHEN imm_16ze =>
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

337)                     s_alu_op1 <= s_val_s;
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

338)                     s_alu_op2(15 DOWNTO 0) <= r_imm_16;
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

339)                 WHEN OTHERS => NULL;
340)             END CASE;
341)         END IF;
342)     END PROCESS p_alu_in;
343) 
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

344)     p_alu_out: PROCESS(r_op, r_imm, r_reg_t, r_reg_d, s_alu_res)
345)     BEGIN
346)         s_reg_wr_alu_no   <= (OTHERS => '0');
347)         s_reg_wr_alu_data <= (OTHERS => '0');
348)         s_reg_wr_alu_en   <= '0';
349)         IF r_op = op_alu THEN
350)             CASE r_imm IS
351)                 WHEN imm_none | imm_a =>
352)                     s_reg_wr_alu_no   <= r_reg_d;
353)                     s_reg_wr_alu_data <= s_alu_res;
354)                     s_reg_wr_alu_en   <= '1';
355)                 WHEN imm_16se | imm_16ze =>
356)                     s_reg_wr_alu_no   <= r_reg_t;
357)                     s_reg_wr_alu_data <= s_alu_res;
358)                     s_reg_wr_alu_en   <= '1';
359)                 WHEN OTHERS => NULL;
360)             END CASE;
361)         END IF;
362)     END PROCESS p_alu_out;
363) 
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

364)     p_cmp_in: PROCESS(r_op, s_val_s, s_val_t)
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

365)     BEGIN
366)         s_cmp_op1 <= (OTHERS => '0');
367)         s_cmp_op2 <= (OTHERS => '0');
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

368)         IF r_op = op_j THEN
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

369)             s_cmp_op1 <= s_val_s;
370)             s_cmp_op2 <= s_val_t;
371)         END IF;
372)     END PROCESS p_cmp_in;
373) 
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

374)     p_reg_wr: PROCESS(s_stall,
375)                       s_reg_wr_alu_no, s_reg_wr_alu_data, s_reg_wr_alu_en,
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

376)                       s_reg_wr_data_no, s_reg_wr_data_data, s_reg_wr_data_en,
Stefan Schuermans implemented ... and link ->...

Stefan Schuermans authored 12 years ago

377)                       s_reg_wr_hi_lo_no, s_reg_wr_hi_lo_data, s_reg_wr_hi_lo_en,
378)                       s_reg_wr_link_no, s_reg_wr_link_data, s_reg_wr_link_en)
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

379)     BEGIN
380)         s_reg_wr_no   <= (OTHERS => '0');
381)         s_reg_wr_data <= (OTHERS => '0');
382)         s_reg_wr_en   <= '0';
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

383)         IF s_stall = '0' THEN
384)             IF s_reg_wr_alu_en = '1' THEN
385)                 s_reg_wr_no   <= s_reg_wr_alu_no;
386)                 s_reg_wr_data <= s_reg_wr_alu_data;
387)                 s_reg_wr_en   <= '1';
388)             ELSIF s_reg_wr_data_en = '1' THEN
389)                 s_reg_wr_no   <= s_reg_wr_data_no;
390)                 s_reg_wr_data <= s_reg_wr_data_data;
391)                 s_reg_wr_en   <= '1';
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

392)             ELSIF s_reg_wr_hi_lo_en = '1' THEN
393)                 s_reg_wr_no   <= s_reg_wr_hi_lo_no;
394)                 s_reg_wr_data <= s_reg_wr_hi_lo_data;
395)                 s_reg_wr_en   <= '1';
Stefan Schuermans implemented ... and link ->...

Stefan Schuermans authored 12 years ago

396)             ELSIF s_reg_wr_link_en = '1' THEN
397)                 s_reg_wr_no   <= s_reg_wr_link_no;
398)                 s_reg_wr_data <= s_reg_wr_link_data;
399)                 s_reg_wr_en   <= '1';
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

400)             END IF;
Stefan Schuermans implement correctly writing...

Stefan Schuermans authored 12 years ago

401)         END IF;
402)     END PROCESS p_reg_wr;
403) 
Stefan Schuermans implemented jump register i...

Stefan Schuermans authored 12 years ago

404)     p_next_pc: PROCESS(r_pc, r_op, r_imm, s_cmp_res, r_imm_16, r_imm_26, s_val_s)
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

405)         VARIABLE v_pc:  signed(31 DOWNTO 0);
406)         VARIABLE v_rel: signed(17 DOWNTO 0);
407)     BEGIN
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

408)         IF r_op = op_j AND s_cmp_res = '1' THEN
409)             IF r_imm = imm_26 THEN
410)                 n_pc <= r_pc(31 DOWNTO 28) & r_imm_26 & "00";
Stefan Schuermans implemented jump register i...

Stefan Schuermans authored 12 years ago

411)             ELSIF r_imm = imm_16se THEN
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

412)                 n_pc <= std_logic_vector(signed(r_pc) +
413)                                          signed(r_imm_16 & "00"));
Stefan Schuermans implemented jump register i...

Stefan Schuermans authored 12 years ago

414)             ELSE
415)                 n_pc <= s_val_s;
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

416)             END IF;
Stefan Schuermans implement jump logic, imple...

Stefan Schuermans authored 12 years ago

417)         ELSE
418)             n_pc <= std_logic_vector(signed(r_pc) + to_signed(4, 32));
Stefan Schuermans compare unit, initial PC ideas

Stefan Schuermans authored 12 years ago

419)         END IF;
420)     END PROCESS p_next_pc;
421) 
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

422)     p_data_addr: PROCESS(r_op, s_val_s, r_imm_16)
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

423)         VARIABLE v_ofs: unsigned(31 DOWNTO 0);
424)         VARIABLE v_addr: unsigned(31 DOWNTO 0);
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

425)     BEGIN
426)         s_data_addr <= (OTHERS => '0');
427)         IF r_op = op_l OR r_op = op_s THEN
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

428)             v_ofs(15 DOWNTO 0)  := unsigned(r_imm_16);
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

429)             v_ofs(31 DOWNTO 16) := (OTHERS => r_imm_16(15));
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

430)             v_addr              := unsigned(s_val_s) + v_ofs;
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

431)             s_data_addr         <= std_logic_vector(v_addr);
432)         END IF;
433)     END PROCESS p_data_addr;
434) 
435)     o_data_addr <= s_data_addr(31 DOWNTO 2) & "00";
436) 
Stefan Schuermans add read_enable signal to d...

Stefan Schuermans authored 12 years ago

437)     p_data_rd_en: PROCESS(r_data_rd, r_op, r_ldst, s_data_addr)
438)     BEGIN
439)         o_data_rd_en <= "0000";
440)         IF r_data_rd = data_rd_idle AND r_op = op_l THEN
441)             CASE r_ldst IS
442)                 WHEN ldst_b | ldst_bu =>
443)                     CASE s_data_addr(1 DOWNTO 0) IS
444)                         WHEN "00" => o_data_rd_en <= "0001";
445)                         WHEN "01" => o_data_rd_en <= "0010";
446)                         WHEN "10" => o_data_rd_en <= "0100";
447)                         WHEN "11" => o_data_rd_en <= "1000";
448)                         WHEN OTHERS => NULL;
449)                     END CASE;
450)                 WHEN ldst_h | ldst_hu =>
451)                     CASE s_data_addr(1 DOWNTO 1) IS
452)                         WHEN "0" => o_data_rd_en <= "0011";
453)                         WHEN "1" => o_data_rd_en <= "1100";
454)                         WHEN OTHERS => NULL;
455)                     END CASE;
456)                 WHEN ldst_w =>
457)                     o_data_rd_en <= "1111";
458)                 WHEN ldst_wl =>
459)                     CASE s_data_addr(1 DOWNTO 0) IS
460)                         WHEN "00" => o_data_rd_en <= "0001";
461)                         WHEN "01" => o_data_rd_en <= "0011";
462)                         WHEN "10" => o_data_rd_en <= "0111";
463)                         WHEN "11" => o_data_rd_en <= "1111";
464)                         WHEN OTHERS => NULL;
465)                     END CASE;
466)                 WHEN ldst_wr =>
467)                     CASE s_data_addr(1 DOWNTO 0) IS
468)                         WHEN "00" => o_data_rd_en <= "1111";
469)                         WHEN "01" => o_data_rd_en <= "1110";
470)                         WHEN "10" => o_data_rd_en <= "1100";
471)                         WHEN "11" => o_data_rd_en <= "1000";
472)                         WHEN OTHERS => NULL;
473)                     END CASE;
474)                 WHEN OTHERS => NULL;
475)             END CASE;
476)         END IF;
477)     END PROCESS p_data_rd_en;
478) 
Stefan Schuermans implementation of LWL, LWR

Stefan Schuermans authored 12 years ago

479)     p_data_rd: PROCESS(r_data_rd, r_op, r_ldst, s_data_addr, r_reg_t, i_data_rd_data, s_val_t)
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

480)         VARIABLE v_b: std_logic_vector( 7 DOWNTO 0);
481)         VARIABLE v_h: std_logic_vector(15 DOWNTO 0);
Stefan Schuermans implementation of LWL, LWR

Stefan Schuermans authored 12 years ago

482)         VARIABLE v_w: std_logic_vector(31 DOWNTO 0);
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

483)     BEGIN
484)         s_stall_data_rd    <= '0';
485)         n_data_rd          <= data_rd_idle;
486)         s_reg_wr_data_no   <= (OTHERS => '0');
487)         s_reg_wr_data_data <= (OTHERS => '0');
488)         s_reg_wr_data_en   <= '0';
489)         CASE r_data_rd IS
490)             WHEN data_rd_idle =>
491)                 IF r_op = op_l THEN
492)                     s_stall_data_rd <= '1';
493)                     n_data_rd <= data_rd_read;
494)                 END IF;
495)             WHEN data_rd_read =>
496)                 CASE r_ldst IS
497)                     WHEN ldst_b | ldst_bu =>
498)                         CASE s_data_addr(1 DOWNTO 0) IS
499)                             WHEN "00" => v_b := i_data_rd_data( 7 DOWNTO  0);
500)                             WHEN "01" => v_b := i_data_rd_data(15 DOWNTO  8);
501)                             WHEN "10" => v_b := i_data_rd_data(23 DOWNTO 16);
502)                             WHEN "11" => v_b := i_data_rd_data(31 DOWNTO 24);
503)                             WHEN OTHERS => NULL;
504)                         END CASE;
505)                         s_reg_wr_data_data(7 DOWNTO 0) <= v_b;
506)                         IF r_ldst = ldst_b THEN
507)                             s_reg_wr_data_data(31 DOWNTO 8) <= (OTHERS => v_b(7));
508)                         END IF;
509)                     WHEN ldst_h | ldst_hu =>
510)                         CASE s_data_addr(1 DOWNTO 1) IS
511)                             WHEN "0" => v_h := i_data_rd_data(15 DOWNTO  0);
512)                             WHEN "1" => v_h := i_data_rd_data(31 DOWNTO 16);
513)                             WHEN OTHERS => NULL;
514)                         END CASE;
515)                         s_reg_wr_data_data(15 DOWNTO 0) <= v_h;
516)                         IF r_ldst = ldst_h THEN
517)                             s_reg_wr_data_data(31 DOWNTO 16) <= (OTHERS => v_h(15));
518)                         END IF;
519)                     WHEN ldst_w =>
520)                         s_reg_wr_data_data <= i_data_rd_data;
Stefan Schuermans implementation of LWL, LWR

Stefan Schuermans authored 12 years ago

521)                     WHEN ldst_wl =>
522)                         v_w := s_val_t;
523)                         CASE s_data_addr(1 DOWNTO 0) IS
524)                             WHEN "00" => v_w(31 DOWNTO 24) := i_data_rd_data( 7 DOWNTO 0);
525)                             WHEN "01" => v_w(31 DOWNTO 16) := i_data_rd_data(15 DOWNTO 0);
526)                             WHEN "10" => v_w(31 DOWNTO  8) := i_data_rd_data(23 DOWNTO 0);
527)                             WHEN "11" => v_w(31 DOWNTO  0) := i_data_rd_data(31 DOWNTO 0);
528)                             WHEN OTHERS => NULL;
529)                         END CASE;
530)                         s_reg_wr_data_data <= v_w;
531)                     WHEN ldst_wr =>
532)                         v_w := s_val_t;
533)                         CASE s_data_addr(1 DOWNTO 0) IS
534)                             WHEN "00" => v_w(31 DOWNTO  0) := i_data_rd_data(31 DOWNTO  0);
535)                             WHEN "01" => v_w(23 DOWNTO  0) := i_data_rd_data(31 DOWNTO  8);
536)                             WHEN "10" => v_w(15 DOWNTO  0) := i_data_rd_data(31 DOWNTO 16);
537)                             WHEN "11" => v_w( 7 DOWNTO  0) := i_data_rd_data(31 DOWNTO 24);
538)                             WHEN OTHERS => NULL;
539)                         END CASE;
540)                         s_reg_wr_data_data <= v_w;
Stefan Schuermans implemented simple load ins...

Stefan Schuermans authored 12 years ago

541)                     WHEN OTHERS => NULL;
542)                 END CASE;
543)                 s_reg_wr_data_no <= r_reg_t;
544)                 s_reg_wr_data_en <= '1';
545)             WHEN OTHERS => NULL;
546)         END CASE;
547)     END PROCESS p_data_rd;
548) 
549)     p_sync_data_rd: PROCESS(rst, clk)
550)     BEGIN
551)         IF rst = '1' THEN
552)             r_data_rd <= data_rd_idle;
553)         ELSIF rising_edge(clk) THEN
554)             IF i_stall = '0' THEN
555)                 r_data_rd <= n_data_rd;
556)             END IF;
557)         END IF;
558)     END PROCESS p_sync_data_rd;
559) 
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

560)     p_data_wr: PROCESS(r_op, r_ldst, s_data_addr, s_val_t)
561)     BEGIN
562)         o_data_wr_data <= (OTHERS => '0');
563)         o_data_wr_en   <= "0000";
564)         IF r_op = op_s THEN
565)             CASE r_ldst IS
566)                 WHEN ldst_b =>
567)                     CASE s_data_addr(1 DOWNTO 0) IS
568)                         WHEN "00" =>
569)                             o_data_wr_data( 7 DOWNTO  0) <= s_val_t(7 DOWNTO 0);
570)                             o_data_wr_en                 <= "0001";
571)                         WHEN "01" =>
572)                             o_data_wr_data(15 DOWNTO  8) <= s_val_t(7 DOWNTO 0);
573)                             o_data_wr_en                 <= "0010";
574)                         WHEN "10" =>
575)                             o_data_wr_data(23 DOWNTO 16) <= s_val_t(7 DOWNTO 0);
576)                             o_data_wr_en                 <= "0100";
577)                         WHEN "11" =>
578)                             o_data_wr_data(31 DOWNTO 24) <= s_val_t(7 DOWNTO 0);
579)                             o_data_wr_en                 <= "1000";
580)                         WHEN OTHERS => NULL;
581)                     END CASE;
582)                 WHEN ldst_h =>
583)                     CASE s_data_addr(1 DOWNTO 1) IS
584)                         WHEN "0" =>
585)                             o_data_wr_data(15 DOWNTO  0) <= s_val_t(15 DOWNTO 0);
586)                             o_data_wr_en                 <= "0011";
587)                         WHEN "1" =>
588)                             o_data_wr_data(31 DOWNTO 16) <= s_val_t(15 DOWNTO 0);
589)                             o_data_wr_en                 <= "1100";
590)                         WHEN OTHERS => NULL;
591)                     END CASE;
592)                 WHEN ldst_w =>
593)                     o_data_wr_data <= s_val_t;
594)                     o_data_wr_en   <= "1111";
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

595)                 WHEN ldst_wl =>
596)                     CASE s_data_addr(1 DOWNTO 0) IS
597)                         WHEN "00" =>
598)                             o_data_wr_data( 7 DOWNTO 0) <= s_val_t(31 DOWNTO 24);
599)                             o_data_wr_en                <= "0001";
600)                         WHEN "01" =>
601)                             o_data_wr_data(15 DOWNTO 0) <= s_val_t(31 DOWNTO 16);
602)                             o_data_wr_en                <= "0011";
603)                         WHEN "10" =>
604)                             o_data_wr_data(23 DOWNTO 0) <= s_val_t(31 DOWNTO  8);
605)                             o_data_wr_en                <= "0111";
606)                         WHEN "11" =>
607)                             o_data_wr_data(31 DOWNTO 0) <= s_val_t(31 DOWNTO  0);
608)                             o_data_wr_en                <= "1111";
609)                         WHEN OTHERS => NULL;
610)                     END CASE;
611)                 WHEN ldst_wr =>
612)                     CASE s_data_addr(1 DOWNTO 0) IS
613)                         WHEN "00" =>
614)                             o_data_wr_data(31 DOWNTO  0) <= s_val_t(31 DOWNTO 0);
615)                             o_data_wr_en                 <= "1111";
616)                         WHEN "01" =>
617)                             o_data_wr_data(31 DOWNTO  8) <= s_val_t(23 DOWNTO 0);
618)                             o_data_wr_en                 <= "1110";
619)                         WHEN "10" =>
620)                             o_data_wr_data(31 DOWNTO 16) <= s_val_t(15 DOWNTO 0);
621)                             o_data_wr_en                 <= "1100";
622)                         WHEN "11" =>
623)                             o_data_wr_data(31 DOWNTO 24) <= s_val_t( 7 DOWNTO 0);
624)                             o_data_wr_en                 <= "1000";
625)                         WHEN OTHERS => NULL;
626)                     END CASE;
Stefan Schuermans implemented simple store in...

Stefan Schuermans authored 12 years ago

627)                 WHEN OTHERS => NULL;
628)             END CASE;
629)         END IF;
630)     END PROCESS p_data_wr;
Stefan Schuermans start of MIPS core: begin o...

Stefan Schuermans authored 12 years ago

631) 
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

632)     p_reg_hi_lo: PROCESS(r_reg_lo, r_reg_hi, r_op, r_reg_d, s_val_s,
633)                          s_mul_res, s_div_res, s_div_rem)
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

634)     BEGIN
635)         n_reg_lo            <= r_reg_lo;
636)         n_reg_hi            <= r_reg_hi;
637)         s_reg_wr_hi_lo_no   <= (OTHERS => '0');
638)         s_reg_wr_hi_lo_data <= (OTHERS => '0');
639)         s_reg_wr_hi_lo_en   <= '0';
640)         CASE r_op IS
641)             WHEN op_mfhi =>
642)                 s_reg_wr_hi_lo_no   <= r_reg_d;
643)                 s_reg_wr_hi_lo_data <= r_reg_hi;
644)                 s_reg_wr_hi_lo_en   <= '1';            
645)             WHEN op_mflo =>
646)                 s_reg_wr_hi_lo_no   <= r_reg_d;
647)                 s_reg_wr_hi_lo_data <= r_reg_lo;
648)                 s_reg_wr_hi_lo_en   <= '1';            
649)             WHEN op_mthi =>
650)                 n_reg_hi <= s_val_s;
651)             WHEN op_mtlo =>
652)                 n_reg_lo <= s_val_s;
Stefan Schuermans implemented multiplier

Stefan Schuermans authored 12 years ago

653)             WHEN op_mult | op_multu =>
Stefan Schuermans moved multiplier to own module

Stefan Schuermans authored 12 years ago

654)                 n_reg_lo <= std_logic_vector(s_mul_res(31 DOWNTO  0));
655)                 n_reg_hi <= std_logic_vector(s_mul_res(63 DOWNTO 32));
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

656)             WHEN op_div | op_divu =>
657)                 n_reg_lo <= s_div_res;
658)                 n_reg_hi <= s_div_rem;
Stefan Schuermans implemented M T/F HI/LO

Stefan Schuermans authored 12 years ago

659)             WHEN OTHERS => NULL;
660)         END CASE;
661)     END PROCESS p_reg_hi_lo;
662) 
663)     p_sync_reg_hi_lo: PROCESS(clk, rst)
664)     BEGIN
665)         IF rst = '1' THEN
666)             r_reg_lo <= (OTHERS => '0');
667)             r_reg_hi <= (OTHERS => '0');
668)         ELSIF rising_edge(clk) THEN
669)             IF s_stall = '0' THEN
670)                 r_reg_lo <= n_reg_lo;
671)                 r_reg_hi <= n_reg_hi;
672)             END IF;
673)         END IF;
674)     END PROCESS p_sync_reg_hi_lo;
675) 
Stefan Schuermans moved multiplier to own module

Stefan Schuermans authored 12 years ago

676)     s_mul_signed <= '1' WHEN r_op = op_mult ELSE '0';
677)     s_mul_start  <= '1' WHEN i_stall = '0' AND (r_op = op_mult OR r_op = op_multu) ELSE '0';
Stefan Schuermans implemented multiplier

Stefan Schuermans authored 12 years ago

678) 
Stefan Schuermans implemented divider

Stefan Schuermans authored 12 years ago

679)     s_div_signed <= '1' WHEN r_op = op_div ELSE '0';
680)     s_div_start  <= '1' WHEN i_stall = '0' AND (r_op = op_div OR r_op = op_divu) ELSE '0';
681) 
Stefan Schuermans implemented ... and link ->...

Stefan Schuermans authored 12 years ago

682)     p_link: PROCESS(r_pc, r_link)
683)     BEGIN
684)         s_reg_wr_link_no   <= std_logic_vector(to_unsigned(31, 5));
685)         s_reg_wr_link_data <= std_logic_vector(signed(r_pc) + to_signed(4, 32));
686)         IF r_link = link_link THEN
687)             s_reg_wr_link_en <= '1';
688)         ELSE
689)             s_reg_wr_link_en <= '0';
690)         END IF;
691)     END PROCESS p_link;
692)