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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [ss/] [arch/] [board.vhdl] - Blame information for rev 38

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

Line No. Rev Author Line
1 36 lcdsgmtr
-- This is the architecture of the board
2
-- It defines the bus system and is used as the main structure
3
-- to add devices.
4
-- These devices can be:
5
-- - Memory
6
-- - Cache controller
7
-- - CPU
8
-- - Input devices
9
-- - Output devices
10
 
11
-- The main goal of the system is to provide the bus, the bus
12
-- controller for arbitration between bus masters, the control
13
-- signals, the data and address signals, the data protocol
14
-- and the address decoding.
15
 
16
-- It should be possible to generate this file based upon a
17
-- description of the different devices.
18
 
19
ARCHITECTURE Structural OF board IS
20
 
21 38 lcdsgmtr
  -- System constants
22
  CONSTANT nr_of_masters : INTEGER := 2;
23
  CONSTANT nr_of_devices : INTEGER := 5;
24
 
25
  CONSTANT addr_width : INTEGER := 15;
26
  CONSTANT data_width : INTEGER := 16;
27
 
28 37 lcdsgmtr
  -- Definition of bus signals
29 36 lcdsgmtr
 
30 37 lcdsgmtr
  SIGNAL data_bus    : STD_LOGIC_VECTOR(15 DOWNTO 0);
31
  SIGNAL address_bus : STD_LOGIC_VECTOR(14 DOWNTO 0);
32
  SIGNAL bus_read    : STD_LOGIC;
33
  SIGNAL bus_write   : STD_LOGIC;
34
  SIGNAL bus_wait    : STD_LOGIC;
35
  SIGNAL bus_ack     : STD_LOGIC;
36
 
37 38 lcdsgmtr
  -- Interconnection signals
38
 
39
  TYPE data_bus_array IS ARRAY (INTEGER RANGE <>) OF STD_LOGIC_VECTOR(data_width - 1 DOWNTO 0);
40
  SIGNAL device_data_out : data_bus_array(0 TO nr_of_devices - 1);
41
 
42
  TYPE address_bus_array IS ARRAY (INTEGER RANGE <>) OF STD_LOGIC_VECTOR(addr_width - 1 DOWNTO 0);
43
  SIGNAL device_address_out : address_bus_array(0 TO nr_of_masters - 1);
44
 
45
  -- Board level components
46
  -- Clock buffer
47
  SIGNAL clk : STD_LOGIC := '0';
48
 
49
  -- From asynchronous reset to synchronous reset
50
  SIGNAL rst : STD_LOGIC := '0';
51
 
52 37 lcdsgmtr
  -- Definition of components related to the bus
53
 
54
  COMPONENT data_mux IS
55
    PORT (
56
      data_in : IN STD_LOGIC_VECTOR(15 DOWNTO 0));
57
  END COMPONENT data_mux;
58
 
59
  COMPONENT address_mux IS
60
    PORT (
61
      address_in : IN STD_LOGIC_VECTOR(14 DOWNTO 0));
62
  END COMPONENT address_mux;
63
 
64
  COMPONENT address_decoder IS
65
    PORT (
66
      address_in : IN STD_LOGIC_VECTOR(14 DOWNTO 0));
67
  END COMPONENT address_decoder;
68
 
69
  COMPONENT bus_arbiter IS
70
  END COMPONENT bus_arbiter;
71
 
72 38 lcdsgmtr
  -- Definition of master devices attached to the bus
73
  COMPONENT icache IS
74
    PORT (
75
      clk      : IN  STD_LOGIC;
76
      rst      : IN  STD_LOGIC;
77
      data_in  : IN  STD_LOGIC_VECTOR(data_width - 1 DOWNTO 0);
78
      addr_out : OUT STD_LOGIC_VECTOR(addr_width - 1 DOWNTO 0);
79
      data_rd  : OUT STD_LOGIC;
80
      bus_wait : IN  STD_LOGIC);
