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

Subversion Repositories wishbone_out_port

[/] [wishbone_out_port/] [trunk/] [rtl/] [WBOPRT16.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 amulcock
-------------------------------------------------------------------------------
2
----                                                                                                                   ----
3
---- WISHBONE wishbone out port from b3 spec IP Core                       ----
4
----                                                                                                                   ----
5
---- This file is part of the wishbone out port from b3 spec project       ----
6
---- http://www.opencores.org/cores/xxx/                                                           ----
7
----                                                                                                                   ----
8
---- Description                                                                                                   ----
9
---- Implementation of the wishbone out port from b3 spec IP core          ----
10
----  according to wishbone out port from b3 spec IP core specification    ----
11
----    document.                                                          ----
12
----                                                                                                                   ----
13
---- To Do:                                                                                                            ----
14
----    NA                                                                                                             ----
15
----                                                                       ----
16
---- Taken directly from the wishbone out port from b3 spec, appendix A    ----
17
----  Changes made, 'tidy up', I like things in lines                      ----
18
----                change name, as Xilinx tools ( 9.2 sp 4 ) do not like  ----
19
----                      entity same name as the file name.               ----
20
----                 Used others clause for sync reset.                    ----
21
----                                                                                                                   ----
22
---- Author(s):                                                                                                ----
23
----   Andrew Mulcock, amulcock@opencores.org                                              ----
24
----                                                                                                                   ----
25
-------------------------------------------------------------------------------
26
----                                                                                                                   ----
27
---- Copyright (C) 2008 Authors and OPENCORES.ORG                                          ----
28
----                                                                                                                   ----
29
---- This source file may be used and distributed without                                  ----
30
---- restriction provided that this copyright statement is not                     ----
31
---- removed from the file and that any derivative work contains                   ----
32
---- the original copyright notice and the associated disclaimer.                  ----
33
----                                                                                                                   ----
34
---- This source file is free software; you can redistribute it                ----
35
---- and/or modify it under the terms of the GNU Lesser General                ----
36
---- Public License as published by the Free Software Foundation;                  ----
37
---- either version 2.1 of the License, or (at your option) any                    ----
38
---- later version.                                                                                                ----
39
----                                                                                                                   ----
40
---- This source is distributed in the hope that it will be                                ----
41
---- useful, but WITHOUT ANY WARRANTY; without even the implied            ----
42
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR               ----
43
---- PURPOSE. See the GNU Lesser General Public License for more                   ----
44
---- details.                                                                                                      ----
45
----                                                                                                                   ----
46
---- You should have received a copy of the GNU Lesser General                 ----
47
---- Public License along with this source; if not, download it                    ----
48
---- from http://www.opencores.org/lgpl.shtml                                              ----
49
----                                                                                                                   ----
50
-------------------------------------------------------------------------------
51
--                                                                                                                         ----
52
-- CVS Revision History                                                                                    ----
53
--                                                                                                                         ----
54
-- $Log: not supported by cvs2svn $                                                                                                            ----
55
--                                                                                                                         ----
56
 
57
library ieee;
58
use ieee.std_logic_1164.all;
59
 
60
entity WB_OPRT_16 is
61
    port(
62
    -- WISHBONE SLAVE interface:
63
    ACK_O   : out   std_logic;
64
    CLK_I   : in    std_logic;
65
    DAT_I   : in    std_logic_vector( 15 downto 0 );
66
    DAT_O   : out   std_logic_vector( 15 downto 0 );
67
    RST_I   : in    std_logic;
68
    SEL_I   : in    std_logic_vector( 1 downto 0 );
69
    STB_I   : in    std_logic;
70
    WE_I    : in    std_logic;
71
    -- Output port (non-WISHBONE signals):
72
    PRT_O   : out   std_logic_vector( 15 downto 0 )
73
    );
74
end entity WB_OPRT_16;
75
 
76
architecture rtl of WB_OPRT_16 is
77
    signal QH: std_logic_vector( 7 downto 0 );
78
    signal QL: std_logic_vector( 7 downto 0 );
79
begin
80
 
81
REG: process( CLK_I )
82
begin
83
    if( rising_edge( CLK_I ) ) then
84
        if( RST_I = '1' ) then
85
            QH <= (others => '0');
86
        elsif( (STB_I and WE_I and SEL_I(1)) = '1' ) then
87
            QH <= DAT_I( 15 downto 8 );
88
        else
89
            QH <= QH;
90
        end if;
91
     end if;
92
 
93
     if( rising_edge( CLK_I ) ) then
94
        if( RST_I = '1' ) then
95
            QL <= (others => '0');
96
        elsif( (STB_I and WE_I and SEL_I(0)) = '1' ) then
97
            QL <= DAT_I( 7 downto 0 );
98
        else
99
            QL <= QL;
100
        end if;
101
    end if;
102
end process REG;
103
 
104
 
105
    ACK_O <= STB_I;
106
    DAT_O( 15 downto 8 ) <= QH;
107
    DAT_O( 7 downto 0 ) <= QL;
108
    PRT_O( 15 downto 8 ) <= QH;
109
    PRT_O( 7 downto 0 ) <= QL;
110
 
111
end architecture rtl;

powered by: WebSVN 2.1.0

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