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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [w11a/] [pdp11_mmu_ssr12.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 wfjm
-- $Id: pdp11_mmu_ssr12.vhd 427 2011-11-19 21:04:11Z mueller $
2 2 wfjm
--
3 13 wfjm
-- Copyright 2006-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 2 wfjm
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
--
14
------------------------------------------------------------------------------
15
-- Module Name:    pdp11_mmu_ssr12 - syn
16
-- Description:    pdp11: mmu register ssr1 and ssr2
17
--
18 8 wfjm
-- Dependencies:   ib_sel
19 2 wfjm
-- Test bench:     tb/tb_pdp11_core (implicit)
20
-- Target Devices: generic
21 13 wfjm
-- Tool versions:  xst 8.2, 9.1, 9.2, 12.1, 13.1; ghdl 0.18-0.29
22 8 wfjm
-- 
23 2 wfjm
-- Revision History: 
24
-- Date         Rev Version  Comment
25 13 wfjm
-- 2011-11-18   427   1.2.2  now numeric_std clean
26 8 wfjm
-- 2010-10-23   335   1.2.1  use ib_sel
27
-- 2010-10-17   333   1.2    use ibus V2 interface
28 2 wfjm
-- 2009-05-30   220   1.1.4  final removal of snoopers (were already commented)
29
-- 2008-08-22   161   1.1.3  rename ubf_ -> ibf_; use iblib
30
-- 2008-03-02   121   1.1.2  remove snoopers
31
-- 2008-01-05   110   1.1.1  rename IB_MREQ(ena->req) SRES(sel->ack, hold->busy)
32
-- 2007-12-30   107   1.1    use IB_MREQ/IB_SRES interface now
33
-- 2007-06-14    56   1.0.1  Use slvtypes.all
34
-- 2007-05-12    26   1.0    Initial version 
35
------------------------------------------------------------------------------
36
 
37
library ieee;
38
use ieee.std_logic_1164.all;
39 13 wfjm
use ieee.numeric_std.all;
40 2 wfjm
 
41
use work.slvtypes.all;
42
use work.iblib.all;
43
use work.pdp11.all;
44
 
45
-- ----------------------------------------------------------------------------
46
 
47
entity pdp11_mmu_ssr12 is               -- mmu register ssr1 and ssr2
48
  port (
49
    CLK : in slbit;                     -- clock
50
    CRESET : in slbit;                  -- console reset
51
    TRACE : in slbit;                   -- trace enable
52
    MONI : in mmu_moni_type;            -- MMU monitor port data
53
    IB_MREQ : in ib_mreq_type;          -- ibus request
54
    IB_SRES : out ib_sres_type          -- ibus response
55
  );
56
end pdp11_mmu_ssr12;
57
 
58
architecture syn of pdp11_mmu_ssr12 is
59
 
60 13 wfjm
  constant ibaddr_ssr1 : slv16 := slv(to_unsigned(8#177574#,16));
61
  constant ibaddr_ssr2 : slv16 := slv(to_unsigned(8#177576#,16));
62 2 wfjm
 
63
  subtype ssr1_ibf_rb_delta is integer range 15 downto 11;
64
  subtype ssr1_ibf_rb_num is integer range 10 downto 8;
65
  subtype ssr1_ibf_ra_delta is integer range 7 downto 3;
66
  subtype ssr1_ibf_ra_num is integer range 2 downto 0;
67
 
68
  signal IBSEL_SSR1 : slbit := '0';
69
  signal IBSEL_SSR2 : slbit := '0';
70
  signal R_SSR1 : mmu_ssr1_type := mmu_ssr1_init;
71
  signal R_SSR2 : slv16 := (others=>'0');
72 8 wfjm
  signal N_SSR1 : mmu_ssr1_type := mmu_ssr1_init;
73
  signal N_SSR2 : slv16 := (others=>'0');
74 2 wfjm
 
75
begin
76
 
77 8 wfjm
  SEL_SSR1 : ib_sel
78
    generic map (
79
      IB_ADDR => ibaddr_ssr1)
80
    port map (
81
      CLK     => CLK,
82
      IB_MREQ => IB_MREQ,
83
      SEL     => IBSEL_SSR1
84
    );
85
  SEL_SSR2 : ib_sel
86
    generic map (
87
      IB_ADDR => ibaddr_ssr2)
88
    port map (
89
      CLK     => CLK,
90
      IB_MREQ => IB_MREQ,
91
      SEL     => IBSEL_SSR2
92
    );
93 2 wfjm
 
94 8 wfjm
  proc_ibres : process (IBSEL_SSR1, IBSEL_SSR2, IB_MREQ, R_SSR1, R_SSR2)
95 2 wfjm
    variable ssr1out : slv16 := (others=>'0');
96
    variable ssr2out : slv16 := (others=>'0');
97
  begin
98
 
99
    ssr1out := (others=>'0');
100
    if IBSEL_SSR1 = '1' then
101
      ssr1out(ssr1_ibf_rb_delta) := R_SSR1.rb_delta;
102
      ssr1out(ssr1_ibf_rb_num)   := R_SSR1.rb_num;
103
      ssr1out(ssr1_ibf_ra_delta) := R_SSR1.ra_delta;
104
      ssr1out(ssr1_ibf_ra_num)   := R_SSR1.ra_num;
105
    end if;
106
 
107
    ssr2out := (others=>'0');
108
    if IBSEL_SSR2 = '1' then
109
      ssr2out := R_SSR2;
110
    end if;
111
 
112
    IB_SRES.dout <= ssr1out or ssr2out;
113 8 wfjm
    IB_SRES.ack  <= (IBSEL_SSR1 or IBSEL_SSR2) and
114
                    (IB_MREQ.re or IB_MREQ.we); -- ack all
115
    IB_SRES.busy <= '0';
116 2 wfjm
 
117 8 wfjm
  end process proc_ibres;
118 2 wfjm
 
119
  proc_regs : process (CLK)
120
  begin
121 13 wfjm
    if rising_edge(CLK) then
122 8 wfjm
      R_SSR1 <= N_SSR1;
123
      R_SSR2 <= N_SSR2;
124 2 wfjm
    end if;
125
  end process proc_regs;
126
 
127
  proc_comb : process (CRESET, IBSEL_SSR1, IB_MREQ,
128
                       R_SSR1, R_SSR2, TRACE, MONI)
129
 
130
    variable nssr1 : mmu_ssr1_type := mmu_ssr1_init;
131
    variable nssr2 : slv16 := (others=>'0');
132
    variable delta : slv5 := (others=>'0');
133
    variable use_rb : slbit := '0';
134
 
135
  begin
136
 
137
    nssr1 := R_SSR1;
138
    nssr2 := R_SSR2;
139
    delta := "0" & MONI.delta;
140
 
141
    use_rb := '0';
142
    if MONI.regnum/=nssr1.ra_num and unsigned(nssr1.ra_delta)/=0 then
143
      use_rb := '1';
144
    end if;
145
 
146
    if CRESET = '1' then
147
      nssr1 := mmu_ssr1_init;
148
      nssr2 := (others=>'0');
149
 
150
    elsif IBSEL_SSR1='1' and IB_MREQ.we='1' then
151
 
152
      if IB_MREQ.be1 = '1' then
153
        nssr1.rb_delta := IB_MREQ.din(ssr1_ibf_rb_delta);
154
        nssr1.rb_num   := IB_MREQ.din(ssr1_ibf_rb_num);
155
      end if;
156
      if IB_MREQ.be0 = '1' then
157
        nssr1.ra_delta := IB_MREQ.din(ssr1_ibf_ra_delta);
158
        nssr1.ra_num   := IB_MREQ.din(ssr1_ibf_ra_num);
159
      end if;
160
 
161
    elsif TRACE = '1' then
162
 
163
      if MONI.istart = '1' then
164
        nssr1 := mmu_ssr1_init;
165
        nssr2 := MONI.pc;
166
 
167
      elsif MONI.regmod = '1' then
168
        if use_rb = '0' then
169
          nssr1.ra_num := MONI.regnum;
170
          if MONI.isdec = '0' then
171 13 wfjm
            nssr1.ra_delta := slv(signed(nssr1.ra_delta) + signed(delta));
172 2 wfjm
          else
173 13 wfjm
            nssr1.ra_delta := slv(signed(nssr1.ra_delta) - signed(delta));
174 2 wfjm
          end if;
175
        else
176
          nssr1.rb_num := MONI.regnum;
177
          if MONI.isdec = '0' then
178 13 wfjm
            nssr1.rb_delta := slv(signed(nssr1.rb_delta) + signed(delta));
179 2 wfjm
          else
180 13 wfjm
            nssr1.rb_delta := slv(signed(nssr1.rb_delta) - signed(delta));
181 2 wfjm
          end if;
182
        end if;
183
      end if;
184
 
185
    end if;
186
 
187 8 wfjm
    N_SSR1 <= nssr1;
188
    N_SSR2 <= nssr2;
189 2 wfjm
 
190
  end process proc_comb;
191
 
192
end syn;

powered by: WebSVN 2.1.0

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