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

Subversion Repositories usimplez

[/] [usimplez/] [trunk/] [QuartusII/] [usimplez_top.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 pas.
--//////////////////////////////////////////////////////////////////////
2
--////                                                                                                                          ////
3
--////                                                                                                                          ////
4
--////                                                                                                                          ////
5
--//// This file is part of the MicroSimplez project                            ////
6
--//// http://opencores.org/project,usimplez                                            ////
7
--////                                                                                                                          ////
8
--//// Description                                                                                                      ////
9
--//// Implementation of MicroSimplez IP core according to                      ////
10
--//// MicroSimplez IP core specification document.                             ////
11
--////                                                                                                                          ////
12
--//// To Do:                                                                                                           ////
13
--//// -                                                                                                                        ////
14
--////                                                                                                                          ////
15
--//// Author(s):                                                                                                       ////
16
--//// - Daniel Peralta, peraltahd@opencores.org, designer                      ////
17
--//// - Martin Montero, monteromrtn@opencores.org, designer            ////
18
--//// - Julian Castro, julyan@opencores.org, reviewer                          ////
19
--//// - Pablo A. Salvadeo,     pas.@opencores, manager                                 ////
20
--////                                                                                                                          ////
21
--//////////////////////////////////////////////////////////////////////
22
--////                                                                                                                          ////
23
--//// Copyright (C) 2011 Authors and OPENCORES.ORG                             ////
24
--////                                                                                                                          ////
25
--//// This source file may be used and distributed without             ////
26
--//// restriction provided that this copyright statement is not        ////
27
--//// removed from the file and that any derivative work contains      ////
28
--//// the original copyright notice and the associated disclaimer.     ////
29
--////                                                                                                                          ////
30
--//// This source file is free software; you can redistribute it       ////
31
--//// and/or modify it under the terms of the GNU Lesser General       ////
32
--//// Public License as published by the Free Software Foundation;     ////
33
--//// either version 2.1 of the License, or (at your option) any       ////
34
--//// later version.                                                                                           ////
35
--////                                                                                                                          ////
36
--//// This source is distributed in the hope that it will be           ////
37
--//// useful, but WITHOUT ANY WARRANTY; without even the implied       ////
38
--//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR          ////
39
--//// PURPOSE. See the GNU Lesser General Public License for more      ////
40
--//// details.                                                                                                         ////
41
--////                                                                                                                          ////
42
--//// You should have received a copy of the GNU Lesser General        ////
43
--//// Public License along with this source; if not, download it       ////
44
--//// from http://www.opencores.org/lgpl.shtml                                         ////
45
--////                                                                                                                          ////
46
--//////////////////////////////////////////////////////////////////////
47
 
48
library ieee;
49
use ieee.std_logic_1164.all;
50
 
51
library work;
52
 
53
entity usimplez_top is
54
        generic
55
        (       WIDTH_WORD: natural:= 12;
56
                WIDTH_ADDRESS: natural:= 9
57
        );
58
        port
59
        (       clk_i :  in  std_logic;
60
                rst_i :  in  std_logic;
61
                we_o :  out  std_logic;
62
                in0_o :  out  std_logic;
63
                in1_o :  out  std_logic;
64
                op0_o :  out  std_logic;
65
                op1_o :  out  std_logic
66
        );
67
end usimplez_top;
68
 
69
architecture str of usimplez_top is
70
 
71
        component usimplez_cpu
72
                generic
73 3 pas.
                (       WIDTH_WORD:     natural;
74 2 pas.
                        WIDTH_OPERATION_CODE: natural;
75
                        WIDTH_ADDRESS: natural;
76
                        --Instructions:
77 3 pas.
                        ST:     std_logic_vector;
78
                        LD:     std_logic_vector;
79
                        ADD:    std_logic_vector;
80
                        BR:     std_logic_vector;
81
                        BZ:     std_logic_vector;
82
                        CLR:    std_logic_vector;
83
                        DEC:    std_logic_vector;
84
                        HALT:   std_logic_vector
85 2 pas.
                );
86
                port
87
                (       clk_i : in std_logic;
88
                        rst_i : in std_logic;
89 3 pas.
                        data_bus_i : in std_logic_vector(WIDTH_WORD-1 downto 0);
90 2 pas.
                        we_o : out std_logic;
91
                        in0_o : out std_logic;
92
                        in1_o : out std_logic;
93
                        op0_o : out std_logic;
94
                        op1_o : out std_logic;
95 3 pas.
                        addr_bus_o : out std_logic_vector(WIDTH_ADDRESS-1 downto 0);
96
                        data_bus_o : out std_logic_vector(WIDTH_WORD-1 downto 0)
97 2 pas.
                );
98
        end component;
99
 
100
        component usimplez_ram
101
                generic
102
                (       WIDTH_ADDRESS : natural;
103
                        WIDTH_WORD : natural
104
                );
105
                port
106
                (       clk_i : in std_logic;
107
                        we_i : in std_logic;
108 3 pas.
                        addr_i : in std_logic_vector(WIDTH_ADDRESS-1 downto 0);
109
                        data_i : in std_logic_vector(WIDTH_WORD-1 downto 0);
110
                        data_o : out std_logic_vector(WIDTH_WORD-1 downto 0)
111 2 pas.
                );
112
        end component;
113
 
114
        signal  rd_data_bus_s :  std_logic_vector(WIDTH_WORD-1 downto 0);
115
        signal  we_s :  std_logic;
116
        signal  addr_bus_s :  std_logic_vector(WIDTH_ADDRESS-1 downto 0);
117
        signal  wr_data_bus_s :  std_logic_vector(WIDTH_WORD-1 downto 0);
118
 
119
begin
120
 
121
we_o <= we_s;
122
 
123
cpu:usimplez_cpu
124
        generic map
125 3 pas.
        (       WIDTH_WORD => 12,
126 2 pas.
                WIDTH_ADDRESS => 9,
127
                WIDTH_OPERATION_CODE => 3,
128
                ST              => "000",
129
                LD              => "001",
130
                ADD             => "010",
131
                BR              => "011",
132
                BZ              => "100",
133
                CLR             => "101",
134
                DEC             => "110",
135
                HALT    => "111"
136
        )
137
        port map
138
        (       clk_i => clk_i,
139
                rst_i => rst_i,
140
                data_bus_i => rd_data_bus_s,
141
                we_o => we_s,
142
                in0_o => in0_o,
143
                in1_o => in1_o,
144
                op0_o => op0_o,
145
                op1_o => op1_o,
146
                addr_bus_o => addr_bus_s,
147
                data_bus_o => wr_data_bus_s
148
        );
149
 
150
ram:usimplez_ram
151
        generic map
152
        (       WIDTH_ADDRESS  => 9,
153
                WIDTH_WORD => 12
154
        )
155
        port map
156
        (       clk_i => clk_i,
157
                we_i => we_s,
158
                addr_i => addr_bus_s,
159
                data_i => wr_data_bus_s,
160
                data_o => rd_data_bus_s
161
        );
162
 
163
end str;

powered by: WebSVN 2.1.0

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