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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [w11a/] [pdp11_sys70.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 wfjm
-- $Id: pdp11_sys70.vhd 427 2011-11-19 21:04:11Z mueller $
2 2 wfjm
--
3 13 wfjm
-- Copyright 2008-2011 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_sys70 - syn
16
-- Description:    pdp11: 11/70 system registers
17
--
18
-- Dependencies:   -
19
-- Test bench:     tb/tb_pdp11_core (implicit)
20
-- Target Devices: generic
21 13 wfjm
-- Tool versions:  xst 8.2, 9.1, 9.2, 12.1, 13.1; ghdl 0.18-0.29
22 8 wfjm
--
23 2 wfjm
-- Revision History: 
24
-- Date         Rev Version  Comment
25 13 wfjm
-- 2011-11-18   427   1.1.1  now numeric_std clean
26 8 wfjm
-- 2010-10-17   333   1.1    use ibus V2 interface
27 2 wfjm
-- 2008-08-22   161   1.0.1  use iblib
28
-- 2008-04-20   137   1.0    Initial version 
29
------------------------------------------------------------------------------
30
 
31
library ieee;
32
use ieee.std_logic_1164.all;
33 13 wfjm
use ieee.numeric_std.all;
34 2 wfjm
 
35
use work.slvtypes.all;
36
use work.pdp11.all;
37
use work.iblib.all;
38
use work.sys_conf.all;
39
 
40
-- ----------------------------------------------------------------------------
41
 
42
entity pdp11_sys70 is                   -- 11/70 memory system registers
43
  port (
44
    CLK : in slbit;                     -- clock
45
    CRESET : in slbit;                  -- console reset
46
    IB_MREQ : in ib_mreq_type;          -- ibus request
47
    IB_SRES : out ib_sres_type          -- ibus response
48
  );
49
end pdp11_sys70;
50
 
51
architecture syn of pdp11_sys70 is
52
 
53 13 wfjm
  constant ibaddr_mbrk   : slv16 := slv(to_unsigned(8#177770#,16));
54
  constant ibaddr_sysid  : slv16 := slv(to_unsigned(8#177764#,16));
55 2 wfjm
 
56
  type regs_type is record              -- state registers
57 8 wfjm
    ibsel_mbrk : slbit;                 -- ibus select mbrk
58
    ibsel_sysid : slbit;                -- ibus select sysid
59 2 wfjm
    mbrk    : slv8;                     -- status of mbrk register
60
  end record regs_type;
61
 
62
  constant regs_init : regs_type := (
63 8 wfjm
    '0','0',                            -- ibsel_*
64 2 wfjm
    mbrk=>(others=>'0')                 -- mbrk
65
  );
66
 
67
  signal R_REGS : regs_type := regs_init;
68
  signal N_REGS : regs_type := regs_init;
69
 
70
begin
71
 
72
  proc_regs: process (CLK)
73
  begin
74 13 wfjm
    if rising_edge(CLK) then
75 2 wfjm
      if CRESET = '1' then
76
        R_REGS <= regs_init;
77
     else
78
        R_REGS <= N_REGS;
79
      end if;
80
    end if;
81
  end process proc_regs;
82
 
83
  proc_next: process (R_REGS, IB_MREQ)
84
    variable r : regs_type := regs_init;
85
    variable n : regs_type := regs_init;
86
    variable idout : slv16 := (others=>'0');
87 8 wfjm
    variable ibreq : slbit := '0';
88
    variable ibw0 : slbit := '0';
89 2 wfjm
  begin
90
 
91
    r := R_REGS;
92
    n := R_REGS;
93
 
94
    idout := (others=>'0');
95 8 wfjm
    ibreq := IB_MREQ.re or IB_MREQ.we;
96
    ibw0  := IB_MREQ.we and IB_MREQ.be0;
97 2 wfjm
 
98 8 wfjm
    -- ibus address decoder
99
    n.ibsel_mbrk  := '0';
100
    n.ibsel_sysid := '0';
101
    if IB_MREQ.aval = '1' then
102 2 wfjm
      if IB_MREQ.addr = ibaddr_mbrk(12 downto 1) then
103 8 wfjm
        n.ibsel_mbrk  := '1';
104 2 wfjm
      end if;
105
      if IB_MREQ.addr = ibaddr_sysid(12 downto 1) then
106 8 wfjm
        n.ibsel_sysid := '1';
107 2 wfjm
      end if;
108 8 wfjm
    end if;
109 2 wfjm
 
110 8 wfjm
    -- ibus transactions
111
    if r.ibsel_mbrk = '1' then
112 2 wfjm
      idout(r.mbrk'range) := r.mbrk;
113
    end if;
114 8 wfjm
    if r.ibsel_sysid = '1' then
115 13 wfjm
      idout := slv(to_unsigned(8#123456#,16));
116 2 wfjm
    end if;
117
 
118 8 wfjm
    if r.ibsel_mbrk='1' and ibw0='1' then
119 2 wfjm
      n.mbrk := IB_MREQ.din(n.mbrk'range);
120
    end if;
121
 
122
    N_REGS <= n;
123
 
124 8 wfjm
    IB_SRES.dout <= idout;
125
    IB_SRES.ack  <= (r.ibsel_mbrk or r.ibsel_sysid) and ibreq;
126 2 wfjm
    IB_SRES.busy <= '0';
127
 
128
  end process proc_next;
129
 
130
end syn;

powered by: WebSVN 2.1.0

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