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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [rtl/] [w11a/] [pdp11_decode.vhd] - Blame information for rev 8

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 wfjm
-- $Id: pdp11_decode.vhd 330 2010-09-19 17:43:53Z mueller $
2 2 wfjm
--
3
-- Copyright 2006-2008 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
--
14
------------------------------------------------------------------------------
15
-- Module Name:    pdp11_decode - syn
16
-- Description:    pdp11: instruction decoder
17
--
18
-- Dependencies:   -
19
-- Test bench:     tb/tb_pdp11_core (implicit)
20
-- Target Devices: generic
21
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
22
-- Revision History: 
23
-- Date         Rev Version  Comment
24 8 wfjm
-- 2010-09-18   300   1.0.5  rename (adlm)box->(oalm)unit
25 2 wfjm
-- 2008-11-30   174   1.0.4  BUGFIX: add updt_dstadsrc; set for MFP(I/D)
26
-- 2008-05-03   143   1.0.3  get fork_srcr,fork_dstr,fork_dsta assign out of if
27
-- 2008-04-27   139   1.0.2  BUGFIX: mtp now via do_fork_op; is_dsta logic mods
28
-- 2007-06-14    56   1.0.1  Use slvtypes.all
29
-- 2007-05-12    26   1.0    Initial version 
30
------------------------------------------------------------------------------
31
 
32
library ieee;
33
use ieee.std_logic_1164.all;
34
use ieee.std_logic_arith.all;
35
 
36
use work.slvtypes.all;
37
use work.pdp11.all;
38
 
39
-- ----------------------------------------------------------------------------
40
 
41
entity pdp11_decode is                  -- instruction decoder
42
  port (
43
    IREG : in slv16;                    -- input instruction word
44
    STAT : out decode_stat_type         -- status output
45
  );
46
end pdp11_decode;
47
 
48
architecture syn of pdp11_decode is
49
 
50
begin
51
 
52
  proc_idecode: process (IREG)
53
 
54
    alias OPCODE : slv4 is IREG(15 downto 12); -- basic opcode (upper 4 bits)
55
    alias OPPRIM : slv3 is IREG(14 downto 12); -- basic opcode without B bit
56
    alias OPBYTE : slbit is IREG(15);          -- byte flag of basic opcode
57
    alias OPEXT1 : slv3 is IREG(11 downto 9);  -- extended opcode, part 1
58
    alias OPEXT2 : slv3 is IREG(8 downto 6);   -- extended opcode, part 2
59
    alias OPEXT3 : slv3 is IREG(5 downto 3);   -- extended opcode, part 3
60
    alias OPEXT4 : slv3 is IREG(2 downto 0);   -- extended opcode, part 4
61
 
62
    alias SRCMODF : slv3 is IREG(11 downto 9); -- src register full mode
63
    alias DSTMODF : slv3 is IREG(5 downto 3);  -- dst register full mode
64
 
65
    alias SRCMOD : slv2 is IREG(11 downto 10); -- src register mode high
66
    alias SRCDEF : slbit is IREG(9);           -- src register mode defered
67
    alias SRCREG : slv3 is IREG(8 downto 6);   -- src register number
68
    alias DSTMOD : slv2 is IREG(5 downto 4);   -- dst register mode high
69
    alias DSTDEF : slbit is IREG(3);           -- dst register mode defered
70
    alias DSTREG : slv3 is IREG(2 downto 0);   -- dst register number
71
 
72
    variable nstat : decode_stat_type;
73
 
74
    variable is_srcr : slbit := '0';    -- source is read
75
    variable is_dstr : slbit := '0';    -- destination is read
76
    variable is_dstm : slbit := '0';    -- destination is modified
77
    variable is_dstw : slbit := '0';    -- destination is written
78
 
79
    variable is_srcmode0 : slbit := '0';       -- source is register mode
80
    variable is_dstmode0notpc : slbit := '0';  -- dest. is register mode, not PC
81
 
82
  begin
83
 
84
    is_srcr := '0';
85
    is_dstr := '0';
86
    is_dstm := '0';
87
    is_dstw := '0';
88
 
89
    is_srcmode0 := '0';
90
    is_dstmode0notpc := '0';
91
 
92
    nstat.is_dstmode0 := '0';
93
    nstat.is_srcpc := '0';
94
    nstat.is_srcpcmode1 := '0';
95
    nstat.is_dstpc := '0';
