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

Subversion Repositories pdp8

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

powered by: WebSVN 2.1.0

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