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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [cpu/] [gtf.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 Greater Than Flag (GTF) Register
7
--!
8
--! \details
9
--!      The Greater Than Flag has several uses.
10
--!
11
--!      The GTF Register is modified under the following
12
--!      conditions:
13
--!      -# the GTF Register is set to 0 when the CLEAR switch
14
--!         on the Front Panel is asserted, and
15
--!      -# the GTF Register is set to 0 when the Clear All Flags
16
--!         (CAF) instruction is executed, and
17
--!      -# the GTF Register is set to 0 when EAE Mode B and the
18
--!         Switch from B to A (SWBA) instruction is executed, and
19
--!      -# the GTF Register is set to 0 when EAE Mode A before
20
--!         any EAE Mode A instruction is executed, and
21
--!      -# the GTF Register is set to 0 when the Clear All Flags
22
--!         (CAF) instruction is executed, and
23
--!      -# the GTF Register set to the contents of the AC(1)
24
--!         when executing a Restore Flags (RTF) instruction, and
25
--!      -# the GTF Register set if signed(MQ) >= signed(AC),
26
--!         otherwise cleared after executing a Subtract AC
27
--!         from MQ (SAM) instruction, and
28
--!      -# the GTF Register is set in EAE Mode B if a '1'
29
--!         is shifted out of the LSB during a Arithmetic
30
--!         Shift Right (ASR) instruction.
31
--!      -# the GTF Register is set in EAE Mode B if a '1'
32
--!         is shifted out of the LSB during a Logical
33
--!         Shift Right (LSR) instruction.
34
--! 
35
--! \file
36
--!      gtf.vhd
37
--!
38
--! \author
39
--!      Rob Doyle - doyle (at) cox (dot) net
40
--!
41
--------------------------------------------------------------------
42
--
43
--  Copyright (C) 2009 Rob Doyle
44
--
45
-- This source file may be used and distributed without
46
-- restriction provided that this copyright statement is not
47
-- removed from the file and that any derivative work contains
48
-- the original copyright notice and the associated disclaimer.
49
--
50
-- This source file is free software; you can redistribute it
51
-- and/or modify it under the terms of the GNU Lesser General
52
-- Public License as published by the Free Software Foundation;
53
-- version 2.1 of the License.
54
--
55
-- This source is distributed in the hope that it will be
56
-- useful, but WITHOUT ANY WARRANTY; without even the implied
57
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
58
-- PURPOSE. See the GNU Lesser General Public License for more
59
-- details.
60
--
61
-- You should have received a copy of the GNU Lesser General
62
-- Public License along with this source; if not, download it
63
-- from http://www.gnu.org/licenses/lgpl.txt
64
--
65
--------------------------------------------------------------------
66
--
67
-- Comments are formatted for doxygen
68
--
69
 
70
library ieee;                                   --! IEEE Library
71
use ieee.std_logic_1164.all;                    --! IEEE 1164
72
use work.cpu_types.all;                         --! Types
73
 
74
--
75
--! CPU Greater Than Flag (GTF) Register Entity
76
--
77
 
78
entity eGTF is port (
79
    sys   : in  sys_t;                          --! Clock/Reset
80
    gtfOP : in  gtfOP_t;                        --! GTF Operation
81
    AC    : in  data_t;                         --! AC Register
82
    GTF   : out std_logic                       --! GTF Output
83
);
84
end eGTF;
85
 
86
--
87
--! CPU Greater Than Flag (GTF) Register RTL
88
--
89
 
90
architecture rtl of eGTF is
91
 
92
    signal gtfREG : std_logic;                  -- Greater Than Flag
93
    signal gtfMUX : std_logic;                  -- Greater Than Flag Multiplexer
94
 
95
begin
96
 
97
    --
98
    -- GTF Multiplexer
99
    --
100
 
101
    with gtfOP select
102
        gtfMUX <= gtfREG when gtfopNOP,
103
                  '0'    when gtfopCLR,
104
                  '1'    when gtfopSET,
105
                  AC(1)  when gtfopAC1;
106
 
107
    --
108
    --! GTF Register
109
    --
110
 
111
    REG_GTF : process(sys)
112
    begin
113
        if sys.rst = '1' then
114
            gtfREG <= '0';
115
        elsif rising_edge(sys.clk) then
116
            gtfREG <= gtfMUX;
117
        end if;
118
    end process REG_GTF;
119
 
120
    GTF <= gtfREG;
121
 
122
end rtl;

powered by: WebSVN 2.1.0

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