96
    nstat.is_dstw_reg := '0';
97
    nstat.is_dstw_pc := '0';
98
    nstat.is_rmwop := '0';
99
    nstat.is_bytop := '0';
100
    nstat.is_res := '1';
101
    nstat.op_rtt := '0';
102
    nstat.op_mov := '0';
103
    nstat.trap_vec := "000";
104
    nstat.force_srcsp := '0';
105
    nstat.updt_dstadsrc := '0';
106
 
107 8 wfjm
    nstat.aunit_srcmod := c_aunit_mod_pass;
108
    nstat.aunit_dstmod := c_aunit_mod_pass;
109
    nstat.aunit_cimod := c_aunit_mod_pass;
110
    nstat.aunit_cc1op := '0';
111
    nstat.aunit_ccmode := IREG(8 downto 6);   -- STATIC
112
    nstat.lunit_func := (others=>'0');
113
    nstat.munit_func := (others=>'0');
114
    nstat.res_sel := c_dpath_res_ounit;
115 2 wfjm
 
116
    nstat.fork_op := (others=>'0');
117
    nstat.fork_srcr := (others=>'0');
118
    nstat.fork_dstr := (others=>'0');
119
    nstat.fork_dsta := (others=>'0');
120
    nstat.fork_opg := (others=>'0');
121
    nstat.fork_opa := (others=>'0');
122
 
123
    nstat.do_fork_op := '0';
124
    nstat.do_fork_srcr := '0';
125
    nstat.do_fork_dstr := '0';
126
    nstat.do_fork_dsta := '0';
127
    nstat.do_fork_opg := '0';
128
 
129
    nstat.do_pref_dec := '0';
130
 
131
    if SRCMODF = "000" then
132
      is_srcmode0 := '1';
133
    end if;
134
 
135
    if DSTMODF = "000" then
136
      nstat.is_dstmode0 := '1';
137
      if DSTREG /= c_gpr_pc then
138
        is_dstmode0notpc := '1';
139
      end if;
140
    end if;
141
 
142
    if SRCREG = c_gpr_pc then
143
      nstat.is_srcpc := '1';
144
      if SRCMODF = "001" then
145
        nstat.is_srcpcmode1 := '1';
146
      end if;
147
    end if;
148
 
149
    if DSTREG = c_gpr_pc then
150
      nstat.is_dstpc := '1';
151
    end if;
152
 
153
    if OPPRIM = "000" then
154
 
155
      if OPBYTE='0' and OPEXT1="000" then
156
 
157
        if OPEXT2="000" and OPEXT3="000" then -- HALT,...,RTT
158
          nstat.is_res := '0';
159
          case OPEXT4 is
160
 
161
            when "000" =>               -- HALT
162
              nstat.fork_op := c_fork_op_halt;
163
              nstat.do_fork_op := '1';
164
 
165
            when "001" =>               -- WAIT 
166
              nstat.fork_op := c_fork_op_wait;
167
              nstat.do_fork_op := '1';
168
 
169
            when "010" =>               -- RTI
170
              nstat.force_srcsp := '1';
171
              nstat.fork_op := c_fork_op_rtti;
172
              nstat.do_fork_op := '1';
173
 
174
            when "011" =>               -- BPT (trap to 14)
175
              nstat.trap_vec := "011";
176
              nstat.fork_op := c_fork_op_trap;
177
              nstat.do_fork_op := '1';
178
 
179
            when "100" =>               -- IOT (trap to 20)
180
              nstat.trap_vec := "100";
181
              nstat.fork_op := c_fork_op_trap;
182
              nstat.do_fork_op := '1';
183
 
184
            when "101" =>               -- RESET
185
              nstat.fork_op := c_fork_op_reset;
186
              nstat.do_fork_op := '1';
187
 
188
            when "110" =>               -- RTT
189
              nstat.op_rtt := '1';
190
              nstat.force_srcsp := '1';
191
              nstat.fork_op := c_fork_op_rtti;
192
              nstat.do_fork_op := '1';
193
 
194
            when others =>
195
              nstat.is_res := '1';
196
 
197
          end case;
198
        end if;
199
 
200
        if OPEXT2 = "001" then          -- JMP 
201
          nstat.is_res := '0';
202
          nstat.fork_opa := c_fork_opa_jmp;
203
          nstat.do_fork_dsta := '1';
204
        end if;
205
 
206
        if OPEXT2 = "010" then
