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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_3_beta/] [rtl/] [vhdl/] [decoder.vhd] - Blame information for rev 92

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

Line No. Rev Author Line
1 4 arniml
-------------------------------------------------------------------------------
2
--
3
-- The Decoder unit.
4
-- It decodes the instruction opcodes and executes them.
5
--
6 92 arniml
-- $Id: decoder.vhd,v 1.11 2004-05-16 15:33:39 arniml Exp $
7 4 arniml
--
8
-- Copyright (c) 2004, Arnim Laeuger (arniml@opencores.org)
9
--
10
-- All rights reserved
11
--
12
-- Redistribution and use in source and synthezised forms, with or without
13
-- modification, are permitted provided that the following conditions are met:
14
--
15
-- Redistributions of source code must retain the above copyright notice,
16
-- this list of conditions and the following disclaimer.
17
--
18
-- Redistributions in synthesized form must reproduce the above copyright
19
-- notice, this list of conditions and the following disclaimer in the
20
-- documentation and/or other materials provided with the distribution.
21
--
22
-- Neither the name of the author nor the names of other contributors may
23
-- be used to endorse or promote products derived from this software without
24
-- specific prior written permission.
25
--
26
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
28
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
30
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
-- POSSIBILITY OF SUCH DAMAGE.
37
--
38
-- Please report bugs to the author, but before you do so, please
39
-- make sure that this is not a derivative work and that
40
-- you have the latest version of this file.
41
--
42
-- The latest version of this file can be found at:
43
--      http://www.opencores.org/cvsweb.shtml/t48/
44
--
45
-------------------------------------------------------------------------------
46
 
47
library ieee;
48
use ieee.std_logic_1164.all;
49
 
50
use work.t48_pack.word_t;
51
use work.t48_pack.mstate_t;
52
use work.alu_pack.alu_op_t;
53
use work.cond_branch_pack.all;
54
use work.dmem_ctrl_pack.all;
55
use work.pmem_ctrl_pack.all;
56
 
57
entity decoder is
58
 
59
  generic (
60
    -- store mnemonic in flip-flops (registered-out)
61
    register_mnemonic_g   : integer := 1
62
  );
63
 
64
  port (
65
    -- Global Interface -------------------------------------------------------
66
    clk_i                  : in  std_logic;
67
    res_i                  : in  std_logic;
68
    en_clk_i               : in  boolean;
69
    ea_i                   : in  std_logic;
70
    ale_i                  : in  boolean;
71
    int_n_i                : in  std_logic;
72
    t0_dir_o               : out std_logic;
73
    -- T48 Bus Interface ------------------------------------------------------
74
    data_i                 : in  word_t;
75
    data_o                 : out word_t;
76
    stack_high_o           : out boolean;
77
    alu_write_accu_o       : out boolean;
78
    alu_write_shadow_o     : out boolean;
79
    alu_write_temp_reg_o   : out boolean;
80
    alu_read_alu_o         : out boolean;
81
    bus_write_bus_o        : out boolean;
82
    bus_read_bus_o         : out boolean;
83
    dm_write_dmem_addr_o   : out boolean;
84
    dm_write_dmem_o        : out boolean;
85
    dm_read_dmem_o         : out boolean;
86
    p1_write_p1_o          : out boolean;
87
    p1_read_p1_o           : out boolean;
88
    p2_write_p2_o          : out boolean;
89
    p2_write_exp_o         : out boolean;
90
    p2_read_p2_o           : out boolean;
91 21 arniml
    p2_read_exp_o          : out boolean;
92 4 arniml
    pm_write_pcl_o         : out boolean;
93
    pm_read_pcl_o          : out boolean;
94
    pm_write_pch_o         : out boolean;
95
    pm_read_pch_o          : out boolean;
96
    pm_read_pmem_o         : out boolean;
97
    psw_read_psw_o         : out boolean;
98
    psw_read_sp_o          : out boolean;
99
    psw_write_psw_o        : out boolean;
100
    psw_write_sp_o         : out boolean;
101
    -- ALU Interface ----------------------------------------------------------
102
    alu_carry_i            : in  std_logic;
103
    alu_op_o               : out alu_op_t;
104
    alu_use_carry_o        : out boolean;
105 27 arniml
    alu_da_high_o          : out boolean;
106 38 arniml
    alu_accu_low_o         : out boolean;
107 27 arniml
    alu_p06_temp_reg_o     : out boolean;
108
    alu_p60_temp_reg_o     : out boolean;
109
    alu_da_overflow_i      : in  boolean;
110 4 arniml
    -- BUS Interface ----------------------------------------------------------
111
    bus_output_pcl_o       : out boolean;
112
    bus_bidir_bus_o        : out boolean;
113
    -- Clock Controller Interface ---------------------------------------------
114
    clk_multi_cycle_o      : out boolean;
115
    clk_assert_psen_o      : out boolean;
116
    clk_assert_prog_o      : out boolean;
117
    clk_assert_rd_o        : out boolean;
118
    clk_assert_wr_o        : out boolean;
119
    clk_mstate_i           : in  mstate_t;
120
    clk_second_cycle_i     : in  boolean;
121
    -- Conditional Branch Logic Interface -------------------------------------
122
    cnd_compute_take_o     : out boolean;
123
    cnd_branch_cond_o      : out branch_conditions_t;
124
    cnd_take_branch_i      : in  boolean;
125
    cnd_comp_value_o       : out comp_value_t;
126
    cnd_f1_o               : out std_logic;
127
    cnd_tf_o               : out std_logic;
128
    -- Data Memory Controller Interface ---------------------------------------
129
    dm_addr_type_o         : out dmem_addr_ident_t;
130
    -- Port 1 Interface -------------------------------------------------------
131
    p1_read_reg_o          : out boolean;
132
    -- Port 2 Interface -------------------------------------------------------
133
    p2_read_reg_o          : out boolean;
134
    p2_output_pch_o        : out boolean;
135
    p2_output_exp_o        : out boolean;
136
    -- Program Memory Controller Interface ------------------------------------
137
    pm_inc_pc_o            : out boolean;
138
    pm_write_pmem_addr_o   : out boolean;
139
    pm_addr_type_o         : out pmem_addr_ident_t;
140
    -- Program Status Word Interface ------------------------------------------
141
    psw_special_data_o     : out std_logic;
142
    psw_carry_i            : in  std_logic;
143 27 arniml
    psw_aux_carry_i        : in  std_logic;
144 4 arniml
    psw_f0_i               : in  std_logic;
145
    psw_inc_stackp_o       : out boolean;
146
    psw_dec_stackp_o       : out boolean;
147
    psw_write_carry_o      : out boolean;
148
    psw_write_aux_carry_o  : out boolean;
149
    psw_write_f0_o         : out boolean;
150
    psw_write_bs_o         : out boolean;
151
    -- Timer Interface --------------------------------------------------------
152
    tim_read_timer_o       : out boolean;
153
    tim_write_timer_o      : out boolean;
154
    tim_start_t_o          : out boolean;
155
    tim_start_cnt_o        : out boolean;
156
    tim_stop_tcnt_o        : out boolean;
157
    tim_overflow_i         : in  boolean
158
  );
159
 
160
end decoder;
161
 
162
 
163
use work.t48_pack.all;
164
use work.alu_pack.all;
165
use work.decoder_pack.all;
166
 
167
use work.t48_comp_pack.opc_decoder;
168
use work.t48_comp_pack.int;
169
 
170 53 arniml
-- pragma translate_off
171
use work.t48_tb_pack.tb_istrobe_s;
172
-- pragma translate_on
173
 
174 4 arniml
architecture rtl of decoder is
175
 
176 92 arniml
  -- Enable fixing a bug of Quartus II 4.0
177
  constant enable_quartus_bugfix_c : boolean := true;
178
 
179 4 arniml
  -- Opcode Decoder
180
  signal opc_multi_cycle_s : boolean;
181
  signal opc_read_bus_s    : boolean;
182
  signal opc_inj_int_s     : boolean;
183
  signal opc_opcode_s      : word_t;
184
  signal opc_mnemonic_s    : mnemonic_t;
185
  signal last_cycle_s      : boolean;
186
 
187
  -- state translators
188
  signal assert_psen_s     : boolean;
189
 
190
  -- branch taken handshake
191
  signal branch_taken_s,
192
         branch_taken_q        : boolean;
193
  signal pm_inc_pc_s           : boolean;
194
  signal pm_write_pmem_addr_s  : boolean;
195
  -- additional signal to increment PC during CALL
196
  signal add_inc_pc_s          : boolean;
197
  -- addtional signal to set PC during RET(R)
198
  signal add_write_pmem_addr_s : boolean;
199
 
200
  -- Flag 1
201
  signal clear_f1_s,
202
         cpl_f1_s          : boolean;
203
  signal f1_q              : std_logic;
204
  -- memory bank select
205
  signal clear_mb_s,
206
         set_mb_s          : boolean;
207
  signal mb_q              : std_logic;
208
 
209
  -- T0 direction selection
210
  signal ent0_clk_s        : boolean;
211
  signal t0_dir_q          : std_logic;
212
 
213
  signal data_s            : word_t;
214
  signal read_dec_s        : boolean;
215
 
216
  signal tf_s              : std_logic;
217
 
218
  signal bus_read_bus_s    : boolean;
