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

Subversion Repositories w11

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

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

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

powered by: WebSVN 2.1.0

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