207
          if OPEXT3 = "000" then        -- RTS
208
            nstat.is_res := '0';
209
            nstat.force_srcsp := '1';
210
            nstat.fork_op := c_fork_op_rts;
211
            nstat.do_fork_op := '1';
212
          end if;
213
          if OPEXT3 = "011" then        -- SPL
214
            nstat.is_res := '0';
215
            nstat.fork_op := c_fork_op_spl;
216
            nstat.do_fork_op := '1';
217
          end if;
218
        end if;
219
 
220
        if OPEXT2 = "010" then
221
          if OPEXT3(2) = '1' then       -- SEx/CLx
222
            nstat.is_res := '0';
223
            nstat.fork_op := c_fork_op_mcc;
224
            nstat.do_fork_op := '1';
225
            --!!!nstat.do_pref_dec := '1'; --??? ensure ireg_we ....
226
          end if;
227
        end if;
228
 
229
        if OPEXT2 = "011" then          -- SWAP 
230
          nstat.is_res := '0';
231
          is_dstm := '1';
232
          nstat.fork_opg := c_fork_opg_gen;
233
          nstat.do_fork_opg := '1';
234
          nstat.do_pref_dec := is_dstmode0notpc;
235 8 wfjm
          nstat.lunit_func := c_lunit_func_swap;
236
          nstat.res_sel := c_dpath_res_lunit;
237 2 wfjm
        end if;
238
 
239
      end if; -- OPBYTE='0' and OPEXT1="000"
240
 
241
      if OPEXT1(2)='0' and              -- BR class instructions
242
         ((OPBYTE='0' and OPEXT2(2)='1') or    -- BR
243
          (OPBYTE='0' and (OPEXT1(0)='1' or OPEXT1(1)='1')) or  -- BNE,..,BLE
244
         OPBYTE='1')  then                                       -- BPL,..,BCS
245
        nstat.is_res := '0';
246
        nstat.fork_op := c_fork_op_br;
247
        nstat.do_fork_op := '1';
248
      end if;
249
 
250
      if OPBYTE='0' and OPEXT1="100" then -- JSR
251
        nstat.is_res := '0';
252
        nstat.fork_opa := c_fork_opa_jsr;
253
        nstat.do_fork_dsta := '1';
254
      end if;
255
 
256
      if OPBYTE='1' and OPEXT1="100" then -- EMT, TRAP
257
        nstat.is_res := '0';
258
        if OPEXT2(2) = '0' then         -- EMT (trap tp 30)
259
          nstat.trap_vec := "110";
260
        else                            -- TRAP (trap to 34)
261
          nstat.trap_vec := "111";
262
        end if;
263
        nstat.fork_op := c_fork_op_trap;
264
        nstat.do_fork_op := '1';
265
      end if;
266
 
267
      if OPEXT1 = "101" then            -- CLR(B),...,TST(B)
268
        nstat.is_res := '0';
269 8 wfjm
        nstat.res_sel := c_dpath_res_aunit;
270 2 wfjm
        if OPBYTE = '1' then
271
          nstat.is_bytop := '1';
272
        end if;
273
 
274 8 wfjm
        nstat.aunit_cc1op := '1';
275 2 wfjm
 
276
        case OPEXT2 is
277
          when "000" =>                 -- CLR:    0 +    0 + 0   (0)
278
            is_dstw := '1';
279 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_zero;
280
            nstat.aunit_dstmod := c_aunit_mod_zero;
281
            nstat.aunit_cimod  := c_aunit_mod_zero;
282 2 wfjm
          when "001" =>                 -- COM:    0 + ~DST + 0   (~dst)
283
            is_dstm := '1';
284 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_zero;
285
            nstat.aunit_dstmod := c_aunit_mod_inv;
286
            nstat.aunit_cimod  := c_aunit_mod_zero;
287 2 wfjm
          when "010" =>                 -- INC:    0 +  DST + 1   (dst+1)
288
            is_dstm := '1';
289 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_zero;
290
            nstat.aunit_dstmod := c_aunit_mod_pass;
291
            nstat.aunit_cimod  := c_aunit_mod_one;
292 2 wfjm
          when "011" =>                 -- DEC:   ~0 +  DST + 0   (dst-1)
293
            is_dstm := '1';
294 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_one;
295
            nstat.aunit_dstmod := c_aunit_mod_pass;
296
            nstat.aunit_cimod  := c_aunit_mod_zero;
