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

Subversion Repositories w11

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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