219
  signal add_read_bus_s    : boolean;
220
 
221
  signal dm_write_dmem_s   : boolean;
222
 
223
  -- interrupt handling
224
  signal jtf_executed_s    : boolean;
225
  signal en_tcnti_s        : boolean;
226
  signal dis_tcnti_s       : boolean;
227
  signal en_i_s            : boolean;
228
  signal dis_i_s           : boolean;
229
  signal tim_int_s         : boolean;
230
  signal retr_executed_s   : boolean;
231
  signal int_executed_s    : boolean;
232
  signal int_pending_s     : boolean;
233
 
234 38 arniml
  -- pragma translate_off
235 64 arniml
  signal istrobe_res_q     : std_logic;
236
  signal istrobe_q         : std_logic;
237 60 arniml
  signal injected_int_q    : std_logic;
238 38 arniml
  -- pragma translate_on
239
 
240 4 arniml
begin
241
 
242
  -----------------------------------------------------------------------------
243
  -- Opcode Decoder
244
  -----------------------------------------------------------------------------
245
  opc_decoder_b : opc_decoder
246
    generic map (
247
      register_mnemonic_g => register_mnemonic_g
248
    )
249
    port map (
250
      clk_i         => clk_i,
251
      res_i         => res_i,
252
      en_clk_i      => en_clk_i,
253
      data_i        => data_i,
254
      read_bus_i    => opc_read_bus_s,
255
      inj_int_i     => opc_inj_int_s,
256
      opcode_o      => opc_opcode_s,
257
      mnemonic_o    => opc_mnemonic_s,
258
      multi_cycle_o => opc_multi_cycle_s
259
    );
260
 
261
 
262
  -----------------------------------------------------------------------------
263
  -- Interrupt Controller.
264
  -----------------------------------------------------------------------------
265
  int_b : int
266
    port map (
267
      clk_i           => clk_i,
268
      res_i           => res_i,
269
      en_clk_i        => en_clk_i,
270
      clk_mstate_i    => clk_mstate_i,
271
      jtf_executed_i  => jtf_executed_s,
272
      tim_overflow_i  => tim_overflow_i,
273
      tf_o            => tf_s,
274
      en_tcnti_i      => en_tcnti_s,
275
      dis_tcnti_i     => dis_tcnti_s,
276
      int_n_i         => int_n_i,
277
      ale_i           => ale_i,
278
      last_cycle_i    => last_cycle_s,
279
      en_i_i          => en_i_s,
280
      dis_i_i         => dis_i_s,
281
      ext_int_o       => open,
282
      tim_int_o       => tim_int_s,
283
      retr_executed_i => retr_executed_s,
284
      int_executed_i  => int_executed_s,
285
      int_pending_o   => int_pending_s
286
    );
287
 
288
  last_cycle_s <= not opc_multi_cycle_s or
289
                  (opc_multi_cycle_s and clk_second_cycle_i);
290
 
291
  -----------------------------------------------------------------------------
292
  -- Process machine_cycle
293
  --
294
  -- Purpose:
295
  --   Generates the control signals that are basically needed for the
296
  --   handling of a machine cycle.
297
  --
298
  machine_cycle: process (clk_mstate_i,
299
                          clk_second_cycle_i,
300 64 arniml
                          last_cycle_s,
301 4 arniml
                          ea_i,
302
                          assert_psen_s,
303
                          branch_taken_q,
304
                          int_pending_s)
305
 
306
   variable need_address_v      : boolean;
307
 
308
  begin
309
    -- default assignments
310
    clk_assert_psen_o    <= false;
311
    pm_inc_pc_s          <= false;
312
    pm_write_pmem_addr_s <= false;
313
    pm_read_pmem_o       <= false;
314
    bus_output_pcl_o     <= false;
315
    p2_output_pch_o      <= false;
316
    opc_read_bus_s       <= false;
317
    opc_inj_int_s        <= false;
318
    bus_read_bus_s       <= false;
319
 
320
    need_address_v    := not clk_second_cycle_i or
321
                         (clk_second_cycle_i and assert_psen_s);
322
 
323
    case clk_mstate_i is
324
      when MSTATE1 =>
325
        if need_address_v and not int_pending_s then
326
          if ea_i = '0' then
327
            pm_read_pmem_o  <= true;
328
          else
329
            bus_read_bus_s  <= true;
330 64 arniml
            p2_output_pch_o <= true;
331 4 arniml
          end if;
332
        end if;
333
 
334
        if not clk_second_cycle_i then
335
          if not int_pending_s then
336
            opc_read_bus_s  <= true;
337
          else
338
            opc_inj_int_s   <= true;    -- inject interrupt call
339
          end if;
340
        end if;
341
 
342
      when MSTATE2 =>
343
        if need_address_v and not branch_taken_q and
344
           not int_pending_s then
345
          pm_inc_pc_s       <= true;
346
        end if;
347
 
348
      when MSTATE3 =>
349
        if need_address_v then
350
          pm_write_pmem_addr_s <= true;
351 64 arniml
        end if;
352 4 arniml
 
353 64 arniml
        if ea_i = '1' and
354
           (need_address_v and last_cycle_s) then
355
          bus_output_pcl_o   <= true;
356 4 arniml
        end if;
357
 
358
      when MSTATE4 =>
359 64 arniml
        if ea_i = '1' and
360
           (need_address_v or last_cycle_s) then
361 4 arniml
          clk_assert_psen_o <= true;
362 64 arniml
          p2_output_pch_o   <= true;
363
          bus_output_pcl_o  <= true;
364 4 arniml
        end if;
365
 
366
      when MSTATE5 =>
367 64 arniml
        if ea_i = '1' and
368
           (need_address_v and last_cycle_s) then
369 4 arniml
          clk_assert_psen_o <= true;
370 64 arniml
          p2_output_pch_o   <= true;
371 4 arniml
        end if;
372
 
373
      when others =>
374
        -- pragma translate_off
375
        assert false
376
          report "Unkown machine state!"
377
          severity error;
378
        -- pragma translate_on
379
 
380
    end case;
381
 
382
  end process machine_cycle;
383
  --
384
  -----------------------------------------------------------------------------
385
 
386
 
387
  -----------------------------------------------------------------------------
388
  -- Process decode
389
  --
390
  -- Purpose:
391
  --   Indentifies each single instruction and steps through the related
392
  --   execution sequence.
393
  --
394
  decode: process (alu_carry_i,
395 27 arniml
                   psw_aux_carry_i,
396
                   alu_da_overflow_i,
397 4 arniml
                   clk_mstate_i,
398
                   clk_second_cycle_i,
399
                   cnd_take_branch_i,
400
                   opc_opcode_s,
401
                   opc_mnemonic_s,
402
                   psw_carry_i,
403
                   psw_f0_i,
404
                   f1_q,
405
                   mb_q,
406
                   tim_int_s,
407
                   int_pending_s)
408
 
409
    procedure address_indirect_3_f is
410
    begin
411
      -- apply dmem address from selected register for indirect mode
412 92 arniml
      if opc_opcode_s(3) = '0' or enable_quartus_bugfix_c then
413 4 arniml
        dm_read_dmem_o       <= true;
414
        dm_write_dmem_addr_o <= true;
415
        dm_addr_type_o       <= DM_PLAIN;
416
      end if;
417
    end;
418
 
419
    procedure and_or_xor_add_4_f is
420
    begin
421
      -- write dmem contents to Temp Reg
422
      dm_read_dmem_o         <= true;
423
      alu_write_temp_reg_o   <= true;
424
    end;
425
 
426
    procedure and_or_xor_add_5_f (alu_op : alu_op_t) is
427
    begin
428
      -- perform ALU operation and store in Accumulator
429
      alu_op_o               <= alu_op;
430
      alu_read_alu_o         <= true;
431
      alu_write_accu_o       <= true;
432
    end;
433
 
434
    procedure cond_jump_c2_m1_f is
435
    begin
436
      -- store address in Program Counter low byte if branch has to
437
      -- be taken
438 92 arniml
--      if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
439 4 arniml
        pm_write_pcl_o       <= true;
440
        branch_taken_s       <= true;
441 92 arniml
--      end if;
442 4 arniml
    end;
443
 
444
  begin
445
    -- default assignments
446
    data_s                 <= (others => '-');
447
    read_dec_s             <= false;
448
    branch_taken_s         <= false;
449
    clear_f1_s             <= false;
450
    cpl_f1_s               <= false;
451
    clear_mb_s             <= false;
452
    set_mb_s               <= false;
453
    add_inc_pc_s           <= false;
454
    assert_psen_s          <= false;
455
    stack_high_o           <= false;
456
    alu_write_accu_o       <= false;
457
    alu_write_shadow_o     <= false;
458
    alu_write_temp_reg_o   <= false;
459 27 arniml
    alu_p06_temp_reg_o     <= false;
460
    alu_p60_temp_reg_o     <= false;
461 4 arniml
    alu_read_alu_o         <= false;
462
    bus_write_bus_o        <= false;
463
    bus_bidir_bus_o        <= false;
464
    dm_write_dmem_addr_o   <= false;
465
    dm_write_dmem_s        <= false;
466
    dm_read_dmem_o         <= false;
467
    pm_write_pcl_o         <= false;
468
    pm_read_pcl_o          <= false;