297 2 wfjm
          when "100" =>                 -- NEG:    0 + ~DST + 1   (-dst)
298
            is_dstm := '1';
299 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_zero;
300
            nstat.aunit_dstmod := c_aunit_mod_inv;
301
            nstat.aunit_cimod  := c_aunit_mod_one;
302 2 wfjm
          when "101" =>                 -- ADC:    0 +  DST + CI  (dst+ci)
303
            is_dstm := '1';
304 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_zero;
305
            nstat.aunit_dstmod := c_aunit_mod_pass;
306
            nstat.aunit_cimod  := c_aunit_mod_pass;
307 2 wfjm
          when "110" =>                 -- SBC:   ~0 +  DST + ~CI (dst-ci)
308
            is_dstm := '1';
309 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_one;
310
            nstat.aunit_dstmod := c_aunit_mod_pass;
311
            nstat.aunit_cimod  := c_aunit_mod_inv;
312 2 wfjm
          when "111" =>                 -- TST:    0 +  DST + 0   (dst)
313
            is_dstr := '1';
314 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_zero;
315
            nstat.aunit_dstmod := c_aunit_mod_pass;
316
            nstat.aunit_cimod  := c_aunit_mod_zero;
317 2 wfjm
          when others => null;
318
        end case;
319
 
320
        nstat.fork_opg := c_fork_opg_gen;
321
        nstat.do_fork_opg := '1';
322
        nstat.do_pref_dec := is_dstmode0notpc;
323
 
324
      end if;
325
 
326
      if OPEXT1 = "110" then
327
        if OPEXT2(2) = '0' then         -- ROR(B),...,ASL(B)
328
          nstat.is_res := '0';
329
          is_dstm := '1';
330
          nstat.fork_opg := c_fork_opg_gen;
331
          nstat.do_fork_opg := '1';
332
          nstat.do_pref_dec := is_dstmode0notpc;
333
          if OPBYTE = '1' then
334
            nstat.is_bytop := '1';
335
          end if;
336 8 wfjm
          nstat.res_sel := c_dpath_res_lunit;
337 2 wfjm
          case OPEXT2(1 downto 0) is
338
            when "00" =>                -- ROR
339 8 wfjm
              nstat.lunit_func := c_lunit_func_ror;
340 2 wfjm
            when "01" =>                -- ROL
341 8 wfjm
              nstat.lunit_func := c_lunit_func_rol;
342 2 wfjm
            when "10" =>                -- ASR
343 8 wfjm
              nstat.lunit_func := c_lunit_func_asr;
344 2 wfjm
            when "11" =>                -- ASL
345 8 wfjm
              nstat.lunit_func := c_lunit_func_asl;
346 2 wfjm
            when others => null;
347
          end case;
348
        end if;
349
 
350
        if OPBYTE='0' and OPEXT2="100" then -- MARK
351
          nstat.is_res := '0';
352
          nstat.fork_op := c_fork_op_mark;
353
          nstat.do_fork_op := '1';
354
        end if;
355
 
356
        if OPEXT2 = "101" then          -- MFP(I/D)
357
          nstat.is_res := '0';
358
          nstat.force_srcsp := '1';
359
          if DSTREG = c_gpr_sp then       -- is dst reg == sp ?
360
            nstat.updt_dstadsrc := '1';     -- ensure DSRC update in dsta flow
361
          end if;
362 8 wfjm
          nstat.res_sel := c_dpath_res_ounit;
363 2 wfjm
          if nstat.is_dstmode0 = '1' then
364
            nstat.fork_opa := c_fork_opa_mfp_reg;
365
          else
366
            nstat.fork_opa := c_fork_opa_mfp_mem;
367
          end if;
368
          nstat.do_fork_dsta := '1';
369
        end if;
370
 
371
        if OPEXT2 = "110" then          -- MTP(I/D)
372
          nstat.is_res := '0';
373
          nstat.force_srcsp := '1';
374 8 wfjm
          nstat.res_sel := c_dpath_res_ounit;
375 2 wfjm
          nstat.fork_opa := c_fork_opa_mtp;
376
          nstat.fork_op  := c_fork_op_mtp;
377
          nstat.do_fork_op := '1';
378
        end if;
379
 
380
        if OPBYTE='0' and OPEXT2="111" then -- SXT
381
          nstat.is_res := '0';
382
          is_dstw := '1';
383
          nstat.fork_opg := c_fork_opg_gen;
