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 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wfjm
-- $Id: pdp11_sys70.vhd 314 2010-07-09 17:38:41Z mueller $
2
--
3
-- Copyright 2008- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
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
-- Tool versions:  xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
22
-- Revision History: 
23
-- Date         Rev Version  Comment
24
-- 2008-08-22   161   1.0.1  use iblib
25
-- 2008-04-20   137   1.0    Initial version 
26
------------------------------------------------------------------------------
27
 
28
library ieee;
29
use ieee.std_logic_1164.all;
30
use ieee.std_logic_arith.all;
31
 
32
use work.slvtypes.all;
33
use work.pdp11.all;
34
use work.iblib.all;
35
use work.sys_conf.all;
36
 
37
-- ----------------------------------------------------------------------------
38
 
39
entity pdp11_sys70 is                   -- 11/70 memory system registers
40
  port (
41
    CLK : in slbit;                     -- clock
42
    CRESET : in slbit;                  -- console reset
43
    IB_MREQ : in ib_mreq_type;          -- ibus request
44
    IB_SRES : out ib_sres_type          -- ibus response
45
  );
46
end pdp11_sys70;
47
 
48
architecture syn of pdp11_sys70 is
49
 
50
  constant ibaddr_mbrk   : slv16 := conv_std_logic_vector(8#177770#,16);
51
  constant ibaddr_sysid  : slv16 := conv_std_logic_vector(8#177764#,16);
52
 
53
  type regs_type is record              -- state registers
54
    mbrk    : slv8;                     -- status of mbrk register
55
  end record regs_type;
56
 
57
  constant regs_init : regs_type := (
58
    mbrk=>(others=>'0')                 -- mbrk
59
  );
60
 
61
  signal R_REGS : regs_type := regs_init;
62
  signal N_REGS : regs_type := regs_init;
63
 
64
begin
65
 
66
  proc_regs: process (CLK)
67
  begin
68
    if CLK'event and CLK='1' then
69
      if CRESET = '1' then
70
        R_REGS <= regs_init;
71
     else
72
        R_REGS <= N_REGS;
73
      end if;
74
    end if;
75
  end process proc_regs;
76
 
77
  proc_next: process (R_REGS, IB_MREQ)
78
    variable r : regs_type := regs_init;
79
    variable n : regs_type := regs_init;
80
    variable ibsel_mbrk  : slbit := '0';   -- mbrk
81
    variable ibsel_sysid : slbit := '0';   -- sysid
82
    variable ibsel : slbit := '0';
83
    variable idout : slv16 := (others=>'0');
84
  begin
85
 
86
    r := R_REGS;
87
    n := R_REGS;
88
 
89
    ibsel_mbrk  := '0';
90
    ibsel_sysid := '0';
91
    ibsel := '0';
92
    idout := (others=>'0');
93
 
94
    if IB_MREQ.req = '1' then
95
      if IB_MREQ.addr = ibaddr_mbrk(12 downto 1) then
96
        ibsel_mbrk  := '1';
97
      end if;
98
      if IB_MREQ.addr = ibaddr_sysid(12 downto 1) then
99
        ibsel_sysid := '1';
100
      end if;
101
    end if;
102
 
103
    ibsel := ibsel_mbrk or ibsel_sysid;
104
 
105
    if ibsel_mbrk = '1' then
106
      idout(r.mbrk'range) := r.mbrk;
107
    end if;
108
    if ibsel_sysid = '1' then
109
      idout := conv_std_logic_vector(8#123456#,16);
110
    end if;
111
 
112
    if ibsel_mbrk='1' and IB_MREQ.we='1' and IB_MREQ.be0='1' then
113
      n.mbrk := IB_MREQ.din(n.mbrk'range);
114
    end if;
115
 
116
    N_REGS <= n;
117
 
118
    IB_SRES.ack  <= ibsel;
119
    IB_SRES.busy <= '0';
120
    IB_SRES.dout <= idout;
121
 
122
  end process proc_next;
123
 
124
end syn;

powered by: WebSVN 2.1.0

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