469
    pm_write_pch_o         <= false;
470
    pm_read_pch_o          <= false;
471
    pm_addr_type_o         <= PM_PC;
472
    psw_read_psw_o         <= false;
473
    psw_read_sp_o          <= false;
474
    psw_write_psw_o        <= false;
475
    psw_write_sp_o         <= false;
476
    alu_op_o               <= ALU_NOP;
477
    alu_use_carry_o        <= false;
478 27 arniml
    alu_da_high_o          <= false;
479 38 arniml
    alu_accu_low_o         <= false;
480 4 arniml
    clk_assert_prog_o      <= false;
481
    clk_assert_rd_o        <= false;
482
    clk_assert_wr_o        <= false;
483
    cnd_branch_cond_o      <= COND_ON_BIT;
484
    cnd_compute_take_o     <= false;
485
    cnd_comp_value_o       <= opc_opcode_s(7 downto 5);
486
    dm_addr_type_o         <= DM_REG;
487
    tim_read_timer_o       <= false;
488
    tim_write_timer_o      <= false;
489
    tim_start_t_o          <= false;
490
    tim_start_cnt_o        <= false;
491
    tim_stop_tcnt_o        <= false;
492
    p1_write_p1_o          <= false;
493
    p1_read_p1_o           <= false;
494
    p1_read_reg_o          <= false;
495
    p2_write_p2_o          <= false;
496
    p2_write_exp_o         <= false;
497
    p2_read_p2_o           <= false;
498
    p2_read_reg_o          <= false;
499 21 arniml
    p2_read_exp_o          <= false;
500
    p2_output_exp_o        <= false;
501 4 arniml
    psw_special_data_o     <= '0';
502
    psw_inc_stackp_o       <= false;
503
    psw_dec_stackp_o       <= false;
504
    psw_write_carry_o      <= false;
505
    psw_write_aux_carry_o  <= false;
506
    psw_write_f0_o         <= false;
507
    psw_write_bs_o         <= false;
508
    jtf_executed_s         <= false;
509
    en_tcnti_s             <= false;
510
    dis_tcnti_s            <= false;
511
    en_i_s                 <= false;
512
    dis_i_s                <= false;
513
    retr_executed_s        <= false;
514
    int_executed_s         <= false;
515
    add_write_pmem_addr_s  <= false;
516
    ent0_clk_s             <= false;
517
    add_read_bus_s         <= false;
518
 
519
    -- prepare potential register indirect address mode
520
    if not clk_second_cycle_i and clk_mstate_i = MSTATE2 then
521
      data_s               <= (others => '0');
522
      if opc_opcode_s(3) = '1' then
523
        data_s(2 downto 0) <= opc_opcode_s(2 downto 0);
524
      else
525
        data_s(2 downto 0) <= "00" & opc_opcode_s(0);
526
      end if;
527
 
528
      read_dec_s           <= true;
529
      dm_write_dmem_addr_o <= true;
530
      dm_addr_type_o       <= DM_REG;
531
    end if;
532
 
533
    case opc_mnemonic_s is
534
 
535
      -- Mnemonic ADD ---------------------------------------------------------
536
      when MN_ADD =>
537
        case clk_mstate_i is
538
          -- read RAM once for indirect address mode
539
          when MSTATE3 =>
540 92 arniml
            if not enable_quartus_bugfix_c or
541
               opc_opcode_s(3) = '0' then
542
              address_indirect_3_f;
543
            end if;
544 4 arniml
 
545
          -- store data from RAM to Temp Reg
546
          when MSTATE4 =>
547
            and_or_xor_add_4_f;
548
 
549
          -- perform ADD and store in Accumulator
550
          when MSTATE5 =>
551
            and_or_xor_add_5_f(alu_op => ALU_ADD);
552
 
553
            if opc_opcode_s(4) = '1' then
554 27 arniml
              alu_use_carry_o     <= true;
555 4 arniml
            end if;
556
 
557 27 arniml
            psw_special_data_o    <= alu_carry_i;
558
            psw_write_carry_o     <= true;
559
            psw_write_aux_carry_o <= true;
560 4 arniml
 
561
          when others =>
562
            null;
563
 
564
        end case;
565
 
566
      -- Mnemonic ADD_A_DATA --------------------------------------------------
567
      when MN_ADD_A_DATA =>
568 27 arniml
        assert_psen_s               <= true;
569 4 arniml
 
570
        if clk_second_cycle_i then
571
          case clk_mstate_i is
572
            -- write Temp Reg when contents of Program Memory is on bus
573
            when MSTATE1 =>
574 27 arniml
              alu_write_temp_reg_o  <= true;
575 4 arniml
 
576
            -- perform ADD and store in Accumulator
577
            when MSTATE3 =>
578
              and_or_xor_add_5_f(alu_op => ALU_ADD);
579
 
580
              if opc_opcode_s(4) = '1' then
581 27 arniml
                alu_use_carry_o     <= true;
582 4 arniml
              end if;
583
 
584 27 arniml
              psw_special_data_o    <= alu_carry_i;
585
              psw_write_carry_o     <= true;
586
              psw_write_aux_carry_o <= true;
587 4 arniml
 
588
            when others =>
589
              null;
590
 
591
          end case;
592
 
593
        end if;
594
 
595
      -- Mnemonic ANL ---------------------------------------------------------
596
      when MN_ANL =>
597
        case clk_mstate_i is
598
          -- read RAM once for indirect address mode
599
          when MSTATE3 =>
600 92 arniml
            if not enable_quartus_bugfix_c or
601
               opc_opcode_s(3) = '0' then
602
              address_indirect_3_f;
603
            end if;
604 4 arniml
 
605
          -- store data from RAM to Temp Reg
606
          when MSTATE4 =>
607
            and_or_xor_add_4_f;
608
 
609
          -- perform AND and store in Accumulator
610
          when MSTATE5 =>
611
            and_or_xor_add_5_f(alu_op => ALU_AND);
612
 
613
          when others =>
614
            null;
615
 
616
        end case;
617
 
618
      -- Mnemonic ANL_A_DATA --------------------------------------------------
619
      when MN_ANL_A_DATA =>
620
        assert_psen_s              <= true;
621
 
622
        if clk_second_cycle_i then
623
          case clk_mstate_i is
624
            -- write Temp Reg when contents of Program Memory is on bus
625
            when MSTATE1 =>
626
              alu_write_temp_reg_o <= true;
627
 
628
            -- perform AND and store in Accumulator
629
            when MSTATE3 =>
630
              and_or_xor_add_5_f(alu_op => ALU_AND);
631
 
632
            when others =>
633
              null;
634
 
635
          end case;
636
 
637
        end if;
638
 
639
      -- Mnemonic ANL_EXT -----------------------------------------------------
640
      when MN_ANL_EXT =>
641
        assert_psen_s            <= true;
642
 
643
        if not clk_second_cycle_i then
644
          -- read port to Temp Reg
645
          if clk_mstate_i = MSTATE5 then
646
            if opc_opcode_s(1 downto 0) = "00" then
647
              add_read_bus_s     <= true;
648
            elsif opc_opcode_s(1) = '0' then
649
              p1_read_p1_o       <= true;
650
              p1_read_reg_o      <= true;
651
            else
652
              p2_read_p2_o       <= true;
653
              p2_read_reg_o      <= true;
654
            end if;
655
 
656
            alu_write_temp_reg_o <= true;
657
          end if;
658
 
659
        else
660
          case clk_mstate_i is
661
            -- write shadow Accumulator when contents of Program Memory is
662
            -- on bus
663
            when MSTATE1 =>
664
              alu_write_shadow_o <= true;
665
 
666
            -- loop shadow Accumulator through ALU to prevent update from
667
            -- real Accumulator
668
            when MSTATE2 =>
669
              alu_read_alu_o     <= true;
670
              alu_write_shadow_o <= true;
671
 
672
            -- write result of AND operation back to port
673
            when MSTATE3 =>
674
              alu_op_o           <= ALU_AND;
675
              alu_read_alu_o     <= true;
676
 
677
              if opc_opcode_s(1 downto 0) = "00" then
678
                bus_write_bus_o  <= true;
679
              elsif opc_opcode_s(1) = '0' then
680
                p1_write_p1_o    <= true;
681
              else
682
                p2_write_p2_o    <= true;
683
              end if;
684
 
685
            when others =>
686
              null;
687
 
688
          end case;
689
 
690
        end if;
691
 
692
      -- Mnemonic CALL --------------------------------------------------------
693
      when MN_CALL =>
694
        assert_psen_s              <= true;
695
 
696
        if not clk_second_cycle_i then
697
          case clk_mstate_i is
698
            -- read Stack Pointer and address Data Memory for low byte
699
            -- also increment Program Counter to point to next instruction
700
            when MSTATE3 =>
701
              psw_read_sp_o        <= true;
702
              dm_write_dmem_addr_o <= true;
703
              dm_addr_type_o       <= DM_STACK;
704
 
705
              -- only increment PC if this is not an injected CALL
706
              -- injected CALLS are not located in Program Memory,
707
              -- the PC points already to the instruction to be executed
708
              -- after the interrupt
709
              if not int_pending_s then
710
                add_inc_pc_s       <= true;
711
              end if;
712
 
713
            -- store Program Counter low byte on stack
714
            when MSTATE4 =>