384
          nstat.do_fork_opg := '1';
385
          nstat.do_pref_dec := is_dstmode0notpc;
386 8 wfjm
          nstat.lunit_func := c_lunit_func_sxt;
387
          nstat.res_sel := c_dpath_res_lunit;
388 2 wfjm
        end if;
389
      end if;
390
 
391
    end if; -- OPPRIM="000"
392
 
393
    if OPPRIM/="000" and OPPRIM/="111" then
394
      nstat.is_res := '0';
395
      case OPPRIM is
396
        when "001" =>                   -- MOV
397
          is_srcr := '1';
398
          is_dstw := '1';
399
          nstat.op_mov := '1';
400 8 wfjm
          nstat.lunit_func := c_lunit_func_mov;
401
          nstat.res_sel  := c_dpath_res_lunit;
402 2 wfjm
          nstat.is_bytop := OPBYTE;
403
        when "010" =>                   -- CMP
404
          is_srcr := '1';
405
          is_dstr := '1';
406 8 wfjm
          nstat.res_sel  := c_dpath_res_aunit;
407
          nstat.aunit_srcmod := c_aunit_mod_pass;
408
          nstat.aunit_dstmod := c_aunit_mod_inv;
409
          nstat.aunit_cimod  := c_aunit_mod_one;
410 2 wfjm
          nstat.is_bytop := OPBYTE;
411
        when "011" =>                   -- BIT
412
          is_srcr := '1';
413
          is_dstr := '1';
414 8 wfjm
          nstat.lunit_func := c_lunit_func_bit;
415
          nstat.res_sel  := c_dpath_res_lunit;
416 2 wfjm
          nstat.is_bytop := OPBYTE;
417
        when "100" =>                   -- BIC
418
          is_srcr := '1';
419
          is_dstm := '1';
420 8 wfjm
          nstat.lunit_func := c_lunit_func_bic;
421
          nstat.res_sel  := c_dpath_res_lunit;
422 2 wfjm
          nstat.is_bytop := OPBYTE;
423
        when "101" =>                   -- BIS
424
          is_srcr := '1';
425
          is_dstm := '1';
426 8 wfjm
          nstat.lunit_func := c_lunit_func_bis;
427
          nstat.res_sel  := c_dpath_res_lunit;
428 2 wfjm
          nstat.is_bytop := OPBYTE;
429
        when "110" =>
430
          is_srcr := '1';
431
          is_dstm := '1';
432 8 wfjm
          nstat.res_sel    := c_dpath_res_aunit;
433 2 wfjm
          if OPBYTE = '0' then          -- ADD
434 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_pass;
435
            nstat.aunit_dstmod := c_aunit_mod_pass;
436
            nstat.aunit_cimod  := c_aunit_mod_zero;
437 2 wfjm
          else                          -- SUB
438 8 wfjm
            nstat.aunit_srcmod := c_aunit_mod_inv;
439
            nstat.aunit_dstmod := c_aunit_mod_pass;
440
            nstat.aunit_cimod  := c_aunit_mod_one;
441 2 wfjm
          end if;
442
        when others => null;
443
      end case;
444
 
445
      nstat.fork_opg := c_fork_opg_gen;
446
      nstat.do_fork_opg := '1';
447
      nstat.do_pref_dec := is_srcmode0 and is_dstmode0notpc;
448
 
449
    end if;
450
 
451
    if OPBYTE='0' and OPPRIM="111" then
452
      case OPEXT1 is
453
        when "000" =>                   -- MUL
454
          nstat.is_res := '0';
455
          is_dstr := '1';
456 8 wfjm
          nstat.munit_func := c_munit_func_mul;
457
          nstat.res_sel := c_dpath_res_munit;
458 2 wfjm
          nstat.fork_opg := c_fork_opg_mul;
459
          nstat.do_fork_opg := '1';
460
        when "001" =>                   -- DIV
461
          nstat.is_res := '0';
462
          is_dstr := '1';
463 8 wfjm
          nstat.munit_func := c_munit_func_div;
464
          nstat.res_sel := c_dpath_res_munit;
465 2 wfjm
          nstat.fork_opg := c_fork_opg_div;
466
          nstat.do_fork_opg := '1';
467
        when "010" =>                   -- ASH
468
          nstat.is_res := '0';
469
          is_dstr := '1';
470 8 wfjm
          nstat.munit_func := c_munit_func_ash;
471
          nstat.res_sel := c_dpath_res_munit;
