w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
rbd_usracc.vhd
Go to the documentation of this file.
1-- $Id: rbd_usracc.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2016-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: rbd_usracc - syn
7-- Description: rbus dev: return usr_access register (bitfile+jtag timestamp)
8--
9-- Dependencies: xlib/usr_access_unisim
10-- Test bench: -
11--
12-- Target Devices: generic
13-- Tool versions: viv 2015.4-2018.2; ghdl 0.33-0.34
14--
15-- Revision History:
16-- Date Rev Version Comment
17-- 2016-04-02 758 1.0 Initial version
18------------------------------------------------------------------------------
19--
20-- rbus registers:
21--
22-- Addr Bits Name r/w/f Function
23-- 0 ua0 r/-/- use_accress lsb
24-- 1 ua1 r/-/- use_accress msb
25--
26
27library ieee;
28use ieee.std_logic_1164.all;
29use ieee.numeric_std.all;
30
31use work.slvtypes.all;
32use work.xlib.all;
33use work.rblib.all;
34use work.rbdlib.all;
35
36entity rbd_usracc is -- rbus dev: return usr_access register
37 generic (
38 RB_ADDR : slv16 := rbaddr_usracc);
39 port (
40 CLK : in slbit; -- clock
41 RB_MREQ : in rb_mreq_type; -- rbus: request
42 RB_SRES : out rb_sres_type -- rbus: response
43 );
44end entity rbd_usracc;
45
46
47architecture syn of rbd_usracc is
48
49 signal R_SEL : slbit := '0';
50 signal DATA : slv32 := (others=>'0');
51
52begin
53
54 RBSEL : rb_sel
55 generic map (
57 SAWIDTH => 1)
58 port map (
59 CLK => CLK,
61 SEL => R_SEL
62 );
63
65 port map (DATA => DATA);
66
67 proc_next : process (R_SEL, RB_MREQ, DATA)
68 variable irb_ack : slbit := '0';
69 variable irb_err : slbit := '0';
70 variable irb_dout : slv16 := (others=>'0');
71 begin
72
73 irb_ack := '0';
74 irb_err := '0';
75 irb_dout := (others=>'0');
76
77 -- rbus transactions
78 if R_SEL = '1' then
79 irb_ack := RB_MREQ.re or RB_MREQ.we;
80 if RB_MREQ.we = '1' then
81 irb_err := '1';
82 end if;
83 if RB_MREQ.re = '1' then
84 case (RB_MREQ.addr(0)) is
85 when '0' => irb_dout := DATA(15 downto 0);
86 when '1' => irb_dout := DATA(31 downto 16);
87 when others => null;
88 end case;
89 end if;
90 end if;
91
92 RB_SRES.dout <= irb_dout;
93 RB_SRES.ack <= irb_ack;
94 RB_SRES.err <= irb_err;
95 RB_SRES.busy <= '0';
96
97 end process proc_next;
98
99end syn;
out SEL slbit
Definition: rb_sel.vhd:37
SAWIDTH natural := 0
Definition: rb_sel.vhd:32
in CLK slbit
Definition: rb_sel.vhd:34
in RB_MREQ rb_mreq_type
Definition: rb_sel.vhd:35
RB_ADDR slv16
Definition: rb_sel.vhd:31
slbit := '0' R_SEL
Definition: rbd_usracc.vhd:49
slv32 :=( others => '0') DATA
Definition: rbd_usracc.vhd:50
in CLK slbit
Definition: rbd_usracc.vhd:40
RB_ADDR slv16 := rbaddr_usracc
Definition: rbd_usracc.vhd:38
in RB_MREQ rb_mreq_type
Definition: rbd_usracc.vhd:41
out RB_SRES rb_sres_type
Definition: rbd_usracc.vhd:43
Definition: rblib.vhd:32
std_logic_vector( 31 downto 0) slv32
Definition: slvtypes.vhd:59
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
Definition: xlib.vhd:35