Line 1... |
Line 1... |
-- $Id: pdp11_vmbox.vhd 335 2010-10-24 22:24:23Z mueller $
|
-- $Id: pdp11_vmbox.vhd 427 2011-11-19 21:04:11Z mueller $
|
--
|
--
|
-- Copyright 2006-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2006-2011 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 21... |
Line 21... |
-- ibus/ib_sres_or_2
|
-- ibus/ib_sres_or_2
|
-- ibus/ib_sel
|
-- ibus/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, 12.1; ghdl 0.18-0.29
|
-- Tool versions: xst 8.2, 9.1, 9.2, 12.1, 13.1; ghdl 0.18-0.29
|
--
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2011-11-18 427 1.6.3 now numeric_std clean
|
-- 2010-10-23 335 1.6.2 add r.paddr_iopage, use ib_sel
|
-- 2010-10-23 335 1.6.2 add r.paddr_iopage, use ib_sel
|
-- 2010-10-22 334 1.6.1 deassert ibus be's at end-cycle; fix rmw logic
|
-- 2010-10-22 334 1.6.1 deassert ibus be's at end-cycle; fix rmw logic
|
-- 2010-10-17 333 1.6 implement ibus V2 interface
|
-- 2010-10-17 333 1.6 implement ibus V2 interface
|
-- 2010-06-27 310 1.5 redo ibus driver logic, now ibus driven from flops
|
-- 2010-06-27 310 1.5 redo ibus driver logic, now ibus driven from flops
|
-- 2010-06-20 307 1.4.2 rename cpacc to cacc in vm_cntl_type, mmu_cntl_type
|
-- 2010-06-20 307 1.4.2 rename cpacc to cacc in vm_cntl_type, mmu_cntl_type
|
Line 59... |
Line 60... |
-- 2007-05-12 26 1.0 Initial version
|
-- 2007-05-12 26 1.0 Initial version
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_arith.all;
|
use ieee.numeric_std.all;
|
|
|
use work.slvtypes.all;
|
use work.slvtypes.all;
|
use work.iblib.all;
|
use work.iblib.all;
|
use work.pdp11.all;
|
use work.pdp11.all;
|
use work.sys_conf.all;
|
use work.sys_conf.all;
|
Line 92... |
Line 93... |
);
|
);
|
end pdp11_vmbox;
|
end pdp11_vmbox;
|
|
|
architecture syn of pdp11_vmbox is
|
architecture syn of pdp11_vmbox is
|
|
|
constant ibaddr_slim : slv16 := conv_std_logic_vector(8#177774#,16);
|
constant ibaddr_slim : slv16 := slv(to_unsigned(8#177774#,16));
|
constant atowidth : natural := 5; -- size of access timeout counter
|
constant atowidth : natural := 5; -- size of access timeout counter
|
|
|
type state_type is (
|
type state_type is (
|
s_idle, -- s_idle: wait for vm_cntl request
|
s_idle, -- s_idle: wait for vm_cntl request
|
s_mem_w, -- s_mem_w: check mmu, wait for memory
|
s_mem_w, -- s_mem_w: check mmu, wait for memory
|
Line 232... |
Line 233... |
IB_SRES_SLIM.busy <= '0';
|
IB_SRES_SLIM.busy <= '0';
|
end process proc_ibres;
|
end process proc_ibres;
|
|
|
proc_slim: process (CLK)
|
proc_slim: process (CLK)
|
begin
|
begin
|
if CLK'event and CLK='1' then
|
if rising_edge(CLK) then
|
if BRESET = '1' then
|
if BRESET = '1' then
|
R_SLIM <= (others=>'0');
|
R_SLIM <= (others=>'0');
|
elsif IBSEL_SLIM='1' and IB_MREQ.we='1' then
|
elsif IBSEL_SLIM='1' and IB_MREQ.we='1' then
|
if IB_MREQ.be1 = '1' then
|
if IB_MREQ.be1 = '1' then
|
R_SLIM <= IB_MREQ.din(ibf_byte1);
|
R_SLIM <= IB_MREQ.din(ibf_byte1);
|
Line 245... |
Line 246... |
end if;
|
end if;
|
end process proc_slim;
|
end process proc_slim;
|
|
|
proc_regs: process (CLK)
|
proc_regs: process (CLK)
|
begin
|
begin
|
if CLK'event and CLK='1' then
|
if rising_edge(CLK) then
|
if GRESET = '1' then
|
if GRESET = '1' then
|
R_REGS <= regs_init;
|
R_REGS <= regs_init;
|
else
|
else
|
R_REGS <= N_REGS;
|
R_REGS <= N_REGS;
|
end if;
|
end if;
|
Line 615... |
Line 616... |
end if;
|
end if;
|
|
|
if ato_go = '0' then -- handle access timeout counter
|
if ato_go = '0' then -- handle access timeout counter
|
n.atocnt := atocnt_init; -- if ato_go=0, keep in reset
|
n.atocnt := atocnt_init; -- if ato_go=0, keep in reset
|
else
|
else
|
n.atocnt := unsigned(r.atocnt) - 1;-- otherwise count down
|
n.atocnt := slv(unsigned(r.atocnt) - 1);-- otherwise count down
|
end if;
|
end if;
|
|
|
ipaddr := (others=>'0');
|
ipaddr := (others=>'0');
|
if paddr_mmu = '1' then
|
if paddr_mmu = '1' then
|
ipaddr( 5 downto 0) := VM_ADDR(5 downto 0);
|
ipaddr( 5 downto 0) := VM_ADDR(5 downto 0);
|