OpenCores
URL https://opencores.org/ocsvn/plasma_fpu/plasma_fpu/trunk

Subversion Repositories plasma_fpu

[/] [plasma_fpu/] [trunk/] [src/] [datapaths/] [plasma_datapath_MIPSI.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 __alexs__
-- --------------------------------------------------------------------------
2
-- >>>>>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<
3
-- --------------------------------------------------------------------------
4
-- TITLE:       Plasma DATAPATH
5
-- AUTHOR:      Alex Schoenberger (Alex.Schoenberger@ies.tu-darmstadt.de)
6
-- COMMENT:     This project is based on Plasma CPU core by Steve Rhoads
7
--
8
-- www.ies.tu-darmstadt.de
9
-- TU Darmstadt
10
-- Institute for Integrated Systems
11
-- Merckstr. 25
12
-- 
13
-- 64283 Darmstadt - GERMANY
14
-- --------------------------------------------------------------------------
15
-- PROJECT:       Plasma CPU core with FPU
16
-- FILENAME:      plasma_datapath.vhd
17
-- --------------------------------------------------------------------------
18
-- COPYRIGHT: 
19
--  This project is distributed by GPLv2.0
20
--  Software placed into the public domain by the author.
21
--  Software 'as is' without warranty.  Author liable for nothing.
22
-- --------------------------------------------------------------------------
23
-- DESCRIPTION:
24
--    datapath of plasma core
25
--
26
--    SYNTHESIZABLE
27
--
28
----------------------------------------------------------------------------
29
-- Revision History
30
-- --------------------------------------------------------------------------
31
-- Revision   Date    Author     CHANGES
32
-- 1.0      4/2014    AS         initial
33
-- 2.0     12/2014    AS         separated into MIPS1 simple architecture
34
--                               and with FPU included
35
-- 3.0     05/2015    AS         made generic port, included immediate mux
36
-- --------------------------------------------------------------------------
37
library IEEE;
38
  use IEEE.std_logic_1164.ALL;
39
 
40
library PLASMA;
41
  use PLASMA.mips_instruction_set.ALL;
42
  use PLASMA.plasma_pack.ALL;
43
 
44
 
45
entity plasma_datapath_MIPSI is
46
    generic(
47
      core_idx                : natural := 0;
48
      SIM_FLAG                : string  := "ON";
49
      DEBUG_FLAG              : string  := "OF"
50
      );
51
    port(
52
      control                 : in  t_main_control;
53
      -- input control mux and registers
54
      reg_addr                : in  t_reg_addr;
55
      mux_ctrl                : in  t_plasma_mux_ctrl;
56
      stall_src               : in  t_stall_source;
57
      -- output feedback signals
58
      comp_out                : out std_logic;
59
      unit_busy               : out t_unit_busy;
60
      -- operation units control
61
      unit_ctrl               : in  t_plasma_subunits_ctrl;
62
      -- data
63
      instr_addr              : out t_plasma_word;
64
      data_addr               : out t_plasma_word;
65
 
66
      instr_in                : in  t_plasma_word;
67
      data_from_mem           : in  t_plasma_word;
68
      data_to_mem             : out t_plasma_word
69
    );
70
end entity plasma_datapath_MIPSI;
71
 
72
 
73
architecture structure_plasma_datapath_MIPSI of plasma_datapath_MIPSI is
74
 
75
  -- ___  ____ ____ ____ ____ ____ _  _    ____ ____ _  _ _  _ ___ ____ ____ 
76
  -- |__] |__/ |  | | __ |__/ |__| |\/|    |    |  | |  | |\ |  |  |___ |__/ 
77
  -- |    |  \ |__| |__] |  \ |  | |  |    |___ |__| |__| | \|  |  |___ |  \ 
78
  signal pc_new_value         : t_plasma_word;                            -- next pc value
79
  signal pc_out_inc           : t_plasma_word;                            -- pc + 4