81
  END COMPONENT icache;
82 37 lcdsgmtr
 
83 38 lcdsgmtr
  COMPONENT dcache IS
84
    PORT (
85
      clk      : IN  STD_LOGIC;
86
      rst      : IN  STD_LOGIC;
87
      data_in  : IN  STD_LOGIC_VECTOR(data_width - 1 DOWNTO 0);
88
      data_out : OUT STD_LOGIC_VECTOR(data_width - 1 DOWNTO 0);
89
      addr_out : OUT STD_LOGIC_VECTOR(addr_width - 1 DOWNTO 0);
90
      data_rd  : OUT STD_LOGIC;
91
      data_wr  : OUT STD_LOGIC;
92
      bus_wait : IN  STD_LOGIC);
93
  END COMPONENT dcache;
94
 
95
  -- Definition of io devices attached to the bus
96
  COMPONENT led_out IS
97
    PORT (
98
      clk      : IN  STD_LOGIC;
99
      rst      : IN  STD_LOGIC;
100
      data_in  : IN  STD_LOGIC_VECTOR(7 DOWNTO 0);
101
      addr_in  : IN  STD_LOGIC_VECTOR(addr_width - 1 DOWNTO 0);
102
      port_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
103
  END COMPONENT led_out;
104
 
105
  COMPONENT button_in IS
106
    PORT (
107
      clk      : IN  STD_LOGIC;
108
      rst      : IN  STD_LOGIC;
109
      data_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
110
      addr_in  : IN  STD_LOGIC_VECTOR(addr_width - 1 DOWNTO 0);
111
      port_in  : IN  STD_LOGIC_VECTOR(4 DOWNTO 0));
112
  END COMPONENT button_in;
113
 
114
  COMPONENT switch_in IS
115
    PORT (
116
      clk      : IN  STD_LOGIC;
117
      rst      : IN  STD_LOGIC;
118
      data_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
119
      addr_in  : IN  STD_LOGIC_VECTOR(addr_width - 1 DOWNTO 0);
120
      port_in  : IN  STD_LOGIC_VECTOR(7 DOWNTO 0));
121
  END COMPONENT switch_in;
122
 
123 36 lcdsgmtr
BEGIN  -- ARCHITECTURE Structural
124
 
125 37 lcdsgmtr
  -- Mapping of bus related components
126 36 lcdsgmtr
 
127 37 lcdsgmtr
  -- Mapping of system devices
128
 
129
  -- Main memory
130
 
131
  -- Instruction cache
132
 
133
  -- Data cache
134
 
135
  -- LED output device
136 38 lcdsgmtr
  led_out_1 : led_out
137
    PORT MAP (
138
      clk      => clk,
139
      rst      => rst,
140
      data_in  => data_bus(7 DOWNTO 0),
141
      addr_in  => address_bus,
142
      port_out => led);
143 37 lcdsgmtr
 
144
  -- Push button input device
145 38 lcdsgmtr
  button_in_1 : button_in
146
    PORT MAP (
147
      clk      => clk,
148
      rst      => rst,
149
      data_out => device_data_out(0)(7 DOWNTO 0),
150
      addr_in  => address_bus,
151
      port_in  => button);
152 37 lcdsgmtr
 
153
  -- Slide switch input device
154 38 lcdsgmtr
  switch_in_1 : switch_in
155
    PORT MAP (
156
      clk      => clk,
157
      rst      => rst,
158
      data_out => device_data_out(1)(7 DOWNTO 0),
159
      addr_in  => address_bus,
160
      port_in  => switch);
161 37 lcdsgmtr
 
162
  -- Serial communication device
163
 
164
  -- MAC device
165
 
166
  -- DVI device
167
 
168
  -- Character based device
169
 
170
 
171
 
172 36 lcdsgmtr
END ARCHITECTURE Structural;

powered by: WebSVN 2.1.0

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