715
              pm_read_pcl_o        <= true;
716
              dm_write_dmem_s      <= true;
717
 
718
            -- store Program Counter high byte and PSW on stack
719
            -- increment Stack pointer
720
            when MSTATE5 =>
721
              psw_read_psw_o       <= true;
722
              pm_read_pch_o        <= true;
723
              dm_write_dmem_addr_o <= true;
724
              dm_addr_type_o       <= DM_STACK_HIGH;
725
              dm_write_dmem_s      <= true;
726
              psw_inc_stackp_o     <= true;
727
 
728
            when others =>
729
              null;
730
 
731
          end case;
732
 
733
        else
734
          case clk_mstate_i is
735
            -- store address in Program Counter low byte
736
            when MSTATE1 =>
737
              pm_write_pcl_o       <= true;
738
              branch_taken_s       <= true;
739
              if int_pending_s then
740
                -- apply low part of vector address manually
741
                data_s             <= (others => '0');
742
                data_s(1 downto 0) <= "11";
743
                if tim_int_s then
744
                  data_s(2)        <= '1';
745
                end if;
746
                read_dec_s         <= true;
747
              end if;
748
 
749
            when MSTATE2 =>
750
              pm_write_pch_o       <= true;
751
              read_dec_s           <= true;
752
              if not int_pending_s then
753
                -- store high part of target address in Program Counter
754
                data_s             <= "0000" & mb_q & opc_opcode_s(7 downto 5);
755
              else
756
                -- apply high part of vector address manually
757
                data_s             <= (others => '0');
758
                int_executed_s     <= true;
759
              end if;
760
 
761
            when others =>
762
              null;
763
 
764
          end case;
765
 
766
        end if;
767
 
768
      -- Mnemonic CLR_A -------------------------------------------------------
769
      when MN_CLR_A =>
770
        -- write CLR output of ALU to Accumulator
771
        if clk_mstate_i = MSTATE3 then
772
          alu_op_o         <= ALU_CLR;
773
          alu_read_alu_o   <= true;
774
          alu_write_accu_o <= true;
775
        end if;
776
 
777
      -- Mnemonic CLR_C -------------------------------------------------------
778
      when MN_CLR_C =>
779
        -- store 0 to Carry
780
        if clk_mstate_i = MSTATE3 then
781
          psw_special_data_o <= '0';
782
          psw_write_carry_o  <= true;
783
        end if;
784
 
785
      -- Mnemonic CLR_F -------------------------------------------------------
786
      when MN_CLR_F =>
787
        -- store 0 to selected flag
788
        if clk_mstate_i = MSTATE3 then
789
          if opc_opcode_s(5) = '0' then
790
            psw_special_data_o <= '0';
791
            psw_write_f0_o     <= true;
792
          else
793
            clear_f1_s         <= true;
794
          end if;
795
 
796
        end if;
797
 
798
      -- Mnemonic CPL_A -------------------------------------------------------
799
      when MN_CPL_A =>
800
        -- write CPL output of ALU to Accumulator
801
        if clk_mstate_i = MSTATE3 then
802
          alu_op_o         <= ALU_CPL;
803
          alu_read_alu_o   <= true;
804
          alu_write_accu_o <= true;
805
        end if;
806
 
807
      -- Mnemnonic CPL_C ------------------------------------------------------
808
      when MN_CPL_C =>
809
        -- write inverse of Carry to PSW
810
        if clk_mstate_i = MSTATE3 then
811
          psw_special_data_o <= not psw_carry_i;
812
          psw_write_carry_o  <= true;
813
        end if;
814
 
815
      -- Mnemonic CPL_F -------------------------------------------------------
816
      when MN_CPL_f =>
817
        -- write inverse of selected flag back to flag
818
        if clk_mstate_i = MSTATE3 then
819
          if opc_opcode_s(5) = '0' then
820
            psw_special_data_o <= not psw_f0_i;
821
            psw_write_f0_o     <= true;
822
          else
823
            cpl_f1_s           <= true;
824
          end if;
825
 
826
        end if;
827
 
828 27 arniml
      -- Mnemonic DA ----------------------------------------------------------
829
      when MN_DA =>
830
        alu_op_o                 <= ALU_ADD;
831
 
832
        case clk_mstate_i is
833
          -- Step 1: Preload Temp Reg with 0x06
834
          when MSTATE3 =>
835
            alu_p06_temp_reg_o   <= true;
836
 
837
          -- Step 2: Check Auxiliary Carry and overflow on low nibble
838
          --         Add 0x06 to shadow Accumulator if one is true
839
          when MSTATE4 =>
840
            if psw_aux_carry_i = '1' or alu_da_overflow_i then
841
              alu_read_alu_o     <= true;
842
              alu_write_shadow_o <= true;
843
            end if;
844
 
845
            -- preload Temp Reg with 0x60
846
            alu_p60_temp_reg_o  <= true;
847
 
848
          -- Step 3: Check overflow on high nibble
849
          --         Add 0x60 to shadow Accumulator if true and store result
850
          --         in Accumulator and PSW (only Carry)
851
          when MSTATE5 =>
852
            alu_da_high_o        <= true;
853
 
854
            if alu_da_overflow_i then
855
              psw_special_data_o <= alu_carry_i;
856
            else
857
              alu_op_o           <= ALU_NOP;
858
              psw_special_data_o <= '0';
859
            end if;
860
            alu_read_alu_o       <= true;
861
            alu_write_accu_o     <= true;
862
            psw_write_carry_o    <= true;
863
 
864
          when others =>
865
            null;
866
 
867
        end case;
868
 
869 4 arniml
      -- Mnemonic DEC ---------------------------------------------------------
870
      when MN_DEC =>
871
        case clk_mstate_i is
872
          when MSTATE4 =>
873
            -- DEC Rr: store data from RAM to shadow Accumulator
874
            if opc_opcode_s(6) = '1' then
875
              dm_read_dmem_o         <= true;
876
              alu_write_shadow_o     <= true;
877
            end if;
878
 
879
          when MSTATE5 =>
880
            alu_op_o                 <= ALU_DEC;
881
            alu_read_alu_o           <= true;
882
 
883
            if opc_opcode_s(6) = '0' then
884
              -- write DEC of Accumulator to Accumulator
885
              alu_write_accu_o       <= true;
886
            else
887
              -- store DEC of shadow Accumulator back to dmem
888
              dm_write_dmem_s        <= true;
889
            end if;
890
 
891
          when others =>
892
            null;
893
 
894
        end case;
895
 
896
      -- Mnemonic DIS_EN_I ----------------------------------------------------
897
      when MN_DIS_EN_I =>
898
        if clk_mstate_i = MSTATE3 then
899
          if opc_opcode_s(4) = '1' then
900
            dis_i_s <= true;
901
          else
902
            en_i_s  <= true;
903
          end if;
904
        end if;
905
 
906
      -- Mnemonic DIS_EN_TCNTI ------------------------------------------------
907
      when MN_DIS_EN_TCNTI =>
908
        if clk_mstate_i = MSTATE3 then
909
          if opc_opcode_s(4) = '1' then
910
            dis_tcnti_s <= true;
911
          else
912
            en_tcnti_s  <= true;
913
          end if;
914
        end if;
915
 
916
      -- Mnemonic DJNZ --------------------------------------------------------
917
      when MN_DJNZ =>
918
        assert_psen_s              <= true;
919
 
920
        if not clk_second_cycle_i then
921
          case clk_mstate_i is
922
            -- store data from RAM to shadow Accumulator
923
            when MSTATE4 =>
924
              dm_read_dmem_o         <= true;
925
              alu_write_shadow_o     <= true;
926
 
927
            -- write DEC result of shadow Accumulator back to dmem and
928
            -- conditional branch logic
929
            when MSTATE5 =>
930
              alu_op_o               <= ALU_DEC;
931
              alu_read_alu_o         <= true;
932
              dm_write_dmem_s        <= true;
933
 
934
              cnd_compute_take_o     <= true;
935
              cnd_branch_cond_o      <= COND_Z;
936
              cnd_comp_value_o(0)    <= '0';
937
 
938
            when others =>
939
              null;
940
 
941
          end case;
942
 
943
        else
944
          -- store address in Program Counter low byte if branch has to
945
          -- be taken
946 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
947
            cond_jump_c2_m1_f;
948
          end if;
949 4 arniml
 
950
        end if;
951
 
952
      -- Mnemonic ENT0_CLK ----------------------------------------------------
953
      when MN_ENT0_CLK =>
954
        if clk_mstate_i = MSTATE3 then
955
          ent0_clk_s <= true;
956
        end if;
957
 
958
      -- Mnemonic IN ----------------------------------------------------------
959
      when MN_IN =>
960
        -- read Port and store in Accumulator
961
        if clk_second_cycle_i and clk_mstate_i = MSTATE2 then
962
          alu_write_accu_o <= true;
963
 
964
          if opc_opcode_s(1) = '0' then
965
            p1_read_p1_o   <= true;
966
          else
967
            p2_read_p2_o   <= true;
968
          end if;
969
        end if;
970
 
971
      -- Mnemonic INS ---------------------------------------------------------
972
      when MN_INS =>
973
        -- read BUS and store in Accumulator
974
        if clk_second_cycle_i and clk_mstate_i = MSTATE2 then