80
  signal pc_out_branch        : t_plasma_word;                            -- pc + 4 + (imm16 << 2)
81
 
82
  -- ____ ____ ____ _ ____ ___ ____ ____          ___  ____ _  _ _  _ 
83
  -- |__/ |___ | __ | [__   |  |___ |__/          |__] |__| |\ | |_/  
84
  -- |  \ |___ |__] | ___]  |  |___ |  \          |__] |  | | \| | \_ 
85
  signal regular_rd           : t_mips_reg_addr;
86
  signal reg_bank_a           : t_plasma_word;                            -- rs
87
  signal reg_bank_b           : t_plasma_word;                            -- rt
88
 
89
  -- _ _  _ _  _    _  _ _  _ _  _ 
90
  -- | |\/| |\/|    |\/| |  |  \/  
91
  -- | |  | |  |    |  | |__| _/\_ 
92
  alias i_shamt               : t_mips_shamt    is instr_in(10 downto  6);
93
  alias i_imm                 : t_mips_imm16    is instr_in(15 downto  0);
94
  alias i_imm_long            : t_mips_imm26    is instr_in(25 downto  0);
95
 
96
  signal i_imm_sign           : t_mips_imm16;
97
  signal i_imm_branch         : std_logic_vector(31 downto 18);
98
 
99
  constant ZERO_SHAMT         : std_logic_vector(31 downto  5) := (others => '0');
100
  constant ZERO_IMM16         : std_logic_vector(15 downto  0) := (others => '0');
101
  constant ZERO_IMM26         : std_logic_vector(31 downto 28) := (others => '0');
102
 
103
  -- _ _  _ ___  _  _ ___    _  _ _  _ _  _ ____ ____ 
104
  -- | |\ | |__] |  |  |     |\/| |  |  \/  |___ [__  
105
  -- | | \| |    |__|  |     |  | |__| _/\_ |___ ___] 
106
  signal src_a_in             : t_plasma_word;
107
  signal i_src_b_in           : t_plasma_word;
108
  signal src_b_in             : t_plasma_word;
109
  signal imm_in               : t_plasma_word;
110
  signal mem_data_in          : t_plasma_word;
111
 
112
  -- ____ _  _    ____ ___ ____ ____ ____    ____ ____ ____ ____ 
113
  -- |___  \/     [__   |  |__| | __ |___    |__/ |___ | __ [__  
114
  -- |___ _/\_    ___]  |  |  | |__] |___    |  \ |___ |__] ___] 
115
  signal reg_src_a_in         : t_plasma_word;
116
  signal reg_src_b_in         : t_plasma_word;
117
  signal reg_imm_in           : t_plasma_word;
118
  signal reg_mem_data_in      : t_plasma_word;
119
 
120
  -- ____ _  _ ___ ___  _  _ ___    _  _ _  _ _  _ 
121
  -- |  | |  |  |  |__] |  |  |     |\/| |  |  \/  
122
  -- |__| |__|  |  |    |__|  |     |  | |__| _/\_ 
123
  signal alu_out              : t_plasma_word;
124
  signal shift_out            : t_plasma_word;
125
  signal mult_out             : t_plasma_word;
126
 
127
  signal op_data_out          : t_plasma_word;
128
 
129
  -- _  _ ____ _  _    ____ ___ ____ ____ ____    ____ ____ ____ 
130
  -- |\/| |___ |\/|    [__   |  |__| | __ |___    |__/ |___ | __ 
131
  -- |  | |___ |  |    ___]  |  |  | |__] |___    |  \ |___ |__] 
132
  signal reg_mem_result       : t_plasma_word;
133
  signal reg_mem_to_memory    : t_plasma_word;
134
 
135
  signal mem_data_out         : t_plasma_word;
136
 
137
  -- _ _ _ ___     ____ ___ ____ ____ ____    ____ ____ ____ 
