| 1 |
/* |
| 2 |
* nextpnr -- Next Generation Place and Route |
| 3 |
* |
| 4 |
* Copyright (C) 2024 The Project Peppercorn Authors. |
| 5 |
* |
| 6 |
* Permission to use, copy, modify, and/or distribute this software for any |
| 7 |
* purpose with or without fee is hereby granted, provided that the above |
| 8 |
* copyright notice and this permission notice appear in all copies. |
| 9 |
* |
| 10 |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 |
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 |
* |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef GATEMATE_EXTRA_DATA_H |
| 21 |
#define GATEMATE_EXTRA_DATA_H |
| 22 |
|
| 23 |
#include "nextpnr.h" |
| 24 |
|
| 25 |
NEXTPNR_NAMESPACE_BEGIN |
| 26 |
|
| 27 |
NPNR_PACKED_STRUCT(struct GateMateTileExtraDataPOD { |
| 28 |
uint8_t die; |
| 29 |
uint8_t bit_x; |
| 30 |
uint8_t bit_y; |
| 31 |
uint8_t tile_x; |
| 32 |
uint8_t tile_y; |
| 33 |
uint8_t prim_id; |
| 34 |
uint16_t dummy; |
| 35 |
}); |
| 36 |
|
| 37 |
NPNR_PACKED_STRUCT(struct GateMatePipExtraDataPOD { |
| 38 |
int32_t name; |
| 39 |
uint8_t bits; |
| 40 |
uint8_t value; |
| 41 |
uint8_t flags; |
| 42 |
uint8_t type; |
| 43 |
uint8_t plane; |
| 44 |
uint8_t dummy1; |
| 45 |
uint16_t dummy2; |
| 46 |
uint32_t block; |
| 47 |
uint32_t resource; |
| 48 |
uint32_t group_index; |
| 49 |
}); |
| 50 |
|
| 51 |
NPNR_PACKED_STRUCT(struct GateMateBelPinConstraintPOD { |
| 52 |
int32_t name; |
| 53 |
int16_t constr_x; |
| 54 |
int16_t constr_y; |
| 55 |
int16_t constr_z; |
| 56 |
int16_t dummy; |
| 57 |
}); |
| 58 |
|
| 59 |
NPNR_PACKED_STRUCT(struct GateMateBelExtraDataPOD { RelSlice<GateMateBelPinConstraintPOD> constraints; }); |
| 60 |
|
| 61 |
NPNR_PACKED_STRUCT(struct GateMatePadExtraDataPOD { |
| 62 |
uint16_t x; |
| 63 |
uint16_t y; |
| 64 |
uint16_t z; |
| 65 |
uint16_t dummy; |
| 66 |
}); |
| 67 |
|
| 68 |
NPNR_PACKED_STRUCT(struct GateMateTimingExtraDataPOD { |
| 69 |
int32_t name; |
| 70 |
TimingValue delay; |
| 71 |
}); |
| 72 |
|
| 73 |
NPNR_PACKED_STRUCT(struct GateMateSpeedGradeExtraDataPOD { RelSlice<GateMateTimingExtraDataPOD> timings; }); |
| 74 |
|
| 75 |
NPNR_PACKED_STRUCT(struct GateMateDieRegionPOD { |
| 76 |
int32_t name; |
| 77 |
uint16_t x1; |
| 78 |
uint16_t y1; |
| 79 |
uint16_t x2; |
| 80 |
uint16_t y2; |
| 81 |
}); |
| 82 |
|
| 83 |
NPNR_PACKED_STRUCT(struct GateMateChipExtraDataPOD { RelSlice<GateMateDieRegionPOD> dies; }); |
| 84 |
|
| 85 |
enum MuxFlags |
| 86 |
{ |
| 87 |
MUX_INVERT = 1, |
| 88 |
MUX_VISIBLE = 2, |
| 89 |
MUX_CONFIG = 4, |
| 90 |
MUX_ROUTING = 8, |
| 91 |
}; |
| 92 |
|
| 93 |
enum PipExtra |
| 94 |
{ |
| 95 |
PIP_EXTRA_MUX = 1, |
| 96 |
}; |
| 97 |
|
| 98 |
enum CPEFunction |
| 99 |
{ |
| 100 |
C_ADDF = 1, |
| 101 |
C_ADDF2 = 2, |
| 102 |
C_MULT = 3, |
| 103 |
C_MX4 = 4, |
| 104 |
C_EN_CIN = 5, |
| 105 |
C_CONCAT = 6, |
| 106 |
C_ADDCIN = 7, |
| 107 |
}; |
| 108 |
|
| 109 |
enum CPE_Z |
| 110 |
{ |
| 111 |
CPE_LT_U_Z = 0, |
| 112 |
CPE_LT_L_Z = 1, |
| 113 |
CPE_FF_U_Z = 2, |
| 114 |
CPE_FF_L_Z = 3, |
| 115 |
CPE_RAMIO_U_Z = 4, |
| 116 |
CPE_RAMIO_L_Z = 5, |
| 117 |
CPE_COMP_Z = 6, |
| 118 |
CPE_CPLINES_Z = 7, |
| 119 |
CPE_LT_FULL_Z = 8, |
| 120 |
CPE_BRIDGE_Z = 9, |
| 121 |
RAM_FULL_Z = 10, |
| 122 |
RAM_HALF_L_Z = 11, |
| 123 |
}; |
| 124 |
|
| 125 |
enum ClusterPlacement |
| 126 |
{ |
| 127 |
PLACE_DB_CONSTR = 32, |
| 128 |
}; |
| 129 |
|
| 130 |
enum PipMask |
| 131 |
{ |
| 132 |
C_SELX = 1 << 0, |
| 133 |
C_SELY1 = 1 << 1, |
| 134 |
C_SELY2 = 1 << 2, |
| 135 |
C_SEL_C = 1 << 3, |
| 136 |
C_SEL_P = 1 << 4, |
| 137 |
C_Y12 = 1 << 5, |
| 138 |
C_CX_I = 1 << 6, |
| 139 |
C_CY1_I = 1 << 7, |
| 140 |
C_CY2_I = 1 << 8, |
| 141 |
C_PX_I = 1 << 9, |
| 142 |
C_PY1_I = 1 << 10, |
| 143 |
C_PY2_I = 1 << 11, |
| 144 |
|
| 145 |
IS_MULT = 1 << 29, |
| 146 |
IS_ADDF = 1 << 30, |
| 147 |
IS_COMP = 1 << 31, |
| 148 |
}; |
| 149 |
|
| 150 |
struct PllCfgRecord |
| 151 |
{ |
| 152 |
double weight; |
| 153 |
double f_core; |
| 154 |
double f_dco; |
| 155 |
double f_core_delta; |
| 156 |
double core_weight; |
| 157 |
int32_t K; |
| 158 |
int32_t N1; |
| 159 |
int32_t N2; |
| 160 |
int32_t M1; |
| 161 |
int32_t M2; |
| 162 |
int32_t PDIV1; |
| 163 |
}; |
| 164 |
|
| 165 |
NEXTPNR_NAMESPACE_END |
| 166 |
|
| 167 |
#endif |