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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.5/] [rtl/] [w11a/] [pdp11_ubmap.vhd] - Blame information for rev 7

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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