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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [pdp8.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 trurl
--!
2
--! PDP-8 Processor
3
--!
4
--! \brief
5
--!      PDP-8 System
6
--!
7
--! \details
8
--!      
9
--!
10
--! \file
11
--!      pdp8.vhd
12
--!
13
--! \author
14
--!      Rob Doyle - doyle (at) cox (dot) net
15
--!
16
--------------------------------------------------------------------
17
--
18
--  Copyright (C) 2009, 2010, 2011, 2012 Rob Doyle
19
--
20
-- This source file may be used and distributed without
21
-- restriction provided that this copyright statement is not
22
-- removed from the file and that any derivative work contains
23
-- the original copyright notice and the associated disclaimer.
24
--
25
-- This source file is free software; you can redistribute it
26
-- and/or modify it under the terms of the GNU Lesser General
27
-- Public License as published by the Free Software Foundation;
28
-- version 2.1 of the License.
29
--
30
-- This source is distributed in the hope that it will be
31
-- useful, but WITHOUT ANY WARRANTY; without even the implied
32
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
33
-- PURPOSE. See the GNU Lesser General Public License for more
34
-- details.
35
--
36
-- You should have received a copy of the GNU Lesser General
37
-- Public License along with this source; if not, download it
38
-- from http://www.gnu.org/licenses/lgpl.txt
39
--
40
--------------------------------------------------------------------
41
--
42
-- Comments are formatted for doxygen
43
--
44
 
45
library ieee;                                   --! IEEE Library
46
use ieee.std_logic_1164.all;                    --! IEEE 1164
47
use work.uart_types.all;                        --! UART Types
48
use work.dk8e_types.all;                        --! DK8E Types
49
use work.kc8e_types.all;                        --! KC8E Types
50
use work.kl8e_types.all;                        --! KL8E Types
51
use work.rk8e_types.all;                        --! RK8E Types
52
use work.ls8e_types.all;                        --! LS8E Types
53
use work.pr8e_types.all;                        --! PR8E Types
54
use work.cpu_types.all;                         --! CPU Types
55
 
56
--
57
--! PDP8 System Entity
58
--
59
 
60
entity ePDP8 is port (
61
    -- System
62
    clk        : in  std_logic;                 --! Clock
63
    rst        : in  std_logic;                 --! Reset
64
    -- Configuration
65
    swCPU      : in  swCPU_t;                   --! CPU Configuration
66
    swOPT      : in  swOPT_t;                   --! Configuration Options
67
    -- Real Time Clock
68
    swRTC      : in  swRTC_t;                   --! RTC Configuration
69
    -- TTY1 Interfaces
70
    tty1BR     : in  uartBR_t;                  --! TTY1 Baud Rate
71
    tty1HS     : in  uartHS_t;                  --! TTY1 Handshaking
72
    tty1CTS    : in  std_logic;                 --! TTY1 Clear To Send
73
    tty1RTS    : out std_logic;                 --! TTY1 Request To Send
74
    tty1RXD    : in  std_logic;                 --! TTY1 Receive Data
75
    tty1TXD    : out std_logic;                 --! TTY1 Transmit Data
76
    -- TTY2 Interfaces
77
    tty2BR     : in  uartBR_t;                  --! TTY2 Baud Rate
78
    tty2HS     : in  uartHS_t;                  --! TTY2 Handshaking
79
    tty2CTS    : in  std_logic;                 --! TTY2 Clear To Send
80
    tty2RTS    : out std_logic;                 --! TTY2 Request To Send
81
    tty2RXD    : in  std_logic;                 --! TTY2 Receive Data
82
    tty2TXD    : out std_logic;                 --! TTY2 Transmit Data
83
    -- LPR Interface
84
    lprBR      : in  uartBR_t;                  --! LPR Baud Rate
85
    lprHS      : in  uartHS_t;                  --! LPR Handshaking
86
    lprDTR     : in  std_logic;                 --! LPR Clear To Send
87
    lprDSR     : out std_logic;                 --! LPR Request To Send
88
    lprRXD     : in  std_logic;                 --! LPR Receive Data
89
    lprTXD     : out std_logic;                 --! LPR Transmit Data
90
    -- PTR Interface
91
    ptrBR      : in  uartBR_t;                  --! PTR Baud Rate
92
    ptrHS      : in  uartHS_t;                  --! PTR Handshaking
93
    ptrCTS     : in  std_logic;                 --! PTR Clear To Send
94
    ptrRTS     : out std_logic;                 --! PTR Request To Send
95
    ptrRXD     : in  std_logic;                 --! PTR Receive Data
96
    ptrTXD     : out std_logic;                 --! PTR Transmit Data
97
    -- SD Interface
98
    sdCD       : in  std_logic;                 --! SD Card Detect
99
    sdWP       : in  std_logic;                 --! SD Write Protect
100
    sdMISO     : in  std_logic;                 --! SD Data In
101
    sdMOSI     : out std_logic;                 --! SD Data Out
102
    sdSCLK     : out std_logic;                 --! SD Clock
103
    sdCS       : out std_logic;                 --! SD Chip Select
104
    -- RK8E Status 
105
    rk8eSTAT   : out rk8eSTAT_t;                --! RK8E Status
106
    -- Switches and LEDS
107
    swROT      : in  swROT_t;                   --! Rotary Switch
108
    swDATA     : in  swDATA_t;                  --! Data Switches
109
    swCNTL     : in  swCNTL_t;                  --! Control Switches
110
    ledRUN     : out std_logic;                 --! RUN LED
111
    ledADDR    : out xaddr_t;                   --! Addr LEDS
112
    ledDATA    : out data_t                     --! Data LEDS
113
);
114
end ePDP8;
115
 
116
--
117
--! PDP8 System RTL
118
--
119
 
120
architecture rtl of ePDP8 is
121
 
122
    signal  disk     : sys_t;                   --! Clock/Reset
123
    signal  sys      : sys_t;                   --! Clock/Reset
124
    signal  cpu      : cpu_t;                   --! CPU info
125
    signal  rk8eINIT : std_logic;               --! RK8E is initializing
126
 
127
    --
128
    -- Devices
129
    --
130
 
131
    signal  cpuDEV   : dev_t;                   --! PDP8 Output Device
132
    signal  tty1DEV  : dev_t;                   --! TTY1 DEV
133
    signal  tty2DEV  : dev_t;                   --! TTY2 DEV
134
    signal  lprDEV   : dev_t;                   --! LPR DEV
135
    signal  ptrDEV   : dev_t;                   --! PTR DEV
136
    signal  panelDEV : dev_t;                   --! PANEL DEV
137
    signal  diskDEV  : dev_t;                   --! Disk DEV
138
    signal  ramDEV   : dev_t;                   --! RAM DEV
139
    signal  mmapDEV  : dev_t;                   --! MMAP DEV
140
    signal  postDEV  : dev_t;                   --! POST DEV
141
    signal  romDEV   : dev_t;                   --! ROM DEV
142
    signal  rtcDEV   : dev_t;                   --! RTC DEV
143
    signal  xramDEV  : dev_t;                   --! XRAM DEV
144
 
145
begin
146
 
147
    --
148
    -- Hold CPU in reset while reset asserted and while RK8E is initializing
149
    --
150
 
151
    sys.rst  <= rst or rk8eINIT;
152
    sys.clk  <= clk;
153
 
154
    --
155
    -- Fixup Clocks and Resets
156
    --
157
 
158
    disk.rst <= rst;
159
    disk.clk <= clk;
160
 
161
    --
162
    --! BUSMON (Bus Monitor)
163
    --
164
 
165
    -- synthesis translate_off
166
    iBUSMON : entity work.eBUSMON (rtl) port map (
167
        sys       => sys,
168
        cpu       => cpu
169
    );
170
    -- synthesis translate_on
171
 
172
    --
173
    -- Currently Unused
174
    --
175
 
176
    mmapDEV <= nullDEV;
177
    postDEV <= nullDEV;
178
    romDEV  <= nullDEV;
179
    xramDEV <= nullDEV;
180
    lprDEV  <= nullDEV;
181
    ptrDEV  <= nullDEV;
182
 
183
    --
184
    --! Virtual BUS Mux
185
    --
186
 
187
    iBUSMUX : entity work.eBUSMUX (rtl) port map (
188
        sys       => sys,
189
        cpu       => cpu,
190
        ramDEV    => ramDEV,
191
        diskDEV   => diskDEV,
192
        tty1DEV   => tty1DEV,
193
        tty2DEV   => tty2DEV,
194
        lprDEV    => lprDEV,
195
        ptrDEV    => ptrDEV,
196
        rtcDEV    => rtcDEV,
197
        xramDEV   => xramDEV,
198
        romDEV    => romDEV,
199
        panelDEV  => panelDEV,
200
        postDEV   => postDEV,
201
        mmapDEV   => mmapDEV,
202
        cpuDEV    => cpuDEV
203
    );
204
 
205
    --
206
    --! KL8E: TTY1 Interface
207
    --
208
 
209
    iTTY1 : entity work.eKL8E (rtl) port map (
210
        sys       => sys,
211
        uartBR    => tty1BR,
212
        uartHS    => tty1HS,
213
        devNUM    => tty1devNUM,
214
        cpu       => cpu,
215
        dev       => tty1DEV,
216
        cts       => tty1CTS,
217
        rts       => tty1RTS,
218
        rxd       => tty1RXD,
219
        txd       => tty1TXD
220
    );
221
 
222
    --
223
    --! KL8E: TTY2 Interface
224
    --
225
 
226
    iTTY2 : entity work.eKL8E (rtl) port map (
227
        sys       => sys,
228
        uartBR    => tty2BR,
229
        uartHS    => tty2HS,
230
        devNUM    => tty2devNUM,
231
        cpu       => cpu,
232
        dev       => tty2DEV,
233
        cts       => tty2CTS,
234
        rts       => tty2RTS,
235
        rxd       => tty2RXD,
236
        txd       => tty2TXD
237
    );
238
 
239
    --
240
    --! LS8E: LPR Printer Interface
241
    --
242
 
243
--    iLPR : entity work.eLS8E (rtl) port map (
244
--        sys       => sys,
245
--        uartBR    => lprBR,
246
--        uartHS    => lprHS,
247
--        devNUM    => lprdevNUM,
248
--        cpu       => cpu,
249
--        dev       => lprDEV,
250
--        dtr       => lprDTR,
251
--        dsr       => lprDSR,
252
--        rxd       => lprRXD,
253
--        txd       => lprTXD
254
--    );
255
 
256
    --
257
    --! PR8E: PTR Paper Tape Reader Interface
258
    --
259
 
260
--    iPR8E : entity work.ePR8E (rtl) port map (
261
--        sys       => sys,
262
--        uartBR    => ptrBR,
263
--        uartHS    => ptrHS,
264
--        ptrdevNUM => ptrdevNUM,
265
--        ptpdevNUM => ptpdevNUM,
266
--        cpu       => cpu,
267
--        dev       => ptrDEV,
268
--        cts       => ptrCTS,
269
--        rts       => ptrRTS,
270
--        rxd       => ptrRXD,
271
--        txd       => ptrTXD
272
--    );
273
 
274
    --
275
    --! DK8E: Real Time Clock
276
    --
277
 
278
    iRTC : entity work.eDK8E (rtl) port map (
279
        sys       => sys,
280
        swRTC     => swRTC,
281
        devNUM    => rtcdevNUM,
282
        cpu       => cpu,
283
        dev       => rtcDEV,
284
        schmittIN => ('0', '0', '0'),
285
        clkTRIG   => open
286
    );
287
 
288
    --
289
    --! KC8E: Front Panel
290
    --
291
 
292
    iPANEL : entity work.eKC8E (rtl) port map (
293
        sys       => sys,
294
        cpu       => cpu,
295
        swROT     => swROT,
296
        swDATA    => swDATA,
297
        ledRUN    => ledRUN,
298
        ledADDR   => ledADDR,
299
        ledDATA   => ledDATA,
300
        dev       => panelDev
301
    );
302
 
303
    --
304
    --! CPU
305
    --
306
 
307
    iCPU : entity work.eCPU (rtl) port map (
308
        sys       => sys,
309
        swCPU     => swCPU,
310
        swOPT     => swOPT,
311
        swCNTL    => swCNTL,
312
        swDATA    => swDATA,
313
        dev       => cpuDEV,
314
        cpu       => cpu
315
    );
316
 
317
    --
318
    --! Main Memory : 32K x 12 RAM
319
    -- 
320
 
321
    iRAM : entity work.eMS8C (rtl) port map (
322
        sys       => sys,
323
        cpu       => cpu,
324
        dev       => ramDEV
325
    );
326
 
327
    --
328
    --! RK8E: Disk Interface
329
    --
330
 
331
    iDISK : entity work.eRK8E (rtl) port map (
332
        sys      => disk,
333
        rk05INH  => ('0', '0', '0', '0'),  -- Write Inhibit
334
        rk05MNT  => ('1', '1', '1', '1'),  -- Device Mounted
335
        devNUM   => rk8edevNUM,
336
        cpu      => cpu,
337
        dev      => diskDEV,
338
        sdCD     => sdCD,
339
        sdWP     => sdWP,
340
        sdMISO   => sdMISO,
341
        sdMOSI   => sdMOSI,
342
        sdSCLK   => sdSCLK,
343
        sdCS     => sdCS,
344
        rk8eINIT => rk8eINIT,
345
        rk8eSTAT => rk8eSTAT
346
    );
347
 
348
end rtl;

powered by: WebSVN 2.1.0

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