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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_4_beta/] [rtl/] [vhdl/] [decoder.vhd] - Blame information for rev 120

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

powered by: WebSVN 2.1.0

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