138
  -- | | | |__]    [__   |  |__| | __ |___    |__/ |___ | __ 
139
  -- |_|_| |__]    ___]  |  |  | |__] |___    |  \ |___ |__] 
140
  signal reg_bank_in          : t_plasma_word;
141
 
142
begin   ---------- BEGIN -------------------- BEGIN --------------------- BEGIN -------------------
143
  -- ----------------------------------------------------------------------------------------------
144
  --  _____  _____   ____   _____ _____            __  __      _____ ____  _    _ _   _ _______ ______ _____  
145
  -- |  __ \|  __ \ / __ \ / ____|  __ \     /\   |  \/  |    / ____/ __ \| |  | | \ | |__   __|  ____|  __ \ 
146
  -- | |__) | |__) | |  | | |  __| |__) |   /  \  | \  / |   | |   | |  | | |  | |  \| |  | |  | |__  | |__) |
147
  -- |  ___/|  _  /| |  | | | |_ |  _  /   / /\ \ | |\/| |   | |   | |  | | |  | | . ` |  | |  |  __| |  _  / 
148
  -- | |    | | \ \| |__| | |__| | | \ \  / ____ \| |  | |   | |___| |__| | |__| | |\  |  | |  | |____| | \ \ 
149
  -- |_|    |_|  \_\\____/ \_____|_|  \_\/_/    \_\_|  |_|    \_____\____/ \____/|_| \_|  |_|  |______|_|  \_\
150
  -- ----------------------------------------------------------------------------------------------                                                                                                         
151
  --
152
  -- PC UNIT
153
  --
154
  u1_pc: plasma_pc
155
    PORT MAP(
156
      control       => control,
157
      stall         => stall_src.pc,
158
      pc_imm_in     => reg_imm_in,
159
      pc_new_value  => pc_new_value,
160
      pc_out.pc_out_inc     => pc_out_inc,
161
      pc_out.pc_out_branch  => pc_out_branch,
162
      pc_out.pc_out         => instr_addr
163
    );
164
 
165
  -- ----------------------------------------------------------------------------------------------
166
  --  _____  ______ _____ _____  _____ _______ ______ _____      ____          _   _ _  __
167
  -- |  __ \|  ____/ ____|_   _|/ ____|__   __|  ____|  __ \    |  _ \   /\   | \ | | |/ /
168
  -- | |__) | |__ | |  __  | | | (___    | |  | |__  | |__) |   | |_) | /  \  |  \| | ' / 
169
  -- |  _  /|  __|| | |_ | | |  \___ \   | |  |  __| |  _  /    |  _ < / /\ \ | . ` |  <  
170
  -- | | \ \| |___| |__| |_| |_ ____) |  | |  | |____| | \ \    | |_) / ____ \| |\  | . \ 
171
  -- |_|  \_\______\_____|_____|_____/   |_|  |______|_|  \_\   |____/_/    \_\_| \_|_|\_\
172
  -- ----------------------------------------------------------------------------------------------
173
  --
174
  -- REGISTER BANK UNIT
175
  --
176
  u2_reg_bank: plasma_reg_bank
177
    GENERIC MAP(
178
      core_idx        => core_idx,
179
      DEBUG_FLAG      => DEBUG_FLAG
180
    )
181
    PORT MAP(
182
      control         => control,
183
      reg_addr        => reg_addr,
184
      reg_dest_new    => reg_bank_in,
185
      reg_source_out  => reg_bank_a,
186
      reg_target_out  => reg_bank_b
187
    );
188
 
189
  -- ----------------------------------------------------------------------------------------------
190
  -- ----------------------------------------------------------------------------------------------
191
  -- ######  #######  #####  ####### ######  #######     #####  #######    #     #####  ####### 
192
  -- #     # #       #     # #     # #     # #          #     #    #      # #   #     # #       
193
  -- #     # #       #       #     # #     # #          #          #     #   #  #       #       
194
  -- #     # #####   #       #     # #     # #####       #####     #    #     # #  #### #####   