472 2 wfjm
          nstat.fork_opg := c_fork_opg_ash;
473
          nstat.do_fork_opg := '1';
474
        when "011" =>                   -- ASHC
475
          nstat.is_res := '0';
476
          is_dstr := '1';
477 8 wfjm
          nstat.munit_func := c_munit_func_ashc;
478
          nstat.res_sel := c_dpath_res_munit;
479 2 wfjm
          nstat.fork_opg := c_fork_opg_ashc;
480
          nstat.do_fork_opg := '1';
481
        when "100" =>                   -- XOR
482
          nstat.is_res := '0';
483
          is_dstm := '1';
484 8 wfjm
          nstat.lunit_func := c_lunit_func_xor;
485
          nstat.res_sel := c_dpath_res_lunit;
486 2 wfjm
          nstat.fork_opg := c_fork_opg_gen;
487
          nstat.do_fork_opg := '1';
488
          nstat.do_pref_dec := is_dstmode0notpc;
489
        when "111" =>                   -- SOB:  SRC +   ~0 + 0   (src-1)
490
          nstat.is_res := '0';
491 8 wfjm
          nstat.aunit_srcmod := c_aunit_mod_pass;
492
          nstat.aunit_dstmod := c_aunit_mod_one;
493
          nstat.aunit_cimod  := c_aunit_mod_zero;
494
          nstat.res_sel := c_dpath_res_aunit;
495 2 wfjm
          nstat.fork_op := c_fork_op_sob;
496
          nstat.do_fork_op := '1';
497
        when others => null;
498
      end case;
499
 
500
    end if;
501
 
502
    if OPBYTE='1' and OPPRIM="111" then -- FPU
503
      nstat.is_res := '1';                    -- ??? FPU not yet handled
504
    end if;
505
 
506
    case SRCMOD is
507
      when "00" => nstat.fork_srcr := c_fork_srcr_def;
508
      when "01" => nstat.fork_srcr := c_fork_srcr_inc;
509
      when "10" => nstat.fork_srcr := c_fork_srcr_dec;
510
      when "11" => nstat.fork_srcr := c_fork_srcr_ind;
511
      when others => null;
512
    end case;
513
 
514
    if is_srcr='1' and SRCMODF /="000" then
515
      nstat.do_fork_srcr := '1';
516
    end if;
517
 
518
    case DSTMOD is
519
      when "00" => nstat.fork_dstr := c_fork_dstr_def;
520
      when "01" => nstat.fork_dstr := c_fork_dstr_inc;
521
      when "10" => nstat.fork_dstr := c_fork_dstr_dec;
522
      when "11" => nstat.fork_dstr := c_fork_dstr_ind;
523
      when others => null;
524
    end case;
525
 
526
    if (is_dstr or is_dstm)='1' and nstat.is_dstmode0='0' then
527
      nstat.do_fork_dstr := '1';
528
    end if;
529
 
530
    if is_dstw='1' and nstat.is_dstmode0='0' then
531
      case DSTMOD is
532
        when "00" => nstat.fork_opg := c_fork_opg_wdef;
533
        when "01" => nstat.fork_opg := c_fork_opg_winc;
534
        when "10" => nstat.fork_opg := c_fork_opg_wdec;
535
        when "11" => nstat.fork_opg := c_fork_opg_wind;
536
        when others => null;
537
      end case;
538
    end if;
539
 
540
    if is_dstm='1' and nstat.is_dstmode0='0' then
541
      nstat.is_rmwop := '1';
542
    end if;
543
 
544
    case DSTMOD is
545
      when "00" => nstat.fork_dsta := c_fork_dsta_def;
546
      when "01" => nstat.fork_dsta := c_fork_dsta_inc;
547
      when "10" => nstat.fork_dsta := c_fork_dsta_dec;
548
      when "11" => nstat.fork_dsta := c_fork_dsta_ind;
549
      when others => null;
550
    end case;
551
 
552
    if (is_dstw or is_dstm)='1' and nstat.is_dstmode0='1' then
553
      nstat.is_dstw_reg := '1';
554
      if DSTREG = c_gpr_pc then
555
        nstat.is_dstw_pc := '1';        --??? hack rename -> is_dstw_pc
556
      end if;
557
    end if;
558
 
559
    STAT <= nstat;
560
 
561
  end process proc_idecode;
562
 
563
end syn;

powered by: WebSVN 2.1.0

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