w11 - vhd 0.791
W11 CPU core and support modules
pdp11_mmu_ssr12.vhd
Go to the documentation of this file.
1-- $Id: pdp11_mmu_ssr12.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2006-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: pdp11_mmu_ssr12 - syn
7-- Description: pdp11: mmu register ssr1 and ssr2
8--
9-- Dependencies: ib_sel
10-- Test bench: tb/tb_pdp11_core (implicit)
11-- Target Devices: generic
12-- Tool versions: ise 8.2-14.7; viv 2014.4; ghdl 0.18-0.31
13--
14-- Revision History:
15-- Date Rev Version Comment
16-- 2011-11-18 427 1.2.2 now numeric_std clean
17-- 2010-10-23 335 1.2.1 use ib_sel
18-- 2010-10-17 333 1.2 use ibus V2 interface
19-- 2009-05-30 220 1.1.4 final removal of snoopers (were already commented)
20-- 2008-08-22 161 1.1.3 rename ubf_ -> ibf_; use iblib
21-- 2008-03-02 121 1.1.2 remove snoopers
22-- 2008-01-05 110 1.1.1 rename IB_MREQ(ena->req) SRES(sel->ack, hold->busy)
23-- 2007-12-30 107 1.1 use IB_MREQ/IB_SRES interface now
24-- 2007-06-14 56 1.0.1 Use slvtypes.all
25-- 2007-05-12 26 1.0 Initial version
26------------------------------------------------------------------------------
27
28library ieee;
29use ieee.std_logic_1164.all;
30use ieee.numeric_std.all;
31
32use work.slvtypes.all;
33use work.iblib.all;
34use work.pdp11.all;
35
36-- ----------------------------------------------------------------------------
37
38entity pdp11_mmu_ssr12 is -- mmu register ssr1 and ssr2
39 port (
40 CLK : in slbit; -- clock
41 CRESET : in slbit; -- cpu reset
42 TRACE : in slbit; -- trace enable
43 MONI : in mmu_moni_type; -- MMU monitor port data
44 IB_MREQ : in ib_mreq_type; -- ibus request
45 IB_SRES : out ib_sres_type -- ibus response
46 );
48
49architecture syn of pdp11_mmu_ssr12 is
50
51 constant ibaddr_ssr1 : slv16 := slv(to_unsigned(8#177574#,16));
52 constant ibaddr_ssr2 : slv16 := slv(to_unsigned(8#177576#,16));
53
54 subtype ssr1_ibf_rb_delta is integer range 15 downto 11;
55 subtype ssr1_ibf_rb_num is integer range 10 downto 8;
56 subtype ssr1_ibf_ra_delta is integer range 7 downto 3;
57 subtype ssr1_ibf_ra_num is integer range 2 downto 0;
58
59 signal IBSEL_SSR1 : slbit := '0';
60 signal IBSEL_SSR2 : slbit := '0';
61 signal R_SSR1 : mmu_ssr1_type := mmu_ssr1_init;
62 signal R_SSR2 : slv16 := (others=>'0');
63 signal N_SSR1 : mmu_ssr1_type := mmu_ssr1_init;
64 signal N_SSR2 : slv16 := (others=>'0');
65
66begin
67
68 SEL_SSR1 : ib_sel
69 generic map (
71 port map (
72 CLK => CLK,
75 );
76 SEL_SSR2 : ib_sel
77 generic map (
79 port map (
80 CLK => CLK,
83 );
84
85 proc_ibres : process (IBSEL_SSR1, IBSEL_SSR2, IB_MREQ, R_SSR1, R_SSR2)
86 variable ssr1out : slv16 := (others=>'0');
87 variable ssr2out : slv16 := (others=>'0');
88 begin
89
90 ssr1out := (others=>'0');
91 if IBSEL_SSR1 = '1' then
92 ssr1out(ssr1_ibf_rb_delta) := R_SSR1.rb_delta;
93 ssr1out(ssr1_ibf_rb_num) := R_SSR1.rb_num;
94 ssr1out(ssr1_ibf_ra_delta) := R_SSR1.ra_delta;
95 ssr1out(ssr1_ibf_ra_num) := R_SSR1.ra_num;
96 end if;
97
98 ssr2out := (others=>'0');
99 if IBSEL_SSR2 = '1' then
100 ssr2out := R_SSR2;
101 end if;
102
103 IB_SRES.dout <= ssr1out or ssr2out;
104 IB_SRES.ack <= (IBSEL_SSR1 or IBSEL_SSR2) and
105 (IB_MREQ.re or IB_MREQ.we); -- ack all
106 IB_SRES.busy <= '0';
107
108 end process proc_ibres;
109
110 proc_regs : process (CLK)
111 begin
112 if rising_edge(CLK) then
113 R_SSR1 <= N_SSR1;
114 R_SSR2 <= N_SSR2;
115 end if;
116 end process proc_regs;
117
118 proc_comb : process (CRESET, IBSEL_SSR1, IB_MREQ,
120
121 variable nssr1 : mmu_ssr1_type := mmu_ssr1_init;
122 variable nssr2 : slv16 := (others=>'0');
123 variable delta : slv5 := (others=>'0');
124 variable use_rb : slbit := '0';
125
126 begin
127
128 nssr1 := R_SSR1;
129 nssr2 := R_SSR2;
130 delta := "0" & MONI.delta;
131
132 use_rb := '0';
133 if MONI.regnum/=nssr1.ra_num and unsigned(nssr1.ra_delta)/=0 then
134 use_rb := '1';
135 end if;
136
137 if CRESET = '1' then
138 nssr1 := mmu_ssr1_init;
139 nssr2 := (others=>'0');
140
141 elsif IBSEL_SSR1='1' and IB_MREQ.we='1' then
142
143 if IB_MREQ.be1 = '1' then
144 nssr1.rb_delta := IB_MREQ.din(ssr1_ibf_rb_delta);
145 nssr1.rb_num := IB_MREQ.din(ssr1_ibf_rb_num);
146 end if;
147 if IB_MREQ.be0 = '1' then
148 nssr1.ra_delta := IB_MREQ.din(ssr1_ibf_ra_delta);
149 nssr1.ra_num := IB_MREQ.din(ssr1_ibf_ra_num);
150 end if;
151
152 elsif TRACE = '1' then
153
154 if MONI.istart = '1' then
155 nssr1 := mmu_ssr1_init;
156 nssr2 := MONI.pc;
157
158 elsif MONI.regmod = '1' then
159 if use_rb = '0' then
160 nssr1.ra_num := MONI.regnum;
161 if MONI.isdec = '0' then
162 nssr1.ra_delta := slv(signed(nssr1.ra_delta) + signed(delta));
163 else
164 nssr1.ra_delta := slv(signed(nssr1.ra_delta) - signed(delta));
165 end if;
166 else
167 nssr1.rb_num := MONI.regnum;
168 if MONI.isdec = '0' then
169 nssr1.rb_delta := slv(signed(nssr1.rb_delta) + signed(delta));
170 else
171 nssr1.rb_delta := slv(signed(nssr1.rb_delta) - signed(delta));
172 end if;
173 end if;
174 end if;
175
176 end if;
177
178 N_SSR1 <= nssr1;
179 N_SSR2 <= nssr2;
180
181 end process proc_comb;
182
183end syn;
out SEL slbit
Definition: ib_sel.vhd:35
IB_ADDR slv16
Definition: ib_sel.vhd:29
in CLK slbit
Definition: ib_sel.vhd:32
in IB_MREQ ib_mreq_type
Definition: ib_sel.vhd:33
Definition: iblib.vhd:33
integer range 15 downto 11 ssr1_ibf_rb_delta
slv16 :=( others => '0') R_SSR2
integer range 7 downto 3 ssr1_ibf_ra_delta
slbit := '0' IBSEL_SSR2
mmu_ssr1_type := mmu_ssr1_init R_SSR1
slv16 := slv( to_unsigned( 8#177576#, 16) ) ibaddr_ssr2
slv16 :=( others => '0') N_SSR2
integer range 2 downto 0 ssr1_ibf_ra_num
slv16 := slv( to_unsigned( 8#177574#, 16) ) ibaddr_ssr1
slbit := '0' IBSEL_SSR1
integer range 10 downto 8 ssr1_ibf_rb_num
mmu_ssr1_type := mmu_ssr1_init N_SSR1
in MONI mmu_moni_type
in IB_MREQ ib_mreq_type
out IB_SRES ib_sres_type
Definition: pdp11.vhd:106
std_logic_vector( 4 downto 0) slv5
Definition: slvtypes.vhd:37
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector slv
Definition: slvtypes.vhd:31