Line 1... |
Line 1... |
-- $Id: ibdr_rhrp.vhd 680 2015-05-14 13:29:46Z mueller $
|
-- $Id: ibdr_rhrp.vhd 682 2015-05-15 18:35:29Z mueller $
|
--
|
--
|
-- Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2015- 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
|
Line 25... |
Line 25... |
-- 2015-05-14 680 14.7 131013 xc6slx16-2 211 408 8 131 s 8.8
|
-- 2015-05-14 680 14.7 131013 xc6slx16-2 211 408 8 131 s 8.8
|
-- 2015-04-06 664 14.7 131013 xc6slx16-2 177 331 8 112 s 8.7
|
-- 2015-04-06 664 14.7 131013 xc6slx16-2 177 331 8 112 s 8.7
|
--
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2015-05-15 682 1.0.1 correct ibsel range select logic
|
-- 2015-05-14 680 1.0 Initial version
|
-- 2015-05-14 680 1.0 Initial version
|
-- 2015-03-15 658 0.1 First draft
|
-- 2015-03-15 658 0.1 First draft
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
|
|
library ieee;
|
library ieee;
|
Line 461... |
Line 462... |
variable ieunit : slv2 := (others=>'0');
|
variable ieunit : slv2 := (others=>'0');
|
|
|
variable iomux : slv4 := (others=>'0'); -- omux select
|
variable iomux : slv4 := (others=>'0'); -- omux select
|
variable iamap : slv5 := (others=>'0'); -- mem mapped address
|
variable iamap : slv5 := (others=>'0'); -- mem mapped address
|
variable imask : slv16 := (others=>'0'); -- implemented bits mask
|
variable imask : slv16 := (others=>'0'); -- implemented bits mask
|
variable inxr : slbit := '0'; -- non-existent register
|
|
variable imbreg : slbit := '0'; -- massbus register
|
variable imbreg : slbit := '0'; -- massbus register
|
variable inormr : slbit := '0'; -- inhibit rmr protect
|
variable inormr : slbit := '0'; -- inhibit rmr protect
|
|
|
variable idte : slv3 := (others=>'0'); -- encoded drive type
|
variable idte : slv3 := (others=>'0'); -- encoded drive type
|
variable idtyp : slv6 := (others=>'0'); -- drive type (5:0)
|
variable idtyp : slv6 := (others=>'0'); -- drive type (5:0)
|
Line 504... |
Line 504... |
ieunit := (others=>'0');
|
ieunit := (others=>'0');
|
|
|
iomux := (others=>'0');
|
iomux := (others=>'0');
|
iamap := (others=>'0');
|
iamap := (others=>'0');
|
imask := (others=>'1'); -- default: all bits ok
|
imask := (others=>'1'); -- default: all bits ok
|
inxr := '0';
|
|
imbreg := '0';
|
imbreg := '0';
|
inormr := '0';
|
inormr := '0';
|
|
|
idte := (others=>'0');
|
idte := (others=>'0');
|
idtyp := (others=>'0');
|
idtyp := (others=>'0');
|
Line 525... |
Line 524... |
|
|
-- ibus address decoder, accept only offsets 0 to ibaddr_cs3
|
-- ibus address decoder, accept only offsets 0 to ibaddr_cs3
|
n.ibsel := '0';
|
n.ibsel := '0';
|
if IB_MREQ.aval = '1' and
|
if IB_MREQ.aval = '1' and
|
IB_MREQ.addr(12 downto 6) = ibaddr_rhrp(12 downto 6) and
|
IB_MREQ.addr(12 downto 6) = ibaddr_rhrp(12 downto 6) and
|
unsigned(ibaddr_rhrp(5 downto 0)) <= unsigned(ibaddr_cs3) then
|
unsigned(IB_MREQ.addr(5 downto 1)) <= unsigned(ibaddr_cs3) then
|
n.ibsel := '1';
|
n.ibsel := '1';
|
end if;
|
end if;
|
|
|
-- internal state machine
|
-- internal state machine
|
case r.state is
|
case r.state is
|
Line 708... |
Line 707... |
iomux := omux_bae;
|
iomux := omux_bae;
|
|
|
when ibaddr_cs3 => -- RxCS3 control reg 3
|
when ibaddr_cs3 => -- RxCS3 control reg 3
|
iomux := omux_cs3;
|
iomux := omux_cs3;
|
|
|
when others => -- unknown register
|
when others => null; -- doesn't happen, ibsel only for
|
inxr := '1';
|
-- subrange up to cs3, and all
|
|
-- 22 regs are decoded above
|
|
|
end case; -- case IB_MREQ.addr
|
end case; -- case IB_MREQ.addr
|
n.amap := iamap;
|
n.amap := iamap;
|
n.omux := iomux;
|
n.omux := iomux;
|
n.dinmsk := imask and IB_MREQ.din;
|
n.dinmsk := imask and IB_MREQ.din;
|
Line 765... |
Line 765... |
n.state := s_setrmr;
|
n.state := s_setrmr;
|
end if;
|
end if;
|
end if;
|
end if;
|
|
|
elsif IB_MREQ.re = '1' then -- read request
|
elsif IB_MREQ.re = '1' then -- read request
|
if inxr = '1' then -- unknown register
|
|
ibreq := '0'; -- suppress ack & hold --> ibus err
|
|
else
|
|
if ibrem='0' and imbreg='1' and ined='1' then
|
if ibrem='0' and imbreg='1' and ined='1' then
|
n.cs2ned := '1'; -- signal error
|
n.cs2ned := '1'; -- signal error
|
else
|
else
|
ibhold := '1';
|
ibhold := '1';
|
n.state := s_read;
|
n.state := s_read;
|
end if;
|
end if;
|
end if;
|
|
|
|
end if; -- if IB_MREQ.we .. elsif IB_MREQ.re
|
end if; -- if IB_MREQ.we .. elsif IB_MREQ.re
|
|
|
-- BRESET and ITIMER can be handled in the 'else' because both can
|
-- BRESET and ITIMER can be handled in the 'else' because both can
|
-- never come during an ibus transaction. Done here to keep logic
|
-- never come during an ibus transaction. Done here to keep logic
|