975
          alu_write_accu_o <= true;
976
 
977
          add_read_bus_s   <= true;
978
        end if;
979
 
980
      -- Mnemonic INC ---------------------------------------------------------
981
      when MN_INC =>
982
        case clk_mstate_i is
983
          -- read RAM once for indirect address mode
984
          when MSTATE3 =>
985 92 arniml
            if not enable_quartus_bugfix_c or
986
               opc_opcode_s(3) = '0' then
987
              address_indirect_3_f;
988
            end if;
989 4 arniml
 
990
          when MSTATE4 =>
991
            -- INC Rr; INC @ Rr: store data from RAM to shadow Accumulator
992
            if opc_opcode_s(3 downto 2) /= "01" then
993
              dm_read_dmem_o         <= true;
994
              alu_write_shadow_o     <= true;
995
            end if;
996
 
997
          when MSTATE5 =>
998
            alu_op_o                 <= ALU_INC;
999
            alu_read_alu_o           <= true;
1000
 
1001
            if opc_opcode_s(3 downto 2) = "01" then
1002
              -- write INC output of ALU to Accumulator
1003
              alu_write_accu_o       <= true;
1004
            else
1005
              -- store INC of shadow Accumulator back to dmem
1006
              dm_write_dmem_s        <= true;
1007
            end if;
1008
 
1009
          when others =>
1010
            null;
1011
 
1012
        end case;
1013
 
1014
      -- Mnemonic JBB ---------------------------------------------------------
1015
      when MN_JBB =>
1016
        assert_psen_s          <= true;
1017
        cnd_branch_cond_o      <= COND_ON_BIT;
1018
 
1019
        if not clk_second_cycle_i then
1020
          -- read Accumulator and start branch calculation
1021
          if clk_mstate_i = MSTATE3 then
1022
            alu_read_alu_o     <= true;
1023
            cnd_compute_take_o <= true;
1024
            -- cnd_comp_value_o is ok by default assignment
1025
          end if;
1026
 
1027
        else
1028
          -- store address in Program Counter low byte if branch has to
1029
          -- be taken
1030 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1031
            cond_jump_c2_m1_f;
1032
          end if;
1033 4 arniml
 
1034
        end if;
1035
 
1036
      -- Mnemonic JC ----------------------------------------------------------
1037
      when MN_JC =>
1038
        assert_psen_s           <= true;
1039
        cnd_branch_cond_o       <= COND_C;
1040
 
1041
        if not clk_second_cycle_i then
1042
          -- start branch calculation
1043
          if clk_mstate_i = MSTATE3 then
1044
            cnd_compute_take_o  <= true;
1045
            cnd_comp_value_o(0) <= opc_opcode_s(4);
1046
          end if;
1047
 
1048
        else
1049
          -- store address in Program Counter low byte if branch has to
1050
          -- be taken
1051 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1052
            cond_jump_c2_m1_f;
1053
          end if;
1054 4 arniml
 
1055
        end if;
1056
 
1057
      -- Mnemonic JF ----------------------------------------------------------
1058
      when MN_JF =>
1059
        assert_psen_s           <= true;
1060
 
1061
        if not clk_second_cycle_i then
1062
          -- start branch calculation
1063
          if clk_mstate_i = MSTATE3 then
1064
            cnd_compute_take_o  <= true;
1065
            if opc_opcode_s(7) = '1' then
1066
              -- JF0
1067
              cnd_branch_cond_o <= COND_F0;
1068
            else
1069
              -- JF1
1070
              cnd_branch_cond_o <= COND_F1;
1071
            end if;
1072
 
1073
          end if;
1074
 
1075
        else
1076
          -- store address in Program Counter low byte if branch has to
1077
          -- be taken
1078 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1079
            cond_jump_c2_m1_f;
1080
          end if;
1081 4 arniml
 
1082
        end if;
1083
 
1084
 
1085
      -- Mnemonic JMP ---------------------------------------------------------
1086
      when MN_JMP =>
1087
        assert_psen_s        <= true;
1088
 
1089
        if clk_second_cycle_i then
1090
          case clk_mstate_i is
1091
            -- store address in Program Counter low byte
1092
            when MSTATE1 =>
1093
              pm_write_pcl_o <= true;
1094
              branch_taken_s <= true;
1095
 
1096
            -- store high part of target address in Program Counter
1097
            when MSTATE2 =>
1098
              data_s         <= "0000" & mb_q & opc_opcode_s(7 downto 5);
1099
              read_dec_s     <= true;
1100
              pm_write_pch_o <= true;
1101
 
1102
 
1103
            when others =>
1104
              null;
1105
 
1106
          end case;
1107
 
1108
        end if;
1109
 
1110
      -- Mnemonic JMPP --------------------------------------------------------
1111
      when MN_JMPP =>
1112
        assert_psen_s    <= true;
1113
 
1114
        if not clk_second_cycle_i then
1115
          -- write Accumulator to Program Memory address
1116
          -- (skip page offset update from Program Counter)
1117
          if clk_mstate_i = MSTATE3 then
1118
            alu_read_alu_o <= true;
1119
            pm_addr_type_o <= PM_PAGE;
1120
          end if;
1121
 
1122
        else
1123
          if clk_mstate_i = MSTATE1 then
1124
            -- store address in Program Counter low byte
1125
            pm_write_pcl_o <= true;
1126
            branch_taken_s <= true;
1127
          end if;
1128
 
1129
        end if;
1130
 
1131
      -- Mnemonic JNI ---------------------------------------------------------
1132
      when MN_JNI =>
1133
        assert_psen_s          <= true;
1134
        cnd_branch_cond_o      <= COND_INT;
1135
 
1136
        if not clk_second_cycle_i then
1137
          -- start branch calculation
1138
          if clk_mstate_i = MSTATE3 then
1139
            cnd_compute_take_o <= true;
1140
          end if;
1141
 
1142
        else
1143
          -- store address in Program Counter low byte if branch has to
1144
          -- be taken
1145 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1146
            cond_jump_c2_m1_f;
1147
          end if;
1148 4 arniml
 
1149
        end if;
1150
 
1151
      -- Mnemonic JT ----------------------------------------------------------
1152
      when MN_JT =>
1153
        assert_psen_s           <= true;
1154
        if opc_opcode_s(6) = '0' then
1155
          cnd_branch_cond_o     <= COND_T0;
1156
        else
1157
          cnd_branch_cond_o     <= COND_T1;
1158
        end if;
1159
 
1160
        if not clk_second_cycle_i then
1161
          -- start branch calculation
1162
          if clk_mstate_i = MSTATE3 then
1163
            cnd_compute_take_o  <= true;
1164
            cnd_comp_value_o(0) <= opc_opcode_s(4);
1165
          end if;
1166
 
1167
        else
1168
          -- store address in Program Counter low byte if branch has to
1169
          -- be taken
1170 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1171
            cond_jump_c2_m1_f;
1172
          end if;
1173 4 arniml
 
1174
        end if;
1175
 
1176
      -- Mnemonic JTF ---------------------------------------------------------
1177
      when MN_JTF =>
1178
        assert_psen_s          <= true;
1179
        cnd_branch_cond_o      <= COND_TF;
1180
 
1181
        if not clk_second_cycle_i then
1182
          -- start branch calculation
1183
          if clk_mstate_i = MSTATE3 then
1184
            cnd_compute_take_o <= true;
1185
            jtf_executed_s     <= true;
1186
          end if;
1187
 
1188
        else
1189
          -- store address in Program Counter low byte if branch has to
1190
          -- be taken
1191 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1192
            cond_jump_c2_m1_f;
1193
          end if;
1194 4 arniml
 
1195
        end if;
1196
 
1197
      -- Mnemonic JZ ----------------------------------------------------------
1198
      when MN_JZ =>
1199
        assert_psen_s           <= true;
1200
        cnd_branch_cond_o       <= COND_Z;
1201
 
1202
        if not clk_second_cycle_i then
1203
          -- read Accumulator and start branch calculation
1204
          if clk_mstate_i = MSTATE3 then
1205
            alu_read_alu_o      <= true;
1206
            cnd_compute_take_o  <= true;
1207
            cnd_comp_value_o(0) <= opc_opcode_s(6);
1208
          end if;
1209
 
1210
        else
1211
          -- store address in Program Counter low byte if branch has to
1212
          -- be taken
1213 92 arniml
          if clk_mstate_i = MSTATE1 and cnd_take_branch_i then
1214
            cond_jump_c2_m1_f;
1215
          end if;
1216 4 arniml
 
1217
        end if;
1218
 
1219
      -- Mnemonic MOV_A_DATA --------------------------------------------------
1220
      when MN_MOV_A_DATA =>
1221
        assert_psen_s      <= true;
1222
 
1223
        -- Write Accumulator when contents of Program Memory is on bus
1224
        -- during machine state 1 of second cycle.
1225
        if clk_second_cycle_i and clk_mstate_i = MSTATE1 then
1226
          alu_write_accu_o <= true;
1227
        end if;
1228
 
1229
      -- Mnemonic MOV_A_RR ----------------------------------------------------
1230
      when MN_MOV_A_RR =>
1231
        case clk_mstate_i is
1232
          -- read RAM once for indirect address mode
1233
          when MSTATE3 =>
1234 92 arniml
            if not enable_quartus_bugfix_c or
