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 8

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 wfjm
-- $Id: pdp11_mmu_ssr12.vhd 335 2010-10-24 22:24:23Z mueller $
2 2 wfjm
--
3 8 wfjm
-- Copyright 2006-2010 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 8 wfjm
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2, 12.1; ghdl 0.18-0.29
22
-- 
23 2 wfjm
-- Revision History: 
24
-- Date         Rev Version  Comment
25 8 wfjm
-- 2010-10-23   335   1.2.1  use ib_sel
26
-- 2010-10-17   333   1.2    use ibus V2 interface
27 2 wfjm
-- 2009-05-30   220   1.1.4  final removal of snoopers (were already commented)
28
-- 2008-08-22   161   1.1.3  rename ubf_ -> ibf_; use iblib
29
-- 2008-03-02   121   1.1.2  remove snoopers
30
-- 2008-01-05   110   1.1.1  rename IB_MREQ(ena->req) SRES(sel->ack, hold->busy)
31
-- 2007-12-30   107   1.1    use IB_MREQ/IB_SRES interface now
32
-- 2007-06-14    56   1.0.1  Use slvtypes.all
33
-- 2007-05-12    26   1.0    Initial version 
34
------------------------------------------------------------------------------
35
 
36
library ieee;
37
use ieee.std_logic_1164.all;
38
use ieee.std_logic_arith.all;
39
 
40
use work.slvtypes.all;
41
use work.iblib.all;
42
use work.pdp11.all;
43
 
44
-- ----------------------------------------------------------------------------
45
 
46
entity pdp11_mmu_ssr12 is               -- mmu register ssr1 and ssr2
47
  port (
48
    CLK : in slbit;                     -- clock
49
    CRESET : in slbit;                  -- console reset
50
    TRACE : in slbit;                   -- trace enable
51
    MONI : in mmu_moni_type;            -- MMU monitor port data
52
    IB_MREQ : in ib_mreq_type;          -- ibus request
53
    IB_SRES : out ib_sres_type          -- ibus response
54
  );
55
end pdp11_mmu_ssr12;
56
 
57
architecture syn of pdp11_mmu_ssr12 is
58
 
