1 |
60 |
robfinch |
// ============================================================================
|
2 |
|
|
// __
|
3 |
|
|
// \\__/ o\ (C) 2017-2018 Robert Finch, Waterloo
|
4 |
|
|
// \ __ / All rights reserved.
|
5 |
|
|
// \/_// robfinch<remove>@finitron.ca
|
6 |
|
|
// ||
|
7 |
|
|
//
|
8 |
|
|
// FT64_config.vh
|
9 |
|
|
//
|
10 |
|
|
// This source file is free software: you can redistribute it and/or modify
|
11 |
|
|
// it under the terms of the GNU Lesser General Public License as published
|
12 |
|
|
// by the Free Software Foundation, either version 3 of the License, or
|
13 |
|
|
// (at your option) any later version.
|
14 |
|
|
//
|
15 |
|
|
// This source file is distributed in the hope that it will be useful,
|
16 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
// GNU General Public License for more details.
|
19 |
|
|
//
|
20 |
|
|
// You should have received a copy of the GNU General Public License
|
21 |
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
22 |
|
|
//
|
23 |
|
|
// ============================================================================
|
24 |
|
|
//
|
25 |
|
|
// The following line is to enable simulation versions of some modules.
|
26 |
|
|
// Comment out for synthesis.
|
27 |
|
|
//`define SIM 1'b1
|
28 |
|
|
|
29 |
|
|
//`define SUPPORT_SMT 1'b1
|
30 |
|
|
//`define SUPPORT_VECTOR 1'b1
|
31 |
|
|
//`define SUPPORT_DCI 1'b1 // dynamically compressed instructions
|
32 |
|
|
//`define SUPPORT_BBMS 1'b1
|
33 |
|
|
//`define SUPPORT_SEGMENTATION 1'b1
|
34 |
|
|
//`define SUPPORT_PREDICATION 1'b1
|
35 |
|
|
//`define DEBUG_LOGIC 1'b1
|
36 |
|
|
`define L1_ICACHE_SIZE 2 // 2 or 4 for 2 or 4 kB
|
37 |
|
|
|
38 |
|
|
// One way to tweak the size of the core a little bit is to limit the number
|
39 |
|
|
// of address bits processed. The test system for instance has only 512MB of
|
40 |
|
|
// memory, so the address size is limited to 32 bits.
|
41 |
|
|
// ** The ASID is stored in the upper 8 bits of the address
|
42 |
|
|
`define AMSB 63
|
43 |
|
|
`define ABITS `AMSB:0
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
// bitfield representing a queue entry index. The field must be large
|
47 |
|
|
// enough to accomodate a queue entry number, determined by the number
|
48 |
|
|
// of queue entries below.
|
49 |
|
|
`define QBIT 4
|
50 |
|
|
`define QBITS 3:0
|
51 |
|
|
`define QBITSP1 4:0
|
52 |
|
|
|
53 |
|
|
// The following bitfield spec is for the instruction sequence number. It
|
54 |
|
|
// must have at least one more bit in it than the QBITS above as the counter
|
55 |
|
|
// can overflow a little bit.
|
56 |
|
|
`define SNBITS 4:0
|
57 |
|
|
|
58 |
|
|
// If set greater than 10, then memory instructions won't
|
59 |
|
|
// issue until they are within 10 of the head of the queue.
|
60 |
|
|
`define QENTRIES 4
|
61 |
|
|
|
62 |
|
|
// Bitfield for representing exception codes
|
63 |
|
|
`define XBITS 7:0
|
64 |
|
|
|
65 |
|
|
//`define SUPPORT_DBG 1'b1
|
66 |
|
|
|
67 |
|
|
// Issue logic is not really required for every possible distance from
|
68 |
|
|
// the head of the queue. Later queue entries tend to depend on prior
|
69 |
|
|
// ones and hence may not be ready to be issued. Also note that
|
70 |
|
|
// instruction decode takes a cycle making the last entry or two in the
|
71 |
|
|
// queue not ready to be issued. Commenting out this line will limit
|
72 |
|
|
// much of the issue logic to the first six queue slots relative to the
|
73 |
|
|
// head of the queue.
|
74 |
|
|
`define FULL_ISSUE_LOGIC 1'b1
|
75 |
|
|
|
76 |
|
|
// The WAYS config define affects things like the number of ports on the
|
77 |
|
|
// register file, the number of ports on the instruction cache, and how
|
78 |
|
|
// many entries are contained in the fetch buffers. It also indirectly
|
79 |
|
|
// affects how many instructions are queued.
|
80 |
|
|
`define WAYS 1 // number of ways parallel (1-3 3 not working yet)
|
81 |
|
|
`define NUM_IDU 1 // number of instruction decode units (1-3)
|
82 |
|
|
`define NUM_ALU 1 // number of ALU's (1-2)
|
83 |
|
|
`define NUM_MEM 1 // number of memory queues (1-3)
|
84 |
|
|
`define NUM_FPU 0 // number of floating-point units (0-2)
|
85 |
|
|
// Note that even with just a single commit bus, multiple instructions may
|
86 |
|
|
// commit if they do not target any registers. Up to three instruction may
|
87 |
|
|
// commit even with just a single bus.
|
88 |
|
|
`define NUM_CMT 1 // number of commit busses (1-3)
|
89 |
|
|
// Comment out the following to remove FCU enhancements (branch predictor, BTB, RSB)
|
90 |
|
|
//`define FCU_ENH 1
|
91 |
|
|
// Comment out the following to remove bypassing logic on the functional units
|
92 |
|
|
//`define FU_BYPASS 1
|
93 |
|
|
|
94 |
|
|
//`define SUPPORT_TLB 1
|
95 |
|
|
|
96 |
|
|
// These are unit availability settings at reset.
|
97 |
|
|
`define ID1_AVAIL 1'b1
|
98 |
|
|
`define ID2_AVAIL 1'b1
|
99 |
|
|
`define ID3_AVAIL 1'b0
|
100 |
|
|
`define ALU0_AVAIL 1'b1
|
101 |
|
|
`define ALU1_AVAIL 1'b1
|
102 |
|
|
`define FPU1_AVAIL 1'b1
|
103 |
|
|
`define FPU2_AVAIL 1'b0
|
104 |
|
|
`define MEM1_AVAIL 1'b1
|
105 |
|
|
`define MEM2_AVAIL 1'b1
|
106 |
|
|
`define MEM3_AVAIL 1'b0
|
107 |
|
|
`define FCU_AVAIL 1'b1
|
108 |
|
|
|
109 |
|
|
// Comment out to remove the write buffer from the core.
|
110 |
|
|
`define HAS_WB 1'b1
|
111 |
|
|
`define WB_DEPTH 5 // must be one more than desired depth
|
112 |
|
|
|
113 |
|
|
// Uncomment to allow SIMD operations
|
114 |
|
|
//`define SIMD 1'b1
|
115 |
|
|
|
116 |
|
|
// Comment the following to disable registering the output of instruction decoders.
|
117 |
|
|
// Inline decoding should not be registered.
|
118 |
|
|
//`define REGISTER_DECODE 1'b1
|
119 |
|
|
`define INLINE_DECODE 1'b1
|