1235
               opc_opcode_s(3) = '0' then
1236
              address_indirect_3_f;
1237
            end if;
1238 4 arniml
 
1239
          -- read data from RAM and store in Accumulator
1240
          when MSTATE4 =>
1241
            and_or_xor_add_4_f;
1242
            alu_write_accu_o <= true;
1243
 
1244
          when others =>
1245
            null;
1246
 
1247
        end case;
1248
 
1249
      -- Mnemonic MOV_A_PSW ---------------------------------------------------
1250
      when MN_MOV_A_PSW =>
1251
        if clk_mstate_i = MSTATE3 then
1252
          psw_read_psw_o   <= true;
1253
          psw_read_sp_o    <= true;
1254
          alu_write_accu_o <= true;
1255
        end if;
1256
 
1257
      -- Mnemoniv MOV_PSW_A ---------------------------------------------------
1258
      when MN_MOV_PSW_A =>
1259
        if clk_mstate_i = MSTATE3 then
1260
          alu_read_alu_o  <= true;
1261
          psw_write_psw_o <= true;
1262
          psw_write_sp_o  <= true;
1263
        end if;
1264
 
1265
      -- Mnemonic MOV_RR ------------------------------------------------------
1266
      when MN_MOV_RR =>
1267
        case clk_mstate_i is
1268
          -- read RAM once for indirect address mode
1269
          when MSTATE3 =>
1270 92 arniml
            if not enable_quartus_bugfix_c or
1271
               opc_opcode_s(3) = '0' then
1272
              address_indirect_3_f;
1273
            end if;
1274 4 arniml
 
1275
          -- write Accumulator to dmem
1276
          when MSTATE5 =>
1277
            alu_read_alu_o       <= true;
1278
            dm_write_dmem_s      <= true;
1279
 
1280
          when others =>
1281
            null;
1282
 
1283
        end case;
1284
 
1285
      -- Mnemonic MOV_RR_DATA -------------------------------------------------
1286
      when MN_MOV_RR_DATA =>
1287
        assert_psen_s     <= true;
1288
 
1289
        -- read RAM once for indirect address mode
1290
        if not clk_second_cycle_i and clk_mstate_i = MSTATE3 then
1291 92 arniml
          if not enable_quartus_bugfix_c or
1292
             opc_opcode_s(3) = '0' then
1293
            address_indirect_3_f;
1294
          end if;
1295 4 arniml
        end if;
1296
 
1297
        -- Write Data Memory when contents of Program Memory is on bus
1298
        -- during machine state 1 of second cycle.
1299
        if clk_second_cycle_i and clk_mstate_i = MSTATE1 then
1300
          dm_write_dmem_s <= true;
1301
        end if;
1302
 
1303
      -- Mnemonic MOV_T -------------------------------------------------------
1304
      when MN_MOV_T =>
1305
        if clk_mstate_i = MSTATE3 then
1306
          if opc_opcode_s(5) = '1' then
1307
            alu_read_alu_o    <= true;  -- MOV T, A
1308
            tim_write_timer_o <= true;
1309
          else
1310
            tim_read_timer_o  <= true;  -- MOV A, T
1311
            alu_write_accu_o  <= true;
1312
          end if;
1313
        end if;
1314
 
1315 21 arniml
      -- Mnemonic OUTD_PP_A ---------------------------------------------------
1316
      when MN_OUTD_PP_A =>
1317
        clk_assert_prog_o     <= true;
1318
 
1319
        if not clk_second_cycle_i then
1320
          case clk_mstate_i is
1321
            -- propagate expander port number to Port 2
1322
            when MSTATE3 =>
1323
 
1324
              data_s(7 downto 4)     <= (others => '0');
1325
              data_s(1 downto 0)     <= opc_opcode_s(1 downto 0);
1326
              -- decide which 8243 command to use
1327
              case opc_opcode_s(7 downto 4) is
1328
                when "1001" =>
1329
                  data_s(3 downto 2) <= "11";  -- ANLD command
1330
                when "1000" =>
1331
                  data_s(3 downto 2) <= "10";  -- ORLD command
1332
                when "0011" =>
1333
                  data_s(3 downto 2) <= "01";  -- MOVD command
1334
                when others =>
1335
                  null;
1336
              end case;
1337
 
1338
              read_dec_s      <= true;
1339
              p2_write_exp_o  <= true;
1340
 
1341
            -- output expander port number on Port 2 while active edge of PROG
1342
            -- write Accumulator to expander port
1343
            when MSTATE4 =>
1344
              p2_output_exp_o <= true;
1345
 
1346
              alu_read_alu_o  <= true;
1347
              p2_write_exp_o  <= true;
1348
 
1349
            when MSTATE5 =>
1350
              p2_output_exp_o <= true;
1351
 
1352
            when others =>
1353
              null;
1354
 
1355
          end case;
1356
 
1357
        else
1358
          -- hold expander port until inactive edge of PROG 
1359
          if clk_mstate_i = MSTATE1 or clk_mstate_i = MSTATE2 then
1360
            p2_output_exp_o   <= true;
1361
          end if;
1362
 
1363
        end if;
1364
 
1365
      -- Mnemonic MOVD_A_PP ---------------------------------------------------
1366
      when MN_MOVD_A_PP =>
1367
        clk_assert_prog_o            <= true;
1368
 
1369
        if not clk_second_cycle_i then
1370
          case clk_mstate_i is
1371
            -- propagate expander port number to Port 2
1372
            when MSTATE3 =>
1373
              data_s                 <= "0000" &
1374
                                        "00"   &  -- 8243 command: read
1375
                                        opc_opcode_s(1 downto 0);
1376
              read_dec_s             <= true;
1377
              p2_write_exp_o         <= true;
1378
 
1379
            -- output expander port number on Port 2 while active edge of PROG
1380
            -- write 1's to expander port to set lower nibble of Port 2 to input
1381
            when MSTATE4 =>
1382
              p2_output_exp_o        <= true;
1383
 
