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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [rtl/] [w11a/] [pdp11_ubmap.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_ubmap.vhd 335 2010-10-24 22:24:23Z mueller $
2 2 wfjm
--
3 8 wfjm
-- Copyright 2008-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_ubmap - syn
16
-- Description:    pdp11: 11/70 unibus mapper
17
--
18 8 wfjm
-- Dependencies:   memlib/ram_1swar_gen
19
--                 ib_sel
20 2 wfjm
-- Test bench:     tb/tb_pdp11_core (implicit)
21
-- Target Devices: generic
22 8 wfjm
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2, 12.1; ghdl 0.18-0.29
23
--
24 2 wfjm
-- Revision History: 
25
-- Date         Rev Version  Comment
26 8 wfjm
-- 2010-10-23   335   1.1.1  use ib_sel
27
-- 2010-10-17   333   1.1    use ibus V2 interface
28 2 wfjm
-- 2008-08-22   161   1.0.1  use iblib
29
-- 2008-01-27   115   1.0    Initial version 
30
------------------------------------------------------------------------------
31
 
32
library ieee;
33
use ieee.std_logic_1164.all;
34
use ieee.std_logic_arith.all;
35
 
36
use work.slvtypes.all;
37
use work.memlib.all;
38
use work.iblib.all;
39
use work.pdp11.all;
40
 
41
-- ----------------------------------------------------------------------------
42
 
43
entity pdp11_ubmap is                   -- 11/70 unibus mapper
44
  port (
45
    CLK : in slbit;                     -- clock
46
    MREQ : in slbit;                    -- request mapping
47
    ADDR_UB : in slv18_1;               -- UNIBUS address (in)
48
    ADDR_PM : out slv22_1;              -- physical memory address (out)
49
    IB_MREQ : in ib_mreq_type;          -- ibus request
50
    IB_SRES : out ib_sres_type          -- ibus response
51
  );
52
end pdp11_ubmap;
53
 
54
architecture syn of pdp11_ubmap is
55
 
56
  constant ibaddr_ubmap : slv16 := conv_std_logic_vector(8#170200#,16);
57
 
58 8 wfjm
  signal IBSEL_UBMAP : slbit := '0';
59
 
60 2 wfjm
  signal MAP_2_WE : slbit := '0';
61
  signal MAP_1_WE : slbit := '0';
62
  signal MAP_0_WE : slbit := '0';
63
  signal MAP_ADDR : slv5 := (others => '0');     -- map regs address
64
  signal MAP_DOUT : slv22_1 := (others => '0');  -- map regs output
65
 
66
begin
67
 
68
  MAP_2 : ram_1swar_gen                 -- bit 21:16 of map regs
69
    generic map (
70
      AWIDTH => 5,
71
      DWIDTH => 6)
72
    port map (
73
      CLK  => CLK,
74
      WE   => MAP_2_WE,
75
      ADDR => MAP_ADDR,
76
      DI   => IB_MREQ.din(5 downto 0),
77
      DO   => MAP_DOUT(21 downto 16));
78
 
79
  MAP_1 : ram_1swar_gen                 -- bit 15:08 of map regs
80
    generic map (
81
      AWIDTH => 5,
82
      DWIDTH => 8)
83
    port map (
84
      CLK  => CLK,
85
      WE   => MAP_1_WE,
86
      ADDR => MAP_ADDR,
87
      DI   => IB_MREQ.din(15 downto 8),
88
      DO   => MAP_DOUT(15 downto 8));
89
 
90
  MAP_0 : ram_1swar_gen                 -- bit 07:01 of map regs
91
    generic map (
92
      AWIDTH => 5,
93
      DWIDTH => 7)
94
    port map (
95
      CLK  => CLK,
96
      WE   => MAP_0_WE,
97
      ADDR => MAP_ADDR,
98
      DI   => IB_MREQ.din(7 downto 1),
99
      DO   => MAP_DOUT(7 downto 1));
100
 
101 8 wfjm
  SEL : ib_sel
102
    generic map (
103
      IB_ADDR => ibaddr_ubmap,
104
      SAWIDTH => 6)                     -- 2^6 = 64 = 2*32 words
105
    port map (
106
      CLK     => CLK,
107
      IB_MREQ => IB_MREQ,
108
      SEL     => IBSEL_UBMAP
109
    );
110
 
111
  proc_comb: process (MREQ, ADDR_UB, IBSEL_UBMAP, IB_MREQ, MAP_DOUT)
112 2 wfjm
    variable ibusy : slbit := '0';
113
    variable idout : slv16 := (others=>'0');
114
    variable iwe2  : slbit := '0';
115
    variable iwe1  : slbit := '0';
116
    variable iwe0  : slbit := '0';
117
    variable iaddr : slv5 := (others=>'0');
118
  begin
119
 
120
    ibusy := '0';
121
    idout := (others=>'0');
122
    iwe2  := '0';
123
    iwe1  := '0';
124
    iwe0  := '0';
125
    iaddr := (others=>'0');
126
 
127 8 wfjm
    if IBSEL_UBMAP = '1' then
128 2 wfjm
      if IB_MREQ.addr(1) = '1' then
129
        idout(5 downto 0)  := MAP_DOUT(21 downto 16);
130
      else
131
        idout(15 downto 1) := MAP_DOUT(15 downto 1);
132
      end if;
133
      if MREQ = '1' then                -- if map request, stall ib cycle
134
        ibusy := '1';
135
      end if;
136
    end if;
137
 
138 8 wfjm
    if IBSEL_UBMAP='1' and IB_MREQ.we='1' then
139 2 wfjm
      if IB_MREQ.addr(1)='1' then
140
        if IB_MREQ.be0 = '1' then
141
          iwe2 := '1';
142
        end if;
143
      else
144
        if IB_MREQ.be1 = '1' then
145
          iwe1 := '1';
146
        end if;
147
        if IB_MREQ.be0 = '1' then
148
          iwe0 := '1';
149
        end if;
150
      end if;
151
    end if;
152
 
153
    if MREQ = '1' then
154
      iaddr := ADDR_UB(17 downto 13);
155
    else
156
      iaddr := IB_MREQ.addr(6 downto 2);
157
    end if;
158
 
159
    MAP_ADDR <= iaddr;
160
    MAP_2_WE <= iwe2;
161
    MAP_1_WE <= iwe1;
162
    MAP_0_WE <= iwe0;
163
 
164
    ADDR_PM  <= unsigned(MAP_DOUT) + unsigned("000000000"&ADDR_UB(12 downto 1));
165
 
166 8 wfjm
    IB_SRES.ack  <= IBSEL_UBMAP and (IB_MREQ.re or IB_MREQ.we);
167 2 wfjm
    IB_SRES.busy <= ibusy;
168
    IB_SRES.dout <= idout;
169
 
170
  end process proc_comb;
171
 
172
end syn;

powered by: WebSVN 2.1.0

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