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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [cpu/] [sr.vhd] - Blame information for rev 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 trurl
 --------------------------------------------------------------------
2
--!
3
--! PDP-8 Processor
4
--!
5
--! \brief
6
--!      CPU Switch Register (SR)
7
--!
8
--! \details
9
--!      This supports the notion of a virtualized Switch Register.
10
--!      When in HD-6120 mode, the Panel Mode can write to the
11
--!      Switch register using the WSR IOT - this allows Panel
12
--!      Mode to virualize the Switch Register using a software
13
--!      command.
14
--!
15
--! \file
16
--!      sr.vhd
17
--!
18
--! \author
19
--!      Rob Doyle - doyle (at) cox (dot) net
20
--!
21
--------------------------------------------------------------------
22
--
23
--  Copyright (C) 2009, 2010, 2011, 2012 Rob Doyle
24
--
25
-- This source file may be used and distributed without
26
-- restriction provided that this copyright statement is not
27
-- removed from the file and that any derivative work contains
28
-- the original copyright notice and the associated disclaimer.
29
--
30
-- This source file is free software; you can redistribute it
31
-- and/or modify it under the terms of the GNU Lesser General
32
-- Public License as published by the Free Software Foundation;
33
-- version 2.1 of the License.
34
--
35
-- This source is distributed in the hope that it will be
36
-- useful, but WITHOUT ANY WARRANTY; without even the implied
37
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
38
-- PURPOSE. See the GNU Lesser General Public License for more
39
-- details.
40
--
41
-- You should have received a copy of the GNU Lesser General
42
-- Public License along with this source; if not, download it
43
-- from http://www.gnu.org/licenses/lgpl.txt
44
--
45
--------------------------------------------------------------------
46
--
47
-- Comments are formatted for doxygen
48
--
49
 
50
library ieee;                                   --! IEEE Library
51
use ieee.std_logic_1164.all;                    --! IEEE 1164
52
use work.cpu_types.all;                         --! Types
53
 
54
--
55
--! CPU Switch Register (SR) Entity
56
--
57
 
58
entity eSR is port (
59
    sys   : in  sys_t;                          --! Clock/Reset
60
    swCPU : in  swCPU_t;                        --! CPU Configuration
61
    srOP  : in  srOP_t;                         --! SR Operation
62
    AC    : in  data_t;                         --! AC Register
63
    SRD   : in  data_t;                         --! Switch Data In
64
    SR    : out data_t                          --! Switch Register Out
65
);
66
end eSR;
67
 
68
--
69
--! CPU Switch Register (SR) RTL
70
--
71
 
72
architecture rtl of eSR is
73
 
74
    signal srREG : data_t;                      --! Switch Register
75
    signal srMUX : data_t;                      --! Switch Register Multiplexer
76
 
77
begin
78
 
79
    --
80
    -- SR Multiplexer
81
    --
82
 
83
    with srOP select
84
        srMUX <= srREG when sropNOP,
85
                 AC    when sropAC;
86
 
87
    --
88
    --! SR Register
89
    --
90
 
91
    REG_SR : process(sys)
92
    begin
93
        if sys.rst = '1' then
94
            srREG <= (others => '0');
95
        elsif rising_edge(sys.clk) then
96
            if swCPU = swHD6120 then
97
                srREG <= srMUX;
98
            else
99
                srREG <= SRD;
100
            end if;
101
        end if;
102
    end process REG_SR;
103
 
104
    SR <= srREG;
105
 
106
end rtl;

powered by: WebSVN 2.1.0

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