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

Subversion Repositories w11

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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