w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
pdp11_reg70.vhd
Go to the documentation of this file.
1-- $Id: pdp11_reg70.vhd 1279 2022-08-14 08:02:21Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2008-2022 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: pdp11_reg70 - syn
7-- Description: pdp11: 11/70 system registers
8--
9-- Dependencies: -
10-- Test bench: tb/tb_pdp11_core (implicit)
11-- Target Devices: generic
12-- Tool versions: ise 8.2-14.7; viv 2014.4-2022.1; ghdl 0.18-2.0.0
13--
14-- Revision History:
15-- Date Rev Version Comment
16-- 2022-08-14 1279 1.1.3 set sysid to 010123
17-- 2015-04-30 670 1.1.2 rename sys70 -> reg70
18-- 2011-11-18 427 1.1.1 now numeric_std clean
19-- 2010-10-17 333 1.1 use ibus V2 interface
20-- 2008-08-22 161 1.0.1 use iblib
21-- 2008-04-20 137 1.0 Initial version
22------------------------------------------------------------------------------
23
24library ieee;
25use ieee.std_logic_1164.all;
26use ieee.numeric_std.all;
27
28use work.slvtypes.all;
29use work.pdp11.all;
30use work.iblib.all;
31
32-- ----------------------------------------------------------------------------
33
34entity pdp11_reg70 is -- 11/70 memory system registers
35 port (
36 CLK : in slbit; -- clock
37 CRESET : in slbit; -- cpu reset
38 IB_MREQ : in ib_mreq_type; -- ibus request
39 IB_SRES : out ib_sres_type -- ibus response
40 );
41end pdp11_reg70;
42
43architecture syn of pdp11_reg70 is
44
45 constant ibaddr_mbrk : slv16 := slv(to_unsigned(8#177770#,16));
46 constant ibaddr_sysid : slv16 := slv(to_unsigned(8#177764#,16));
47
48 type regs_type is record -- state registers
49 ibsel_mbrk : slbit; -- ibus select mbrk
50 ibsel_sysid : slbit; -- ibus select sysid
51 mbrk : slv8; -- status of mbrk register
52 end record regs_type;
53
54 constant regs_init : regs_type := (
55 '0','0', -- ibsel_*
56 mbrk=>(others=>'0') -- mbrk
57 );
58
61
62begin
63
64 proc_regs: process (CLK)
65 begin
66 if rising_edge(CLK) then
67 if CRESET = '1' then
69 else
70 R_REGS <= N_REGS;
71 end if;
72 end if;
73 end process proc_regs;
74
75 proc_next: process (R_REGS, IB_MREQ)
76 variable r : regs_type := regs_init;
77 variable n : regs_type := regs_init;
78 variable idout : slv16 := (others=>'0');
79 variable ibreq : slbit := '0';
80 variable ibw0 : slbit := '0';
81 begin
82
83 r := R_REGS;
84 n := R_REGS;
85
86 idout := (others=>'0');
87 ibreq := IB_MREQ.re or IB_MREQ.we;
88 ibw0 := IB_MREQ.we and IB_MREQ.be0;
89
90 -- ibus address decoder
91 n.ibsel_mbrk := '0';
92 n.ibsel_sysid := '0';
93 if IB_MREQ.aval = '1' then
94 if IB_MREQ.addr = ibaddr_mbrk(12 downto 1) then
95 n.ibsel_mbrk := '1';
96 end if;
97 if IB_MREQ.addr = ibaddr_sysid(12 downto 1) then
98 n.ibsel_sysid := '1';
99 end if;
100 end if;
101
102 -- ibus transactions
103 if r.ibsel_mbrk = '1' then
104 idout(r.mbrk'range) := r.mbrk;
105 end if;
106 if r.ibsel_sysid = '1' then
107 idout := slv(to_unsigned(8#010123#,16));
108 end if;
109
110 if r.ibsel_mbrk='1' and ibw0='1' then
111 n.mbrk := IB_MREQ.din(n.mbrk'range);
112 end if;
113
114 N_REGS <= n;
115
116 IB_SRES.dout <= idout;
117 IB_SRES.ack <= (r.ibsel_mbrk or r.ibsel_sysid) and ibreq;
118 IB_SRES.busy <= '0';
119
120 end process proc_next;
121
122end syn;
Definition: iblib.vhd:33
regs_type := regs_init N_REGS
Definition: pdp11_reg70.vhd:60
slv16 := slv( to_unsigned( 8#177764#, 16) ) ibaddr_sysid
Definition: pdp11_reg70.vhd:46
regs_type := regs_init R_REGS
Definition: pdp11_reg70.vhd:59
slv16 := slv( to_unsigned( 8#177770#, 16) ) ibaddr_mbrk
Definition: pdp11_reg70.vhd:45
regs_type :=( '0', '0', mbrk=>( others => '0')) regs_init
Definition: pdp11_reg70.vhd:54
in CLK slbit
Definition: pdp11_reg70.vhd:36
in CRESET slbit
Definition: pdp11_reg70.vhd:37
in IB_MREQ ib_mreq_type
Definition: pdp11_reg70.vhd:38
out IB_SRES ib_sres_type
Definition: pdp11_reg70.vhd:40
Definition: pdp11.vhd:123
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
std_logic_vector slv
Definition: slvtypes.vhd:31