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

Subversion Repositories pdp8

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

powered by: WebSVN 2.1.0

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