@@ -23,43 +23,15 @@ static void writeLDScriptMap(raw_ostream &output, BufferOp buf, int offset) {
23
23
output << " . += 0x" << llvm::utohexstr (numBytes) << " ;\n " ;
24
24
}
25
25
26
- // /// ld.script format:
27
- //
28
- // MEMORY
29
- // {
30
- // program (RX) : ORIGIN = 0, LENGTH = 0x0020000
31
- // data (!RX) : ORIGIN = 0x20000, LENGTH = 0x0020000
32
- // }
33
- // ENTRY(_main_init)
34
- // INPUT(something.o)
35
- // SECTIONS
36
- // {
37
- // . = 0x0;
38
- // .text : {
39
- // // the __start symbol from crt0.o has to come at address zero.
40
- // *crt0.o(.text)
41
- // . = 0x200;
42
- // *(.text)
43
- // } > program
44
- // .data : { *(.data) } > data
45
- // . = 0x20000;
46
- // _sp_start_value_DM_stack = .;
47
- // . = 0x24000;
48
- // a = .;
49
- // . += 1024;
50
- // .bss : { *(.bss) } > data
51
- // }
52
26
LogicalResult mlir::iree_compiler::AMDAIE::AIETranslateToLdScript (
53
27
DeviceOp deviceOp, raw_ostream &output, int tileCol, int tileRow) {
54
28
DenseMap<TileLoc, Operation *> tiles;
55
29
DenseMap<Operation *, SmallVector<BufferOp, 4 >> buffers;
56
30
57
-
58
31
collectTiles (deviceOp, tiles);
59
32
::collectBuffers (deviceOp, buffers);
60
33
61
- AMDAIEDeviceModel deviceModel =
62
- getDeviceModel (static_cast <AMDAIEDevice>(deviceOp.getDevice ()));
34
+ AMDAIEDeviceModel deviceModel = getDeviceModel (deviceOp.getDevice ());
63
35
for (auto tile : deviceOp.getOps <TileOp>())
64
36
if (tile.getCol () == tileCol && tile.getRow () == tileRow) {
65
37
TileLoc srcCoord = {tile.getCol (), tile.getRow ()};
@@ -95,9 +67,33 @@ SECTIONS
95
67
*(.data*);
96
68
*(.rodata*)
97
69
} > data
70
+ .comment : {
71
+ *(.comment*)
72
+ }
73
+ .symtab : {
74
+ *(.symtab)
75
+ }
76
+ .shstrtab : {
77
+ *(.shstrtab)
78
+ }
79
+ .strtab : {
80
+ *(.strtab)
81
+ }
82
+ .tctmemtab : {
83
+ *(.tctmemtab)
84
+ }
85
+ .rtstab : {
86
+ *(.rtstab)
87
+ }
88
+ .eoltab : {
89
+ *(.eoltab)
90
+ }
91
+ .chesstypeannotationtab : {
92
+ *(.chesstypeannotationtab)
93
+ }
98
94
)THESCRIPT" ;
99
95
auto doBuffer = [&](std::optional<TileLoc> tile, int offset,
100
- const std::string& dir) {
96
+ const std::string & dir) {
101
97
if (tile) {
102
98
if (tiles.count ({tile->col , tile->row }))
103
99
for (auto buf : buffers[tiles[{tile->col , tile->row }]])
@@ -132,7 +128,6 @@ SECTIONS
132
128
deviceModel.getMemEastBaseAddress (), std::string (" east" ));
133
129
134
130
output << " .bss : { *(.bss) } > data\n " ;
135
- output << " .bss.DMb.4 : { *(.bss.DMb.4) } > data\n " ;
136
131
output << " }\n " ;
137
132
if (auto coreOp = getCoreOp (tile)) {
138
133
output << " PROVIDE(main = core_" << std::to_string (tile.getCol ()) << " _"
0 commit comments