Debian Codegraph @

himbaechel/uarch/xilinx/extra_data.h

raw
1 #ifndef XILINX_EXTRA_DATA_H
2 #define XILINX_EXTRA_DATA_H
3
4 #include "nextpnr.h"
5
6 NEXTPNR_NAMESPACE_BEGIN
7
8 NPNR_PACKED_STRUCT(struct XlnxBelExtraDataPOD { int32_t name_in_site; });
9
10 struct BelSiteKey
11 {
12 int16_t site;
13 int16_t site_variant;
14 inline static BelSiteKey unpack(uint32_t s)
15 {
16 BelSiteKey result;
17 result.site_variant = (s & 0xFF);
18 result.site = (s >> 8) & 0xFFFF;
19 return result;
20 };
21 };
22
23 enum XlnxPipType
24 {
25 PIP_TILE_ROUTING = 0,
26 PIP_SITE_ENTRY = 1,
27 PIP_SITE_EXIT = 2,
28 PIP_SITE_INTERNAL = 3,
29 PIP_LUT_PERMUTATION = 4,
30 PIP_LUT_ROUTETHRU = 5,
31 PIP_CONST_DRIVER = 6,
32 };
33
34 NPNR_PACKED_STRUCT(struct XlnxPipExtraDataPOD {
35 int32_t site_key;
36 int32_t bel_name;
37 int32_t pip_config;
38 });
39
40 enum class PipClass
41 {
42 PIP_TILE_ROUTING = 0,
43 PIP_SITE_ENTRY = 1,
44 PIP_SITE_EXIT = 2,
45 PIP_SITE_INTERNAL = 3,
46 PIP_LUT_PERMUTATION = 4,
47 PIP_LUT_ROUTETHRU = 5,
48 PIP_CONST_DRIVER = 6,
49 };
50
51 NPNR_PACKED_STRUCT(struct SiteInstPOD {
52 int32_t name_prefix;
53 int16_t site_x, site_y; // absolute site coords
54 int16_t rel_x, rel_y; // coords in tiles
55 int16_t int_x, int_y; // associated interconnect coords
56 RelSlice<int32_t> variants;
57 });
58
59 NPNR_PACKED_STRUCT(struct XlnxTileInstExtraDataPOD {
60 int32_t name_prefix;
61 int16_t tile_x, tile_y;
62 RelSlice<SiteInstPOD> sites;
63 });
64
65 // LSnibble of Z: function
66 // MSnibble of Z: index in CLB (A-H)
67 enum LogicBelTypeZ
68 {
69 BEL_6LUT = 0x0,
70 BEL_5LUT = 0x1,
71 BEL_FF = 0x2,
72 BEL_FF2 = 0x3,
73 BEL_FFMUX1 = 0x4,
74 BEL_FFMUX2 = 0x5,
75 BEL_OUTMUX = 0x6,
76 BEL_F7MUX = 0x7,
77 BEL_F8MUX = 0x8,
78 BEL_F9MUX = 0x9,
79 BEL_CARRY8 = 0xA,
80 BEL_CLKINV = 0xB,
81 BEL_RSTINV = 0xC,
82 BEL_HARD0 = 0xD,
83 BEL_CARRY4 = 0xF
84 };
85
86 enum BRAMBelTypeZ
87 {
88 BEL_RAMFIFO36 = 0,
89 BEL_RAM36 = 1,
90 BEL_FIFO36 = 2,
91
92 BEL_RAM18_U = 5,
93
94 BEL_RAMFIFO18_L = 8,
95 BEL_RAM18_L = 9,
96 BEL_FIFO18_L = 10,
97 };
98
99 enum DSP48E1BelTypeZ
100 {
101 BEL_LOWER_DSP = 6,
102 BEL_UPPER_DSP = 25,
103 };
104
105 NEXTPNR_NAMESPACE_END
106
107 #endif