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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [cpu/] [usrtrp.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 User Mode Trap (USRTRP) Register
7
--!
8
--! \details
9
--!      The User Mode Trap is used with the KM8E Time Sharing.
10
--!
11
--!      When the User Flag (UF) is set and KM8E Time Sharing is
12
--!      enabled, all IOTs, the HLT instruction, and Switch
13
--!      Register input instructions are virtualized by trapping
14
--!      to a User Mode Interrupt.
15
--!
16
--!      The User Mode Trap (USRTRP) register is asserted under
17
--!      the following conditions:
18
--!      -# the User Flag (UF) set and KM8E TSS enabled and any
19
--!         IOT Instruction executed, or
20
--!      -# the User Flag (UF) set and KM8E TSS enabled and HLT
21
--!         Instruction executed, or
22
--!      -# the User Flag (UF) set and KM8E TSS enabled and Switch
23
--!         Register Instruction (either OSR or LAS) executed.
24
--!
25
--!      The User Mode Trap (USRTRP) register is negated under
26
--!      the following conditions:
27
--!      -# the front panel Clear Switch asserted, or
28
--!      -# the Clear All Flags (CAF) instruction is executed, or
29
--!      -# the Clear User Interrupt Flag (CINT) instruction is
30
--!         executed.
31
--!
32
--! \file
33
--!      usrtrp.vhd
34
--!
35
--! \author
36
--!      Rob Doyle - doyle (at) cox (dot) net
37
--!
38
--------------------------------------------------------------------
39
--
40
--  Copyright (C) 2009, 2010, 2011 Rob Doyle
41
--
42
-- This source file may be used and distributed without
43
-- restriction provided that this copyright statement is not
44
-- removed from the file and that any derivative work contains
45
-- the original copyright notice and the associated disclaimer.
46
--
47
-- This source file is free software; you can redistribute it
48
-- and/or modify it under the terms of the GNU Lesser General
49
-- Public License as published by the Free Software Foundation;
50
-- version 2.1 of the License.
51
--
52
-- This source is distributed in the hope that it will be
53
-- useful, but WITHOUT ANY WARRANTY; without even the implied
54
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
55
-- PURPOSE. See the GNU Lesser General Public License for more
56
-- details.
57
--
58
-- You should have received a copy of the GNU Lesser General
59
-- Public License along with this source; if not, download it
60
-- from http://www.gnu.org/licenses/lgpl.txt
61
--
62
--------------------------------------------------------------------
63
--
64
-- Comments are formatted for doxygen
65
--
66
 
67
library ieee;                                   --! IEEE Library
68
use ieee.std_logic_1164.all;                    --! IEEE 1164
69
use work.cpu_types.all;                         --! Types
70
 
71
--
72
--! CPU User Mode Trap (USRTRP) Register Entity
73
--
74
 
75
entity eUSRTRP is port (
76
    sys      : in  sys_t;                       --! Clock/Reset
77
    usrtrpOP : in  usrtrpOP_t;                  --! USRTRP Operation
78
    USRTRP   : out std_logic                    --! USRTRP Output
79
);
80
end eUSRTRP;
81
 
82
--
83
--! CPU User Mode Trap (USRTRP) Register RTL
84
--
85
 
86
architecture rtl of eUSRTRP is
87
 
88
    signal usrtrpREG : std_logic;               --! USRTRP Flag
89
    signal usrtrpMUX : std_logic;               --! USRTRP Flag Multiplexer
90
 
91
begin
92
 
93
    --
94
    -- USRTRP Multiplexer
95
    --
96
 
97
    with usrtrpOP select
98
        usrtrpMUX <= usrtrpREG when usrtrpopNOP,
99
                     '0'       when usrtrpopCLR,
100
                     '1'       when usrtrpopSET;
101
 
102
    --
103
    --! USRTRP Register
104
    --
105
 
106
    REG_USRTRP : process(sys)
107
    begin
108
        if sys.rst = '1' then
109
            usrtrpREG <= '0';
110
        elsif rising_edge(sys.clk) then
111
            usrtrpREG <= usrtrpMUX;
112
        end if;
113
    end process REG_USRTRP;
114
 
115
    USRTRP <= usrtrpREG;
116
 
117
end rtl;

powered by: WebSVN 2.1.0

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