1384
              data_s(nibble_t'range) <= (others => '1');
1385
              read_dec_s             <= true;
1386
              p2_write_exp_o         <= true;
1387
 
1388
            when MSTATE5 =>
1389
              p2_output_exp_o        <= true;
1390
 
1391
            when others =>
1392
              null;
1393
 
1394
          end case;
1395
 
1396
        else
1397
          case clk_mstate_i is
1398
            -- hold expander port until inactive edge of PROG
1399
            when MSTATE1 =>
1400
              p2_output_exp_o  <= true;
1401
 
1402
            -- hold expander port until inactive edge of PROG
1403
            -- write Accumulator with nibble of expander port
1404
            when MSTATE2 =>
1405
              p2_output_exp_o  <= true;
1406
              p2_read_exp_o    <= true;
1407
              alu_write_accu_o <= true;
1408
 
1409
            when others =>
1410
              null;
1411
 
1412
          end case;
1413
 
1414
        end if;
1415
 
1416 4 arniml
      -- Mnemonic MOVP --------------------------------------------------------
1417
      when MN_MOVP =>
1418
        assert_psen_s        <= true;
1419
 
1420
        if not clk_second_cycle_i then
1421
          -- write Accumulator to Program Memory address
1422
          -- (skip page offset update from Program Counter)
1423
          if clk_mstate_i = MSTATE3 then
1424
            alu_read_alu_o   <= true;
1425
            if opc_opcode_s(6) = '0' then
1426
              pm_addr_type_o <= PM_PAGE;
1427
            else
1428
              pm_addr_type_o <= PM_PAGE3;
1429
            end if;
1430
          end if;
1431
 
1432
        else
1433
          if clk_mstate_i = MSTATE1 then
1434
            -- store data from Program Memory in Accumulator
1435
            alu_write_accu_o <= true;
1436
            -- trick & treat to prevent additional PC increment
1437
            -- our branch target is the previously incremented PC!
1438
            branch_taken_s   <= true;
1439
          end if;
1440
 
1441
        end if;
1442
 
1443
      -- Mnemonic MOVX --------------------------------------------------------
1444
      when MN_MOVX =>
1445
        bus_bidir_bus_o        <= true;
1446
 
1447
        if opc_opcode_s(4) = '0' then
1448
          clk_assert_rd_o      <= true;
1449
        else
1450
          clk_assert_wr_o      <= true;
1451
        end if;
1452
 
1453
        if not clk_second_cycle_i then
1454 78 arniml
          case clk_mstate_i is
1455
            -- read dmem and put contents on BUS as external address
1456
            when MSTATE3 =>
1457
              dm_read_dmem_o     <= true;
1458
              bus_write_bus_o    <= true;
1459 4 arniml
 
1460 78 arniml
            -- store contents of Accumulator to BUS
1461
            when MSTATE5 =>
1462
              if opc_opcode_s(4) = '1' then
1463
                alu_read_alu_o   <= true;
1464
                bus_write_bus_o  <= true;
1465
              end if;
1466
 
1467
            when others =>
1468
              null;
1469
          end case;
1470
 
1471 4 arniml
        else
1472
          if clk_mstate_i = MSTATE1 then
1473
            if opc_opcode_s(4) = '0' then
1474
              -- store contents of BUS in Accumulator
1475
              add_read_bus_s   <= true;
1476
              alu_write_accu_o <= true;
1477
            else
1478
              -- store contents of Accumulator to BUS
1479
              alu_read_alu_o   <= true;
1480
              bus_write_bus_o  <= true;
1481
            end if;
1482
          end if;
1483
 
1484
        end if;
1485
 
1486
      -- Mnemonic NOP ---------------------------------------------------------
1487
      when MN_NOP =>
1488
        -- nothing to do
1489
 
1490
      -- Mnemonic ORL ---------------------------------------------------------
1491
      when MN_ORL =>
1492
        case clk_mstate_i is
1493
          -- read RAM once for indirect address mode
1494
          when MSTATE3 =>
1495 92 arniml
            if not enable_quartus_bugfix_c or
1496
               opc_opcode_s(3) = '0' then
1497
              address_indirect_3_f;
1498
            end if;
1499 4 arniml
 
1500
          -- store data from RAM to Temp Reg
1501
          when MSTATE4 =>
1502
            and_or_xor_add_4_f;
1503
 
1504
          -- perform OR and store in Accumulator
1505
          when MSTATE5 =>
1506
            and_or_xor_add_5_f(alu_op => ALU_OR);
1507
 
1508
          when others =>
1509
            null;
1510
 
1511
        end case;
1512
 
1513
      -- Mnemonic ORL_A_DATA --------------------------------------------------
1514
      when MN_ORL_A_DATA =>
1515
        assert_psen_s              <= true;
1516
 
1517
        if clk_second_cycle_i then
1518
          case clk_mstate_i is
1519
            -- write Temp Reg when contents of Program Memory is on bus
1520
            when MSTATE1 =>
1521
              alu_write_temp_reg_o <= true;
1522
 
1523
            -- perform OR and store in Accumulator
1524
            when MSTATE3 =>
1525
              and_or_xor_add_5_f(alu_op => ALU_OR);
1526
 
1527
            when others =>
1528
              null;
1529
 
1530
          end case;
1531
 
1532
        end if;
1533
 
1534
      -- Mnemonic ORL_EXT -----------------------------------------------------
1535
      when MN_ORL_EXT =>
1536
        assert_psen_s            <= true;
1537
 
1538
        if not clk_second_cycle_i then
1539
          -- read port to Temp Reg
1540
          if clk_mstate_i = MSTATE5 then
1541
            if opc_opcode_s(1 downto 0) = "00" then
1542
              add_read_bus_s     <= true;
1543
            elsif opc_opcode_s(1) = '0' then
1544
              p1_read_p1_o       <= true;
1545
              p1_read_reg_o      <= true;
1546
            else
1547
              p2_read_p2_o       <= true;
1548
              p2_read_reg_o      <= true;
1549
            end if;
1550
 
1551
            alu_write_temp_reg_o <= true;
1552
          end if;
1553
 
1554
        else
1555
          case clk_mstate_i is
1556
            -- write shadow Accumulator when contents of Program Memory is
1557
            -- on bus
1558
            when MSTATE1 =>
1559
              alu_write_shadow_o <= true;
1560
 
1561
            -- loop shadow Accumulator through ALU to prevent update from
1562
            -- real Accumulator
1563
            when MSTATE2 =>
1564
              alu_read_alu_o     <= true;
1565
              alu_write_shadow_o <= true;
1566
 
1567
            -- write result of OR operation back to port
1568
            when MSTATE3 =>
1569
              alu_op_o           <= ALU_OR;
1570
              alu_read_alu_o     <= true;
1571
 
1572
              if opc_opcode_s(1 downto 0) = "00" then
1573
                bus_write_bus_o  <= true;
1574
              elsif opc_opcode_s(1) = '0' then
1575
                p1_write_p1_o    <= true;
1576
              else
1577
                p2_write_p2_o    <= true;
1578
              end if;
1579
 
1580
            when others =>
1581
              null;
1582
 
1583
          end case;
1584
 
1585
        end if;
1586
 
1587
      -- Mnemonic OUTL_EXT ----------------------------------------------------
1588
      when MN_OUTL_EXT =>
1589
        -- read Accumulator and store in Port/BUS output register
1590
        if clk_second_cycle_i and clk_mstate_i = MSTATE4 then
1591
          alu_read_alu_o  <= true;
1592
 
1593
          if opc_opcode_s(4) = '1' then
1594
            if opc_opcode_s(1) = '0' then
1595
              p1_write_p1_o <= true;
1596
            else
1597
              p2_write_p2_o <= true;
1598
            end if;
1599
 
1600
          else
1601
            bus_write_bus_o <= true;
1602
 
1603
          end if;
1604
 
1605
        end if;
1606
 
1607
      -- Mnemonic RET ---------------------------------------------------------
1608
      when MN_RET =>
1609
        if not clk_second_cycle_i then
1610
          case clk_mstate_i is
1611
            -- decrement Stack Pointer
1612
            when MSTATE3 =>
1613
              psw_dec_stackp_o     <= true;
1614
 
1615
            -- read Stack Pointer and address Data Memory for low byte
1616
            when MSTATE4 =>
1617
              psw_read_sp_o        <= true;
1618
              dm_write_dmem_addr_o <= true;
1619
              dm_addr_type_o       <= DM_STACK;
1620
 
1621
            -- read Data Memory and store to Program Counter low
1622
            -- prepare address to Data memory for high byte
1623
            when MSTATE5 =>
1624
              dm_read_dmem_o       <= true;
1625
              pm_write_pcl_o       <= true;
1626
              dm_write_dmem_addr_o <= true;
1627
              dm_addr_type_o       <= DM_STACK_HIGH;
1628
 
1629
            when others =>
1630
              null;
1631
 
1632
          end case;
1633
 
1634
        else
1635
          case clk_mstate_i is
1636
            -- read Data Memory and store to Program Counter high and PSW
1637
            when MSTATE1 =>
1638
              dm_read_dmem_o         <= true;
1639
              pm_write_pch_o         <= true;
1640
              if opc_opcode_s(4) = '1' then
1641
                psw_write_psw_o      <= true;
1642
                retr_executed_s      <= true;
1643
              end if;
1644
 
1645
            when MSTATE2 =>
1646
              add_write_pmem_addr_s  <= true;
1647
 
1648
            when others =>
1649
              null;
1650
 
1651
          end case;
1652
 
1653
        end if;
1654
 
1655
      -- Mnemonic RL ----------------------------------------------------------
1656
      when MN_RL =>
1657
        if clk_mstate_i = MSTATE3 then
1658
          alu_op_o             <= ALU_RL;
1659
          alu_read_alu_o       <= true;
1660
          alu_write_accu_o     <= true;
1661
 
1662
          if opc_opcode_s(4) = '1' then
1663
            psw_special_data_o <= alu_carry_i;
1664
            psw_write_carry_o  <= true;
1665
            alu_use_carry_o    <= true;
1666
          end if;
1667
        end if;
1668
 
1669
      -- Mnemonic RR ----------------------------------------------------------
1670
      when MN_RR =>
1671
        if clk_mstate_i = MSTATE3 then
1672
          alu_op_o             <= ALU_RR;
1673
          alu_read_alu_o       <= true;
1674
          alu_write_accu_o     <= true;
1675
 
1676
          if opc_opcode_s(4) = '0' then
1677
            psw_special_data_o <= alu_carry_i;
1678
            psw_write_carry_o  <= true;
1679
            alu_use_carry_o    <= true;
1680
          end if;
1681
        end if;
1682
 
1683
      -- Mnemonic SEL_MB ------------------------------------------------------
1684
      when MN_SEL_MB =>
1685
        if clk_mstate_i = MSTATE3 then
1686
          if opc_opcode_s(4) = '1' then
1687
            set_mb_s   <= true;
1688
          else
1689
            clear_mb_s <= true;
1690
          end if;
1691
        end if;
1692
 
1693
      -- Mnemonic SEL_RB ------------------------------------------------------
1694
      when MN_SEL_RB =>
1695
        if clk_mstate_i = MSTATE3 then
1696
          psw_special_data_o <= opc_opcode_s(4);
1697
          psw_write_bs_o     <= true;
1698
        end if;
1699
 
1700
      -- Mnemonic STOP_TCNT ---------------------------------------------------
1701
      when MN_STOP_TCNT =>
1702
        if clk_mstate_i = MSTATE3 then
1703
          tim_stop_tcnt_o <= true;
1704
        end if;
1705
 
1706
      -- Mnemonic STRT --------------------------------------------------------
1707
      when MN_STRT =>
1708
        if clk_mstate_i = MSTATE3 then
1709
          if opc_opcode_s(4) = '1' then
1710
            tim_start_t_o   <= true;
1711
          else
1712
            tim_start_cnt_o <= true;
1713
          end if;
1714
        end if;
1715
 
1716
      -- Mnemonic SWAP --------------------------------------------------------
1717
      when MN_SWAP =>
1718
        alu_op_o           <= ALU_SWAP;
1719
 
1720
        if clk_mstate_i = MSTATE3 then
1721
          alu_read_alu_o   <= true;
1722
          alu_write_accu_o <= true;
1723
        end if;
1724
 
1725
      -- Mnemonic XCH ---------------------------------------------------------
1726
      when MN_XCH =>
1727
        case clk_mstate_i is
1728
          -- read RAM once for indirect address mode
1729
          when MSTATE3 =>
1730 92 arniml
            if not enable_quartus_bugfix_c or
1731
               opc_opcode_s(3) = '0' then
1732
              address_indirect_3_f;
1733
            end if;
1734 4 arniml
 
1735 38 arniml
          -- store data from RAM in Accumulator and Temp Reg
1736 4 arniml
          -- Accumulator is already shadowed!
1737
          when MSTATE4 =>
1738 38 arniml
            dm_read_dmem_o       <= true;
1739
            alu_write_accu_o     <= true;
1740
            alu_write_temp_reg_o <= true;
1741
            if opc_opcode_s(4) = '1' then
1742
              -- XCHD
1743
              -- only write lower nibble of Accumulator
1744
              alu_accu_low_o     <= true;
1745
            end if;
1746 4 arniml
 
1747
          -- store data from shadow (previous) Accumulator to dmem
1748
          when MSTATE5 =>
1749 38 arniml
            dm_write_dmem_s      <= true;
1750
            alu_read_alu_o       <= true;
1751
            if opc_opcode_s(4) = '1' then
1752
              -- XCHD
1753
              -- concatenate shadow Accumulator and Temp Reg
1754
              alu_op_o           <= ALU_CONCAT;
1755
            end if;
1756 4 arniml
 
1757
          when others =>
1758
            null;
1759
 
1760
        end case;
1761
 
1762
      -- Mnemonic XRL ---------------------------------------------------------
1763
      when MN_XRL =>
1764
        case clk_mstate_i is
1765
          -- read RAM once for indirect address mode
1766
          when MSTATE3 =>
1767 92 arniml
            if not enable_quartus_bugfix_c or
1768
               opc_opcode_s(3) = '0' then
1769
              address_indirect_3_f;
1770
            end if;
1771 4 arniml
 
1772
          -- store data from RAM to Temp Reg
1773
          when MSTATE4 =>
1774
            and_or_xor_add_4_f;
1775
 
1776
          -- perform XOR and store in Accumulator
1777
          when MSTATE5 =>
1778
            and_or_xor_add_5_f(alu_op => ALU_XOR);
1779
 
1780
          when others =>
1781
            null;
1782
 
1783
        end case;
1784
 
1785
      -- Mnemonic XRL_A_DATA --------------------------------------------------
1786
      when MN_XRL_A_DATA =>
1787
        assert_psen_s              <= true;
1788
 
1789
        if clk_second_cycle_i then
1790
          case clk_mstate_i is
1791
            -- write Temp Reg when contents of Program Memory is on bus
1792
            when MSTATE1 =>
1793
              alu_write_temp_reg_o <= true;
1794
 
1795
            -- perform XOR and store in Accumulator
1796
            when MSTATE3 =>
1797
              and_or_xor_add_5_f(alu_op => ALU_XOR);
1798
 
1799
            when others =>
1800
              null;
1801
 
1802
          end case;
1803
 
1804
        end if;
1805
 
1806
      -- Unimplemented mnemonic -----------------------------------------------
1807
      when others =>
1808
        -- this will behave like a NOP
1809
 
1810
        -- pragma translate_off
1811
        assert false
1812
          report "Mnemonic not yet implemented."
1813
          severity warning;
1814
        -- pragma translate_on
1815
 
1816
    end case;
1817
 
1818
  end process decode;
1819
  --
1820
  -----------------------------------------------------------------------------
1821
 
1822
 
1823
  -----------------------------------------------------------------------------
1824
  -- Process regs
1825
  --
1826
  -- Purpose:
1827
  --   Implements the various registes.
1828
  --
1829
  regs: process (res_i, clk_i)
1830
  begin
1831
    if res_i = res_active_c then
1832
      branch_taken_q <= false;
1833
      f1_q           <= '0';
1834
      mb_q           <= '0';
1835
      t0_dir_q       <= '0';
1836 38 arniml
      -- pragma translate_off
1837 64 arniml
      istrobe_res_q  <= '1';
1838
      istrobe_q      <= '0';
1839 60 arniml
      injected_int_q <= '0';
1840 38 arniml
      -- pragma translate_on
1841 4 arniml
 
1842
    elsif clk_i'event and clk_i = clk_active_c then
1843
      if en_clk_i then
1844
 
1845
        -- branch taken flag
1846
        if branch_taken_s then
1847
          branch_taken_q <= true;
1848
        elsif clk_mstate_i = MSTATE5 then
1849
          -- release flag when new instruction starts
1850
          branch_taken_q <= false;
1851
        end if;
1852
 
1853
        -- Flag 1
1854
        if clear_f1_s then
1855
          f1_q         <= '0';
1856
        elsif cpl_f1_s then
1857
          f1_q         <= not f1_q;
1858
        end if;
1859
 
1860
        -- Memory Bank select
1861
        if clear_mb_s then
1862
          mb_q         <= '0';
1863
        elsif set_mb_s then
1864
          mb_q         <= '1';
1865
        end if;
1866
 
1867
        -- T0 direction selection
1868
        if ent0_clk_s then
1869
          t0_dir_q     <= '1';
1870
        end if;
1871
 
1872 60 arniml
        -- pragma translate_off
1873
        -- Marker for injected instruction ------------------------------------
1874
        if opc_inj_int_s then
1875
          injected_int_q <= '1';
1876
        elsif clk_mstate_i = MSTATE5 and last_cycle_s then
1877
          injected_int_q <= '0';
1878
        end if;
1879 64 arniml
 
1880
        -- Remove istrobe after reset suppression -----------------------------
1881
        if clk_mstate_i = MSTATE5 and last_cycle_s then
1882
          istrobe_res_q  <= '0';
1883
        end if;
1884 60 arniml
        -- pragma translate_on
1885
 
1886 38 arniml
      end if;
1887
 
1888 64 arniml
      -- pragma translate_off
1889
      -- Instruction Strobe ---------------------------------------------------
1890
      if clk_mstate_i = MSTATE5 and last_cycle_s and
1891
         injected_int_q = '0' then
1892
        if istrobe_res_q = '0' then
1893
          istrobe_q <= '1';
1894
        end if;
1895
      else
1896
        istrobe_q   <= '0';
1897
      end if;
1898
      -- pragma translate_on
1899
 
1900 4 arniml
    end if;
1901
 
1902
  end process regs;
1903
  --
1904
  -----------------------------------------------------------------------------
1905
 
1906 53 arniml
  -- pragma translate_off
1907
  -- assign to global signal for testbench
1908 64 arniml
  tb_istrobe_s <= istrobe_q;
1909 53 arniml
  -- pragma translate_on
1910 4 arniml
 
1911 53 arniml
 
1912 4 arniml
  -----------------------------------------------------------------------------
1913
  -- Output Mapping.
1914
  -----------------------------------------------------------------------------
1915
  clk_multi_cycle_o    <= opc_multi_cycle_s;
1916
  cnd_f1_o             <= f1_q;
1917
  cnd_tf_o             <= tf_s;
1918
  data_o               <=   data_s
1919
                          when read_dec_s else
1920
                            (others => bus_idle_level_c);
1921
  dm_write_dmem_o      <= dm_write_dmem_s      and en_clk_i;
1922
  pm_inc_pc_o          <= pm_inc_pc_s          or add_inc_pc_s;
1923
  pm_write_pmem_addr_o <= pm_write_pmem_addr_s or add_write_pmem_addr_s;
1924
  t0_dir_o             <= t0_dir_q;
1925
  bus_read_bus_o       <= bus_read_bus_s       or add_read_bus_s;
1926
 
1927
end rtl;
1928
 
1929
 
1930
-------------------------------------------------------------------------------
1931
-- File History:
1932
--
1933
-- $Log: not supported by cvs2svn $
1934 92 arniml
-- Revision 1.10  2004/04/25 16:22:03  arniml
1935
-- adjust external timing of BUS
1936
--
1937 78 arniml
-- Revision 1.9  2004/04/24 11:22:55  arniml
1938
-- removed superfluous signal from sensitivity list
1939
--
1940 72 arniml
-- Revision 1.8  2004/04/18 18:57:43  arniml
1941
-- + enhance instruction strobe generation
1942
-- + rework address output under EA=1 conditions
1943
--
1944 64 arniml
-- Revision 1.7  2004/04/15 22:06:05  arniml
1945
-- + add marker for injected calls
1946
-- + suppress intstruction strobes for injected calls
1947
--
1948 60 arniml
-- Revision 1.6  2004/04/14 20:53:33  arniml
1949
-- make istrobe visible through testbench package
1950
--
1951 53 arniml
-- Revision 1.5  2004/04/07 22:09:03  arniml
1952
-- remove unused signals
1953
--
1954 45 arniml
-- Revision 1.4  2004/04/04 14:18:53  arniml
1955
-- add measures to implement XCHD
1956
--
1957 38 arniml
-- Revision 1.3  2004/03/28 21:15:48  arniml
1958
-- implemented mnemonic DA
1959
--
1960 27 arniml
-- Revision 1.2  2004/03/28 13:06:32  arniml
1961
-- implement mnemonics:
1962
--    + MOVD_A_PP
1963
--    + OUTD_PP_A -> ANLD PP, A; MOVD PP, A; ORLD PP, A
1964
--
1965 21 arniml
-- Revision 1.1  2004/03/23 21:31:52  arniml
1966
-- initial check-in
1967 27 arniml
--
1968 4 arniml
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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