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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [busmon.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
--!      PDP8 Bus Monitor
7
--!
8
--! \details
9
--!      This module watches for invalid bus cycles.
10
--!
11
--! \file
12
--!      busmon.vhd
13
--!
14
--! \author
15
--!      Rob Doyle - doyle (at) cox (dot) net
16
--!
17
--------------------------------------------------------------------
18
--
19
--  Copyright (C) 2010 Rob Doyle
20
--
21
-- This source file may be used and distributed without
22
-- restriction provided that this copyright statement is not
23
-- removed from the file and that any derivative work contains
24
-- the original copyright notice and the associated disclaimer.
25
--
26
-- This source file is free software; you can redistribute it
27
-- and/or modify it under the terms of the GNU Lesser General
28
-- Public License as published by the Free Software Foundation;
29
-- version 2.1 of the License.
30
--
31
-- This source is distributed in the hope that it will be
32
-- useful, but WITHOUT ANY WARRANTY; without even the implied
33
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
34
-- PURPOSE. See the GNU Lesser General Public License for more
35
-- details.
36
--
37
-- You should have received a copy of the GNU Lesser General
38
-- Public License along with this source; if not, download it
39
-- from http://www.gnu.org/licenses/lgpl.txt
40
--
41
--------------------------------------------------------------------
42
--
43
-- Comments are formatted for doxygen
44
--
45
 
46
-- synthesis translate_off
47
 
48
library ieee;                                                   --! IEEE Library
49
use ieee.std_logic_1164.all;                                    --! IEEE 1164
50
use ieee.numeric_std.all;                                       --! IEEE Numeric Standard
51
use work.cpu_types.all;                                         --! Types
52
use STD.TEXTIO.all;
53
 
54
--
55
--! PDP8 Bus Monitor Entity
56
--
57
 
58
entity eBUSMON is port (
59
    sys : in sys_t;                                             --! Clock/Reset
60
    cpu : in cpu_t                                              --! CPU State
61
);
62
end eBUSMON;
63
 
64
--
65
--! PDP8 Bus Monitor RTL
66
--
67
 
68
architecture rtl of eBUSMON is
69
 
70
    --
71
    -- Bus Monitor States
72
    --
73
 
74
    type busState_t is (
75
        busIdle,
76
        busReset,
77
        busInsRdPanelAddr,
78
        busInsRdPanelData,
79
        busInsWrPanelData,
80
        busInsRdMemoryAddr,
81
        busInsRdMemoryData,
82
        busInsWrMemoryData,
83
        busDatRdPanelAddr,
84
        busDatRdPanelData,
85
        busDatWrPanelData,
86
        busDatRdMemoryAddr,
87
        busDatRdMemoryData,
88
        busDatWrMemoryData,
89
        busDatRdIotAddr,
90
        busDatRdIotData,
91
        busDatWrIotData,
92
        busDatRdDMA,
93
        busDatWrDMA,
94
        what1,
95
        what2,
96
        busUnknown
97
    );
98
 
99
    signal busStateMux : busState_t;
100
    signal busStateReg : busState_t;
101
    signal vector      : std_logic_vector(0 to 8);
102
 
103
begin
104
 
105
    --
106
    -- Bus Monitor
107
    -- 
108
 
109
    vector <= cpu.buss.memsel & cpu.buss.ifetch & cpu.buss.dataf &
110
              cpu.buss.lxpar  & cpu.buss.lxmar  & cpu.buss.lxdar &
111
              cpu.buss.rd     & cpu.buss.wr     &
112
              cpu.buss.ioclr;
113
 
114
    with vector select
115
        busStateMux <= busIdle            when b"000_000_00_0",
116
                       busReset           when b"000_000_00_1",
117
                       busInsRdPanelAddr  when b"110_100_00_0",
118
                       busInsRdPanelData  when b"110_100_10_0",
119
                       busInsWrPanelData  when b"110_100_01_0",
120
                       busInsRdMemoryAddr when b"110_010_00_0",
121
                       busInsRdMemoryData when b"110_010_10_0",
122
                       busInsWrMemoryData when b"110_010_01_0",
123
                       busDatRdPanelAddr  when b"101_100_00_0",
124
                       busDatRdPanelData  when b"101_100_10_0",
125
                       busDatWrPanelData  when b"101_100_01_0",
126
                       busDatRdMemoryAddr when b"101_010_00_0",
127
                       busDatRdMemoryData when b"101_010_10_0",
128
                       busDatWrMemoryData when b"101_010_01_0",
129
                       busDatRdIotAddr    when b"001_001_00_0",
130
                       busDatRdIotData    when b"001_001_10_0",
131
                       busDatWrIotData    when b"001_001_01_0",
132
                       busDatRdDMA        when b"100_010_10_0",
133
                       busDatWrDMA        when b"100_010_01_0",
134
                       what1              when b"001_001_00_1",
135
                       what2              when b"100_010_00_0",
136
                       busUnknown         when others;
137
 
138
    --
139
    --! BUS_MON:
140
    --! This process implements a bus monitor.
141
    --
142
 
143
    BUS_MON : process(sys.clk)
144
        file     F : text is out "STD_OUTPUT";
145
        variable L : line;
146
    begin
147
        if rising_edge(sys.clk) then
148
            busStateReg <= busStateMux;
149
            if busStateMux = busUnknown then
150
                write(L, string'("Bus Monitor: Unknown Cycle.  Vector was "));
151
                --write(L, vector);
152
                --assert false report "Unknown bus cycle" severity failure;
153
            end if;
154
        end if;
155
    end process BUS_MON;
156
 
157
end rtl;
158
 
159
-- synthesis translate_on

powered by: WebSVN 2.1.0

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