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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [cpu/] [ir.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 trurl
------------------------------------------------------------------
2
--!
3
--! PDP-8 Processor
4
--!
5
--! \brief
6
--!      CPU Instruction Register (IR)
7
--!
8
--! \details
9
--!      The Instruction Register (IR) contains the opcode of the
10
--!      current instruction.
11
--!
12
--! \note
13
--!      The IR implementation is mostly a waste of a state.  A
14
--!      state in the state machine could be saved by just
15
--!      decoding the content of the MD register after an
16
--!      instruction fetch.
17
--!
18
--! \file
19
--!      ir.vhd
20
--!
21
--! \author
22
--!      Rob Doyle - doyle (at) cox (dot) net
23
--!
24
--------------------------------------------------------------------
25
--
26
--  Copyright (C) 2009, 2010, 2011 Rob Doyle
27
--
28
-- This source file may be used and distributed without
29
-- restriction provided that this copyright statement is not
30
-- removed from the file and that any derivative work contains
31
-- the original copyright notice and the associated disclaimer.
32
--
33
-- This source file is free software; you can redistribute it
34
-- and/or modify it under the terms of the GNU Lesser General
35
-- Public License as published by the Free Software Foundation;
36
-- version 2.1 of the License.
37
--
38
-- This source is distributed in the hope that it will be
39
-- useful, but WITHOUT ANY WARRANTY; without even the implied
40
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
41
-- PURPOSE. See the GNU Lesser General Public License for more
42
-- details.
43
--
44
-- You should have received a copy of the GNU Lesser General
45
-- Public License along with this source; if not, download it
46
-- from http://www.gnu.org/licenses/lgpl.txt
47
--
48
--------------------------------------------------------------------
49
--
50
-- Comments are formatted for doxygen
51
--
52
 
53
library ieee;                                   --! IEEE Library
54
use ieee.std_logic_1164.all;                    --! IEEE 1164
55
use work.cpu_types.all;                         --! Types
56
 
57
--
58
--! CPU Instruction Register (IR) Entity
59
--
60
 
61
entity eIR is port (
62
    sys   : in  sys_t;                          --! Clock/Reset
63
    irOP  : in  irOP_t;                         --! IR Operation
64
    MD    : in  data_t;                         --! MD Input
65
    IR    : out data_t                          --! IR Output
66
);
67
end eIR;
68
 
69
--
70
--! CPU Instruction Register (IR) RTL
71
--
72
 
73
architecture rtl of eIR is
74
 
75
    signal irREG : data_t;                      -- Instruction Register
76
    signal irMUX : data_t;                      -- Instruction Register MUX
77
 
78
begin
79
 
80
    --
81
    -- IR Multiplexer
82
    --
83
 
84
    with irOP select
85
        irMUX <= irREG when iropNOP,
86
                 MD    when iropMD;
87
 
88
    --
89
    --! IR Register
90
    --
91
 
92
    REG_IR : process(sys)
93
    begin
94
        if sys.rst = '1' then
95
            irREG <= (others => '0');
96
        elsif rising_edge(sys.clk) then
97
            irREG <= irMUX;
98
        end if;
99
    end process REG_IR;
100
 
101
    IR <= irREG;
102
 
103
end rtl;

powered by: WebSVN 2.1.0

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