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

Subversion Repositories mblite

[/] [mblite/] [trunk/] [designs/] [core_syn/] [mblite_soc.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 takar
----------------------------------------------------------------------------------------------
2
--
3
--      Input file         : config_Pkg.vhd
4
--      Design name        : config_Pkg
5
--      Author             : Tamar Kranenburg
6
--      Company            : Delft University of Technology
7
--                         : Faculty EEMCS, Department ME&CE
8
--                         : Systems and Circuits group
9
--
10
--      Description        : Instantiates instruction- and datamemories and the core
11
--
12
----------------------------------------------------------------------------------------------
13
 
14 8 takar
library ieee;
15
use ieee.std_logic_1164.all;
16
use ieee.std_logic_unsigned.all;
17 2 takar
 
18 8 takar
library mblite;
19
use mblite.config_Pkg.all;
20
use mblite.core_Pkg.all;
21
use mblite.std_Pkg.all;
22 2 takar
 
23 8 takar
entity mblite_soc is port
24 2 takar
(
25 8 takar
    sys_clk_i        : in std_logic;
26
    dbg_dmem_o_we_o  : out std_logic;
27
    dbg_dmem_o_ena_o : out std_logic;
28
    sys_rst_i        : in std_logic;
29
    sys_ena_i        : in std_logic;
30
    sys_int_i        : in std_logic;
31
    dbg_dmem_o_adr_o : out std_logic_vector (31 downto 0);
32
    dbg_dmem_o_dat_o : out std_logic_vector (31 downto 0);
33
    dbg_dmem_o_sel_o : out std_logic_vector ( 3 downto 0)
34 2 takar
);
35 8 takar
end mblite_soc;
36 2 takar
 
37 8 takar
architecture arch of mblite_soc is
38 2 takar
 
39 8 takar
    component sram_init is generic
40 2 takar
    (
41
        WIDTH : integer;
42
        SIZE  : integer
43
    );
44 8 takar
    port
45 2 takar
    (
46 8 takar
        dat_o : out std_logic_vector(WIDTH - 1 downto 0);
47
        dat_i : in std_logic_vector(WIDTH - 1 downto 0);
48
        adr_i : in std_logic_vector(SIZE - 1 downto 0);
49
        wre_i : in std_logic;
50
        ena_i : in std_logic;
51
        clk_i : in std_logic
52 2 takar
    );
53 8 takar
    end component;
54 2 takar
 
55 8 takar
    component sram_4en_init is generic
56 2 takar
    (
57
        WIDTH : integer;
58
        SIZE  : integer
59
    );
60 8 takar
    port
61 2 takar
    (
62 8 takar
        dat_o : out std_logic_vector(WIDTH - 1 downto 0);
63
        dat_i : in std_logic_vector(WIDTH - 1 downto 0);
64
        adr_i : in std_logic_vector(SIZE - 1 downto 0);
65
        wre_i : in std_logic_vector(3 downto 0);
66
        ena_i : in std_logic;
67
        clk_i : in std_logic
68 2 takar
    );
69 8 takar
    end component;
70 2 takar
 
71 8 takar
    signal dmem_o : dmem_out_type;
72
    signal imem_o : imem_out_type;
73
    signal dmem_i : dmem_in_type;
74
    signal imem_i : imem_in_type;
75 2 takar
 
76 8 takar
    signal mem_enable : std_logic;
77
    signal sel_o : std_logic_vector(3 downto 0);
78 2 takar
 
79 8 takar
    constant std_out_adr : std_logic_vector(CFG_DMEM_SIZE - 1 downto 0) := X"FFFFFFC0";
80
    constant rom_size : integer := 13;
81
    constant ram_size : integer := 13;
82 2 takar
 
83 8 takar
begin
84 2 takar
 
85
    dbg_dmem_o_we_o  <= dmem_o.we_o;
86
    dbg_dmem_o_ena_o <= dmem_o.ena_o;
87
    dbg_dmem_o_adr_o <= dmem_o.adr_o;
88
    dbg_dmem_o_dat_o <= dmem_o.dat_o;
89
    dbg_dmem_o_sel_o <= dmem_o.sel_o;
90
 
91 8 takar
    imem : sram generic map
92 2 takar
    (
93
        WIDTH => CFG_IMEM_WIDTH,
94
        SIZE => rom_size - 2
95
    )
96 8 takar
    port map
97 2 takar
    (
98
        dat_o => imem_i.dat_i,
99
        dat_i => "00000000000000000000000000000000",
100 8 takar
        adr_i => imem_o.adr_o(rom_size - 1 downto 2),
101 2 takar
        wre_i => '0',
102
        ena_i => imem_o.ena_o,
103
        clk_i => sys_clk_i
104
    );
105
 
106 8 takar
    mem_enable <= not sys_rst_i and dmem_o.ena_o and not compare(dmem_o.adr_o, std_out_adr);
107
    sel_o <= dmem_o.sel_o when dmem_o.we_o = '1' else (others => '0');
108 2 takar
 
109 8 takar
    dmem : sram_4en generic map
110 2 takar
    (
111
        WIDTH => CFG_DMEM_WIDTH,
112
        SIZE => ram_size - 2
113
    )
114 8 takar
    port map
115 2 takar
    (
116
        dat_o => dmem_i.dat_i,
117
        dat_i => dmem_o.dat_o,
118 8 takar
        adr_i => dmem_o.adr_o(ram_size - 1 downto 2),
119 2 takar
        wre_i => sel_o,
120
        ena_i => mem_enable,
121
        clk_i => sys_clk_i
122
    );
123
 
124
    dmem_i.ena_i <= sys_ena_i;
125
 
126 8 takar
    core0 : core port map
127 2 takar
    (
128
        imem_o => imem_o,
129
        dmem_o => dmem_o,
130
        imem_i => imem_i,
131
        dmem_i => dmem_i,
132
        int_i  => sys_int_i,
133
        rst_i  => sys_rst_i,
134
        clk_i  => sys_clk_i
135
    );
136 8 takar
end arch;

powered by: WebSVN 2.1.0

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