Commit a2fb2e4
committed
Mangle buffer names in MchanDma chunked-1D fallback
When a contiguous DMA transfer exceeds the 17-bit mchan command-size
field, the fallback splits it into `_MAX_1D_TRANSFER_BYTES` chunks and
emits one mchan_transfer_1d(cmd, loc, ext) per chunk. The opRepr
values were built with `f"((char*){buf.name} + {offset})"`, but
ExecutionBlock._mangleOpRepr only rewrites values that ctxt.is_buffer()
recognises — a formatted string slips through unchanged, so the emitted
C refers to `TILING_CODEGEN_L1_foo_ref` while the declaration is
`DeeployNetwork_TILING_CODEGEN_L1_foo_ref`.
Seen on ResNet8 tiled L1>=200KB L3 for layer3.conv2: the 147456-byte
weight load splits into 131072+16384, and clang fails with "use of
undeclared identifier 'TILING_CODEGEN_L1_node_23_..._weight_ref'".
Fix: call ctxt._mangle() on the buffer names once before the chunking
loop so the emitted strings match the declared variables. The same
bug is present in the GAP9 MchanDma port — patch both.
This was blocking end-to-end gvsoc runs for any configuration whose
weight tiles exceed 128KB.1 parent d3fa7a1 commit a2fb2e4
2 files changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
115 | | - | |
| 120 | + | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
100 | | - | |
101 | | - | |
| 110 | + | |
| 111 | + | |
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
| |||
0 commit comments