Line 1... |
Line 1... |
-- $Id: pdp11_ubmap.vhd 314 2010-07-09 17:38:41Z mueller $
|
-- $Id: pdp11_ubmap.vhd 335 2010-10-24 22:24:23Z mueller $
|
--
|
--
|
-- Copyright 2008- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2008-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
--
|
--
|
-- This program is free software; you may redistribute and/or modify it under
|
-- This program is free software; you may redistribute and/or modify it under
|
-- the terms of the GNU General Public License as published by the Free
|
-- the terms of the GNU General Public License as published by the Free
|
-- Software Foundation, either version 2, or at your option any later version.
|
-- Software Foundation, either version 2, or at your option any later version.
|
--
|
--
|
Line 13... |
Line 13... |
--
|
--
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Module Name: pdp11_ubmap - syn
|
-- Module Name: pdp11_ubmap - syn
|
-- Description: pdp11: 11/70 unibus mapper
|
-- Description: pdp11: 11/70 unibus mapper
|
--
|
--
|
-- Dependencies: -
|
-- Dependencies: memlib/ram_1swar_gen
|
|
-- ib_sel
|
-- Test bench: tb/tb_pdp11_core (implicit)
|
-- Test bench: tb/tb_pdp11_core (implicit)
|
-- Target Devices: generic
|
-- Target Devices: generic
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 12.1; ghdl 0.18-0.29
|
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2010-10-23 335 1.1.1 use ib_sel
|
|
-- 2010-10-17 333 1.1 use ibus V2 interface
|
-- 2008-08-22 161 1.0.1 use iblib
|
-- 2008-08-22 161 1.0.1 use iblib
|
-- 2008-01-27 115 1.0 Initial version
|
-- 2008-01-27 115 1.0 Initial version
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
|
|
library ieee;
|
library ieee;
|
Line 49... |
Line 53... |
|
|
architecture syn of pdp11_ubmap is
|
architecture syn of pdp11_ubmap is
|
|
|
constant ibaddr_ubmap : slv16 := conv_std_logic_vector(8#170200#,16);
|
constant ibaddr_ubmap : slv16 := conv_std_logic_vector(8#170200#,16);
|
|
|
|
signal IBSEL_UBMAP : slbit := '0';
|
|
|
signal MAP_2_WE : slbit := '0';
|
signal MAP_2_WE : slbit := '0';
|
signal MAP_1_WE : slbit := '0';
|
signal MAP_1_WE : slbit := '0';
|
signal MAP_0_WE : slbit := '0';
|
signal MAP_0_WE : slbit := '0';
|
signal MAP_ADDR : slv5 := (others => '0'); -- map regs address
|
signal MAP_ADDR : slv5 := (others => '0'); -- map regs address
|
signal MAP_DOUT : slv22_1 := (others => '0'); -- map regs output
|
signal MAP_DOUT : slv22_1 := (others => '0'); -- map regs output
|
Line 90... |
Line 96... |
WE => MAP_0_WE,
|
WE => MAP_0_WE,
|
ADDR => MAP_ADDR,
|
ADDR => MAP_ADDR,
|
DI => IB_MREQ.din(7 downto 1),
|
DI => IB_MREQ.din(7 downto 1),
|
DO => MAP_DOUT(7 downto 1));
|
DO => MAP_DOUT(7 downto 1));
|
|
|
proc_comb: process (MREQ, ADDR_UB, IB_MREQ, MAP_DOUT)
|
SEL : ib_sel
|
variable ibsel : slbit := '0';
|
generic map (
|
|
IB_ADDR => ibaddr_ubmap,
|
|
SAWIDTH => 6) -- 2^6 = 64 = 2*32 words
|
|
port map (
|
|
CLK => CLK,
|
|
IB_MREQ => IB_MREQ,
|
|
SEL => IBSEL_UBMAP
|
|
);
|
|
|
|
proc_comb: process (MREQ, ADDR_UB, IBSEL_UBMAP, IB_MREQ, MAP_DOUT)
|
variable ibusy : slbit := '0';
|
variable ibusy : slbit := '0';
|
variable idout : slv16 := (others=>'0');
|
variable idout : slv16 := (others=>'0');
|
variable iwe2 : slbit := '0';
|
variable iwe2 : slbit := '0';
|
variable iwe1 : slbit := '0';
|
variable iwe1 : slbit := '0';
|
variable iwe0 : slbit := '0';
|
variable iwe0 : slbit := '0';
|
variable iaddr : slv5 := (others=>'0');
|
variable iaddr : slv5 := (others=>'0');
|
begin
|
begin
|
|
|
ibsel := '0';
|
|
ibusy := '0';
|
ibusy := '0';
|
idout := (others=>'0');
|
idout := (others=>'0');
|
iwe2 := '0';
|
iwe2 := '0';
|
iwe1 := '0';
|
iwe1 := '0';
|
iwe0 := '0';
|
iwe0 := '0';
|
iaddr := (others=>'0');
|
iaddr := (others=>'0');
|
|
|
if IB_MREQ.req = '1' and
|
if IBSEL_UBMAP = '1' then
|
IB_MREQ.addr(12 downto 7)=ibaddr_ubmap(12 downto 7) then
|
|
ibsel := '1';
|
|
end if;
|
|
|
|
if ibsel = '1' then
|
|
if IB_MREQ.addr(1) = '1' then
|
if IB_MREQ.addr(1) = '1' then
|
idout(5 downto 0) := MAP_DOUT(21 downto 16);
|
idout(5 downto 0) := MAP_DOUT(21 downto 16);
|
else
|
else
|
idout(15 downto 1) := MAP_DOUT(15 downto 1);
|
idout(15 downto 1) := MAP_DOUT(15 downto 1);
|
end if;
|
end if;
|
if MREQ = '1' then -- if map request, stall ib cycle
|
if MREQ = '1' then -- if map request, stall ib cycle
|
ibusy := '1';
|
ibusy := '1';
|
end if;
|
end if;
|
end if;
|
end if;
|
|
|
if ibsel='1' and IB_MREQ.we='1' then
|
if IBSEL_UBMAP='1' and IB_MREQ.we='1' then
|
if IB_MREQ.addr(1)='1' then
|
if IB_MREQ.addr(1)='1' then
|
if IB_MREQ.be0 = '1' then
|
if IB_MREQ.be0 = '1' then
|
iwe2 := '1';
|
iwe2 := '1';
|
end if;
|
end if;
|
else
|
else
|
Line 152... |
Line 161... |
MAP_1_WE <= iwe1;
|
MAP_1_WE <= iwe1;
|
MAP_0_WE <= iwe0;
|
MAP_0_WE <= iwe0;
|
|
|
ADDR_PM <= unsigned(MAP_DOUT) + unsigned("000000000"&ADDR_UB(12 downto 1));
|
ADDR_PM <= unsigned(MAP_DOUT) + unsigned("000000000"&ADDR_UB(12 downto 1));
|
|
|
IB_SRES.ack <= ibsel;
|
IB_SRES.ack <= IBSEL_UBMAP and (IB_MREQ.re or IB_MREQ.we);
|
IB_SRES.busy <= ibusy;
|
IB_SRES.busy <= ibusy;
|
IB_SRES.dout <= idout;
|
IB_SRES.dout <= idout;
|
|
|
end process proc_comb;
|
end process proc_comb;
|
|
|