59
  constant ibaddr_ssr1 : slv16 := conv_std_logic_vector(8#177574#,16);
60
  constant ibaddr_ssr2 : slv16 := conv_std_logic_vector(8#177576#,16);
61
 
62
  subtype ssr1_ibf_rb_delta is integer range 15 downto 11;
63
  subtype ssr1_ibf_rb_num is integer range 10 downto 8;
64
  subtype ssr1_ibf_ra_delta is integer range 7 downto 3;
65
  subtype ssr1_ibf_ra_num is integer range 2 downto 0;
66
 
67
  signal IBSEL_SSR1 : slbit := '0';
68
  signal IBSEL_SSR2 : slbit := '0';
69
  signal R_SSR1 : mmu_ssr1_type := mmu_ssr1_init;
70
  signal R_SSR2 : slv16 := (others=>'0');
71 8 wfjm
  signal N_SSR1 : mmu_ssr1_type := mmu_ssr1_init;
72
  signal N_SSR2 : slv16 := (others=>'0');
73 2 wfjm
 
74
begin
75
 
76 8 wfjm
  SEL_SSR1 : ib_sel
77
    generic map (
78
      IB_ADDR => ibaddr_ssr1)
79
    port map (
80
      CLK     => CLK,
81
      IB_MREQ => IB_MREQ,
82
      SEL     => IBSEL_SSR1
83
    );
84
  SEL_SSR2 : ib_sel
85
    generic map (
86
      IB_ADDR => ibaddr_ssr2)
87
    port map (
88
      CLK     => CLK,
89
      IB_MREQ => IB_MREQ,
90
      SEL     => IBSEL_SSR2
91
    );
92 2 wfjm
 
93 8 wfjm
  proc_ibres : process (IBSEL_SSR1, IBSEL_SSR2, IB_MREQ, R_SSR1, R_SSR2)
94 2 wfjm
    variable ssr1out : slv16 := (others=>'0');
95
    variable ssr2out : slv16 := (others=>'0');
96
  begin
97
 
98
    ssr1out := (others=>'0');
99
    if IBSEL_SSR1 = '1' then
100
      ssr1out(ssr1_ibf_rb_delta) := R_SSR1.rb_delta;
101
      ssr1out(ssr1_ibf_rb_num)   := R_SSR1.rb_num;
102
      ssr1out(ssr1_ibf_ra_delta) := R_SSR1.ra_delta;
103
      ssr1out(ssr1_ibf_ra_num)   := R_SSR1.ra_num;
104
    end if;
105
 
106
    ssr2out := (others=>'0');
107
    if IBSEL_SSR2 = '1' then
108
      ssr2out := R_SSR2;
109
    end if;
110
 
111
    IB_SRES.dout <= ssr1out or ssr2out;
112 8 wfjm
    IB_SRES.ack  <= (IBSEL_SSR1 or IBSEL_SSR2) and
113
                    (IB_MREQ.re or IB_MREQ.we); -- ack all
114
    IB_SRES.busy <= '0';
115 2 wfjm
 
116 8 wfjm
  end process proc_ibres;
117 2 wfjm
 
118
  proc_regs : process (CLK)
119
  begin
120
    if CLK'event and CLK='1' then
121 8 wfjm
      R_SSR1 <= N_SSR1;
122
      R_SSR2 <= N_SSR2;
123 2 wfjm
    end if;
124
  end process proc_regs;
125
 
126
  proc_comb : process (CRESET, IBSEL_SSR1, IB_MREQ,
127
                       R_SSR1, R_SSR2, TRACE, MONI)
128
 
129
    variable nssr1 : mmu_ssr1_type := mmu_ssr1_init;
130
    variable nssr2 : slv16 := (others=>'0');
131
    variable delta : slv5 := (others=>'0');
132
    variable use_rb : slbit := '0';
133
 
134
  begin
135
 
136
    nssr1 := R_SSR1;
137
    nssr2 := R_SSR2;
138
    delta := "0" & MONI.delta;
139
 
140
    use_rb := '0';
141
    if MONI.regnum/=nssr1.ra_num and unsigned(nssr1.ra_delta)/=0 then
142
      use_rb := '1';
143
    end if;
144
 
145
    if CRESET = '1' then
146
      nssr1 := mmu_ssr1_init;
147
      nssr2 := (others=>'0');
148
 
149
    elsif IBSEL_SSR1='1' and IB_MREQ.we='1' then
150
 
151
      if IB_MREQ.be1 = '1' then
152
        nssr1.rb_delta := IB_MREQ.din(ssr1_ibf_rb_delta);
153
        nssr1.rb_num   := IB_MREQ.din(ssr1_ibf_rb_num);
154
      end if;
155
      if IB_MREQ.be0 = '1' then
156
        nssr1.ra_delta := IB_MREQ.din(ssr1_ibf_ra_delta);
157
        nssr1.ra_num   := IB_MREQ.din(ssr1_ibf_ra_num);
158
      end if;
159
 
160
    elsif TRACE = '1' then
161
 
162
      if MONI.istart = '1' then
163
        nssr1 := mmu_ssr1_init;
164
        nssr2 := MONI.pc;
165
 
166
      elsif MONI.regmod = '1' then
167
        if use_rb = '0' then
168
          nssr1.ra_num := MONI.regnum;
169
          if MONI.isdec = '0' then
170
            nssr1.ra_delta := signed(nssr1.ra_delta) + signed(delta);
171
          else
172
            nssr1.ra_delta := signed(nssr1.ra_delta) - signed(delta);
173
          end if;
174
        else
175
          nssr1.rb_num := MONI.regnum;
176
          if MONI.isdec = '0' then
177
            nssr1.rb_delta := signed(nssr1.rb_delta) + signed(delta);
178
          else
179
            nssr1.rb_delta := signed(nssr1.rb_delta) - signed(delta);
180
          end if;
181
        end if;
182
      end if;
183
 
184
    end if;
185
 
186 8 wfjm
    N_SSR1 <= nssr1;
187
    N_SSR2 <= nssr2;
188 2 wfjm
 
189
  end process proc_comb;
190
 
191
end syn;

powered by: WebSVN 2.1.0

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