195
  -- #     # #       #       #     # #     # #                #    #    ####### #     # #       
196
  -- #     # #       #     # #     # #     # #          #     #    #    #     # #     # #       
197
  -- ######  #######  #####  ####### ######  #######     #####     #    #     #  #####  ####### 
198
  -- ----------------------------------------------------------------------------------------------
199
 
200
  -- ----------------------------------------------------------------------------------------------
201
  --  _____ _   _ _____  _    _ _______     __  __ _    ___   ________  _____ 
202
  -- |_   _| \ | |  __ \| |  | |__   __|   |  \/  | |  | \ \ / /  ____|/ ____|
203
  --   | | |  \| | |__) | |  | |  | |      | \  / | |  | |\ V /| |__  | (___  
204
  --   | | | . ` |  ___/| |  | |  | |      | |\/| | |  | | > < |  __|  \___ \ 
205
  --  _| |_| |\  | |    | |__| |  | |      | |  | | |__| |/ . \| |____ ____) |
206
  -- |_____|_| \_|_|     \____/   |_|      |_|  |_|\____//_/ \_\______|_____/ 
207
  -- ----------------------------------------------------------------------------------------------
208
  --
209
  -- IMMEDIATE VALUE MUX
210
  --
211
  i_imm_sign        <= (others => i_imm(15));
212
  i_imm_branch      <= (others => i_imm(15));
213
 
214
 
215
  with mux_ctrl.src_imm select
216
    imm_in          <=  ZERO_IMM16   & i_imm                when IMM_UNSIGN,
217
                        i_imm & ZERO_IMM16                  when IMM_HIGH,
218
                        ZERO_SHAMT   & i_shamt              when IMM_SHAMT,
219
                        i_imm_branch & i_imm      & b"00"   when IMM_BRANCH,
220
                        ZERO_IMM26   & i_imm_long & b"00"   when IMM_JUMP,
221
                        i_imm_sign   & i_imm                when others;
222
 
223
  --
224
  -- SOURCE A MUX
225
  -- 
226
  with mux_ctrl.src_a select
227
    src_a_in        <=  op_data_out       when SRC_OP_OUT,
228
                        mem_data_out      when SRC_MEM_OUT,
229
                        reg_bank_in       when SRC_WB_OUT,
230
                        reg_bank_a        when others;
231
 
232
  --
233
  -- SOURCE B MUX
234
  --             
235
  with mux_ctrl.src_b select
236
    i_src_b_in      <=  op_data_out       when SRC_OP_OUT,
237
                        mem_data_out      when SRC_MEM_OUT,
238
                        reg_bank_in       when SRC_WB_OUT,
239
                        reg_bank_b        when others;
240
 
241
  --
242
  -- IMMEDIATE SWITCH
243
  --
244
  with mux_ctrl.src_b_imm select
245
    src_b_in        <= imm_in             when B_IMM_ON,
246
                       i_src_b_in         when others;
247
 
248
  --
249
  -- MEMORY INPUT
250
  --
251
  mem_data_in       <= i_src_b_in;
252
 
253
  -- ----------------------------------------------------------------------------------------------
254
  -- ----------------------------------------------------------------------------------------------
255
  -- ####### #     # #######  #####  #     # ####### #######     #####  #######    #     #####  ####### 
256
  -- #        #   #  #       #     # #     #    #    #          #     #    #      # #   #     # #       
257
  -- #         # #   #       #       #     #    #    #          #          #     #   #  #       #       
258
  -- #####      #    #####   #       #     #    #    #####       #####     #    #     # #  #### #####   
259
  -- #         # #   #       #       #     #    #    #                #    #    ####### #     # #       
260
  -- #        #   #  #       #     # #     #    #    #          #     #    #    #     # #     # #       
261
  -- ####### #     # #######  #####   #####     #    #######     #####     #    #     #  #####  ####### 
262
  -- ----------------------------------------------------------------------------------------------
263
 
264
  -- ----------------------------------------------------------------------------------------------
265
  --  ________   __    _____ _______       _____ ______    _____  ______ _____  _____ 
266
  -- |  ____\ \ / /   / ____|__   __|/\   / ____|  ____|  |  __ \|  ____/ ____|/ ____|
267
  -- | |__   \ V /   | (___    | |  /  \ | |  __| |__     | |__) | |__ | |  __| (___  
268
  -- |  __|   > <     \___ \   | | / /\ \| | |_ |  __|    |  _  /|  __|| | |_ |\___ \ 
269
  -- | |____ / . \    ____) |  | |/ ____ \ |__| | |____   | | \ \| |___| |__| |____) |
270
  -- |______/_/ \_\  |_____/   |_/_/    \_\_____|______|  |_|  \_\______\_____|_____/ 
271
  -- ----------------------------------------------------------------------------------------------
272
ex_stage_registers:
273
  process( control.clk )
274
  begin
275
    if rising_edge( control.clk ) then
276
      if control.rst = '1' then
277
        reg_src_a_in      <= PLASMA_ZERO_WORD;
278
        reg_src_b_in      <= PLASMA_ZERO_WORD;
279
        reg_imm_in        <= PLASMA_ZERO_WORD;
280
 
281
        reg_mem_data_in   <= PLASMA_ZERO_WORD;
282
      else
283
        if stall_src.pc = '0' then
284
          reg_src_a_in    <= src_a_in;
285
          reg_src_b_in    <= src_b_in;
286
          reg_imm_in      <= imm_in;
287
 
288
          reg_mem_data_in <= mem_data_in;
289
        end if;
290
      end if;
291
    end if;
292
  end process;
293
 
294
  -- ----------------------------------------------------------------------------------------------
295
  --   ____  _____  ______ _____         _______ _____ ____  _   _     _    _ _   _ _____ _______ _____ 
296
  --  / __ \|  __ \|  ____|  __ \     /\|__   __|_   _/ __ \| \ | |   | |  | | \ | |_   _|__   __/ ____|
297
  -- | |  | | |__) | |__  | |__) |   /  \  | |    | || |  | |  \| |   | |  | |  \| | | |    | | | (___  
298
  -- | |  | |  ___/|  __| |  _  /   / /\ \ | |    | || |  | | . ` |   | |  | | . ` | | |    | |  \___ \ 
299
  -- | |__| | |    | |____| | \ \  / ____ \| |   _| || |__| | |\  |   | |__| | |\  |_| |_   | |  ____) |
300
  --  \____/|_|    |______|_|  \_\/_/    \_\_|  |_____\____/|_| \_|    \____/|_| \_|_____|  |_| |_____/ 
301
  -- ----------------------------------------------------------------------------------------------
302
  -- ____ _ _  _ _  _ _    ____ ___ _ ____ _  _ 
303
  -- [__  | |\/| |  | |    |__|  |  | |  | |\ | 
304
  -- ___] | |  | |__| |___ |  |  |  | |__| | \| 
305
--synthesis translate_off
306
  SIM: if SIM_FLAG = "ON" generate
307
  --
308
  -- ALU
309
  --
310
  u3_alu: entity PLASMA.plasma_alu(sim_alu)
311
    PORT MAP(
312
      alu_a_in      => reg_src_a_in,        alu_b_in      => reg_src_b_in,
313
      alu_func      => unit_ctrl.alu_func,
314
      alu_out       => alu_out
315
    );
316
 
317
  --
318
  -- SHIFTER
319
  --
320
  u4_shifter: entity PLASMA.plasma_shifter(sim_shifter)
321
    PORT MAP(
322
      shift_in      => reg_src_a_in,          shift_amount  => reg_src_b_in(4 downto 0),
323
      shift_func    => unit_ctrl.shift_func,
324
      shift_out     => shift_out
325
    );
326
 
327
  --
328
  -- MULTIPLICATOR
329
  --
330
  u5_mult: entity PLASMA.plasma_mult(sim_mult)
331
    PORT MAP(
332
      control       => control,
333
      mult_a_in     => reg_src_a_in,        mult_b_in     => reg_src_b_in,
334
      mult_func     => unit_ctrl.mult_func, mult_busy     => unit_busy.mult,
335
      mult_out      => mult_out
336
    );
337
 
338
  --
339
  -- COMPARATOR
340
  --
341
  u6_comp: entity PLASMA.plasma_comparator(structure_comparator)
342
    PORT MAP(
343
      comp_a_in     => reg_src_a_in,        comp_b_in     => reg_src_b_in,
344
      comp_func     => unit_ctrl.comp_func,
345
      comp_out      => comp_out
346
    );
347
  end generate;
348
--synthesis translate_on
349
 
350
  unit_busy.fpu     <= '0';
351
 
352
  -- ____ ___  ____ ____ 
353
  -- |___ |__] | __ |__| 
354
  -- |    |    |__] |  | 
355
  FPGA: if SIM_FLAG = "OF" generate
356
  --
357
  -- ALU
358
  --
359
  u3_alu: entity PLASMA.plasma_alu(FPGA_alu)
360
    PORT MAP(
361
      alu_a_in      => reg_src_a_in,        alu_b_in      => reg_src_b_in,
362
      alu_func      => unit_ctrl.alu_func,
363
      alu_out       => alu_out
364
    );
365
 
366
  --
367
  -- SHIFTER
368
  --
369
  u4_shifter: entity PLASMA.plasma_shifter(FPGA_shifter)
370
    PORT MAP(
371
      shift_in      => reg_src_a_in,          shift_amount  => reg_src_b_in(4 downto 0),
372
      shift_func    => unit_ctrl.shift_func,
373
      shift_out     => shift_out
374
    );
375
 
376
  --
377
  -- MULTIPLICATOR
378
  --
379
  u5_mult: entity PLASMA.plasma_mult(FPGA_mult)
380
    PORT MAP(
381
      control       => control,
382
      mult_a_in     => reg_src_a_in,              mult_b_in     => reg_src_b_in,
383
      mult_func     => unit_ctrl.mult_func,       mult_busy     => unit_busy.mult,
384
      mult_out      => mult_out
385
    );
386
 
387
  --
388
  -- COMPARATOR
389
  --
390
  u6_comp: entity PLASMA.plasma_comparator(structure_comparator)
391
    PORT MAP(
392
      comp_a_in     => reg_src_a_in,        comp_b_in     => reg_src_b_in,
393
      comp_func     => unit_ctrl.comp_func,
394
      comp_out      => comp_out
395
    );
396
  end generate;
397
 
398
 
399
 
400
  --   ____  _    _ _______ _____  _    _ _______   __  __ _    ___   __
401
  --  / __ \| |  | |__   __|  __ \| |  | |__   __| |  \/  | |  | \ \ / /
402
  -- | |  | | |  | |  | |  | |__) | |  | |  | |    | \  / | |  | |\ V / 
403
  -- | |  | | |  | |  | |  |  ___/| |  | |  | |    | |\/| | |  | | > <  
404
  -- | |__| | |__| |  | |  | |    | |__| |  | |    | |  | | |__| |/ . \ 
405
  --  \____/ \____/   |_|  |_|     \____/   |_|    |_|  |_|\____//_/ \_\
406
  --
407
  -- OUTPUT MUX
408
  --
409
  with mux_ctrl.src_out select
410
    op_data_out      <= pc_out_inc        when SRC_OUT_PC,
411
                        shift_out         when SRC_OUT_SHIFT,
412
                        mult_out          when SRC_OUT_MULT,
413
                        reg_mem_data_in   when SRC_OUT_MEM_DATA,
414
                        alu_out           when others;
415
 
416
  --
417
  -- PC VALUE MUX
418
  --
419
  with unit_ctrl.pc_func select
420
    pc_new_value      <=  reg_imm_in      when PLASMA_PC_IMM,
421
                          reg_src_a_in    when PLASMA_PC_REG,
422
                          pc_out_branch   when PLASMA_PC_BRANCH,
423
                          pc_out_inc      when others;
424
 
425
  -- ----------------------------------------------------------------------------------------------
426
  -- ----------------------------------------------------------------------------------------------
427
  -- #     # ####### #     # ####### ######  #     #     #####  #######    #     #####  ####### 
428
  -- ##   ## #       ##   ## #     # #     #  #   #     #     #    #      # #   #     # #       
429
  -- # # # # #       # # # # #     # #     #   # #      #          #     #   #  #       #       
430
  -- #  #  # #####   #  #  # #     # ######     #        #####     #    #     # #  #### #####   
431
  -- #     # #       #     # #     # #   #      #             #    #    ####### #     # #       
432
  -- #     # #       #     # #     # #    #     #       #     #    #    #     # #     # #       
433
  -- #     # ####### #     # ####### #     #    #        #####     #    #     #  #####  ####### 
434
  -- ----------------------------------------------------------------------------------------------
435
  --
436
  -- MEMORY STAGE RESTIERS
437
  --
438
mem_stage_register:
439
  process( control.clk )
440
  begin
441
    if rising_edge( control.clk ) then
442
      if control.rst = '1' then
443
        reg_mem_result      <= PLASMA_ZERO_WORD;
444
        reg_mem_to_memory   <= PLASMA_ZERO_WORD;
445
      else
446
        if (stall_src.data = '0') and
447
           (stall_src.unit = '0')      then
448
          reg_mem_result    <= op_data_out;
449
          reg_mem_to_memory <= reg_mem_data_in;
450
        end if;
451
      end if;
452
    end if;
453
  end process;
454
 
455
  --
456
  -- MEMORY ACCESS OUTPUT
457
  --
458
  data_addr          <= reg_mem_result;                                                -- memory access address
459
  data_to_mem        <= reg_mem_to_memory;                                             -- memory access data
460
 
461
  --
462
  -- MEMORY STAGE MUX
463
  --
464
  with mux_ctrl.wb select
465
    mem_data_out        <=  data_from_mem   when WB_MEMORY,
466
                            reg_mem_result  when others;
467
 
468
  -- ----------------------------------------------------------------------------------------------
469
  -- ----------------------------------------------------------------------------------------------
470
  -- #     # ######  ### ####### #######    ######     #     #####  #    #     #####  #######    #     #####  ####### 
471
  -- #  #  # #     #  #     #    #          #     #   # #   #     # #   #     #     #    #      # #   #     # #       
472
  -- #  #  # #     #  #     #    #          #     #  #   #  #       #  #      #          #     #   #  #       #       
473
  -- #  #  # ######   #     #    #####      ######  #     # #       ###        #####     #    #     # #  #### #####   
474
  -- #  #  # #   #    #     #    #          #     # ####### #       #  #            #    #    ####### #     # #       
475
  -- #  #  # #    #   #     #    #          #     # #     # #     # #   #     #     #    #    #     # #     # #       
476
  --  ## ##  #     # ###    #    #######    ######  #     #  #####  #    #     #####     #    #     #  #####  ####### 
477
  -- ----------------------------------------------------------------------------------------------
478
  --
479
  -- WRITE BACK STAGE REGISTER
480
  --
481
wb_stage_register:
482
  process( control.clk )
483
  begin
484
    if rising_edge( control.clk ) then
485
      if control.rst = '1' then
486
        reg_bank_in   <= PLASMA_ZERO_WORD;
487
      else
488
        if (stall_src.data = '0') then
489
          reg_bank_in <= mem_data_out;
490
        end if;
491
      end if;
492
    end if;
493
  end process;
494
 
495
end architecture structure_plasma_datapath_MIPSI;
496
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.