mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 04:44:33 +01:00
(the owner: "dale": JIANT BYTE's CPU technique, byte-cpu-light, in JIANT FM) - usb.c rs_tab: phases 0..79 only (7.5 KiB of the pool back); phases 80..159 read phase 159 - p's taps on the input's history kept newest first too (rs.bl / rs.br, 256 B): the FIR loop as it was (target budget 881 of 838, +5 %), the same products and sums (tests/uac_test.c bit for bit, its table checks through RS_TAB). - app.ld: RAMTEXT 7.5 KiB lower (POOL its 7.5 KiB shorter, its spare as it was: 8448 B); app.ld .hot_text.lo.* and tools/build.py HOT_LO (the lowest of the RAM code: what was there stays): voice_block, mod_begin, mod_voice, tf_run, mc_split, mc_join, drum_side_begin, macro_master, tone_set, lev_block. RAM code 40168 of 42496 (2328 B headroom). - fx.c mc_job: core 1's parts through mix_part_m0, the RAM copy (BYTE's devcpu): its own inlined flash copy gone (3.5 KiB of the image back). - seq.c kx_block: a kit's P_XPR (a GEN DRUM part's 110) no longer runs the pass it never reads (BYTE's devcpu2; the same state each block). Not ported: the UI's canvas halved and drawn in bands (BYTE's devcpu3, its 35 KiB for more RAM code: FM's pages draw far more tall strips; a later step), the SINE quarter table in RAM, CLAY / PFX / LIFE idle shortcuts (FM's differ). The lines model (tests/cpu_lines_test.py, worst block a core, before -> after): 101 GEN EXPLORE s123 + CLOUD/delay/chorus 77/50 -> 60/31 %; 102 59/48 -> 41/30; 103 95/22 -> 78/14; 104 72/48 -> 54/32; 105 84/59 -> 66/40; 0c CPU TEST's song 84/74 -> 70/58. The scenes' sound the same bit for bit (cpu_lines_test hashes before and after); audio.c as V23's. Layout recorded again (FELUCCA_REPIN=keep); the plain build passes. Image 580120 of 584336 (4216 B free), BT segment as before, RAM .data+.bss 97220 of 98304, pool spare 8448. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
95 lines
7.8 KiB
Plaintext
95 lines
7.8 KiB
Plaintext
/* SPDX-License-Identifier: GPL-3.0-only
|
|
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments
|
|
* Portions Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */
|
|
/* FELUCCA memory map.
|
|
* Code + constants execute in place from XIP (app.bin offset 0 = 0x02000120).
|
|
* RAMTEXT (JIANT 0.6.78: at the top of the pool, was 0x01C00000): .ram_text (code that must run while the flash is
|
|
* busy: the flash driver), .c1_text (the second core's loop), .hot_text (core 0's hottest audio code). A call reaches
|
|
* +-4 MiB (pi32v2 imm23 x 2, no long calls in this compiler): RAM code there reaches the whole XIP image (build.py
|
|
* checks the margin); at 0x01C00000 it reached none of it.
|
|
* LOWBUF 0x01C00000..0x01C08000 (0.6.78; 0.6.82: 4 KiB more, the steps grew): main-loop buffers (undo, the song
|
|
* section's stage; the project scratch until 0.8.4 and the fonts' decode tables in 0.8.4, both in the pool since
|
|
* 0.8.5; 0.9.9-beta4: the fonts' tables and the user presets' banks back here, 9 KiB of the pool given to RAMTEXT),
|
|
* zeroed at boot. 0x01C07000..0x01C08000 was kept for RAM-run debug until 0.9.9-beta4 (LOWBUF took it).
|
|
* RAM : .data/.bss (96 KiB)
|
|
* POOL : big zero-initialised buffers (FX lines, canvases), section .pool
|
|
* STACKS with 256-byte guard bands; NOINIT survives resets and UBOOT entry.
|
|
* 0x01C7FD50.. is reserved: boot_info, boot-state mailbox, vector table. */
|
|
MEMORY
|
|
{
|
|
XIP (rx) : ORIGIN = 0x02000120, LENGTH = 0x8EA90 /* = tools/fm1pkg_make.py APP_SLOT (0.9.13: the region ends at 0x92FFE) */
|
|
LOWBUF (rw) : ORIGIN = 0x01C00000, LENGTH = 0x8000
|
|
RAM (rwx) : ORIGIN = 0x01C08000, LENGTH = 96K
|
|
POOL (rw) : ORIGIN = 0x01C20000, LENGTH = 0x4BA00
|
|
RAMTEXT (rwx): ORIGIN = 0x01C6BA00, LENGTH = 0xA600 /* (V10.8.60: 7.5 KiB lower, the USB resampler's table halved,
|
|
* usb.c rs_tab, JIANT BYTE's devcpu2: more of the sound's
|
|
* per-block code in RAM, tools/build.py HOT_LO) (0.6.97, 0.7.0: up 4 KiB each, the image grew: a call from here must
|
|
* reach its end; the user stack 4 KiB shorter each time, 15.75 KiB;
|
|
* 0.9.9-stab, as 0.9.12: 1 KiB lower, from the pool: the 320 MHz switch;
|
|
* 0.9.9-beta4: 9 KiB lower, from the pool (8 KiB of its main-loop
|
|
* buffers moved to LOWBUF): the delay's, the reverbs' and the
|
|
* chorus's block code in RAM, out of the I-cache the engines share) */
|
|
NOINIT (rw) : ORIGIN = 0x01C7C000, LENGTH = 0x3D50
|
|
BTSEG (rx) : ORIGIN = 0x020E6000, LENGTH = 0x12000 /* (V10.12) flash 0xEA000..0xFBFFF (hal/fm1_flash.h FL_EXT_*): the
|
|
* Bluetooth segment, read in place through the plain XIP window */
|
|
PACKED (r) : ORIGIN = 0x02200000, LENGTH = 0x10000 /* (V10.6z5) the load images of .ram_text, .c1_text, .hot_text,
|
|
* .data as linked, never in flash: tools/build.py packs them
|
|
* (LZ4) into the image after .text (_etext), main.c fm1_cstart
|
|
* unpacks them (src/boot_lz4.h). Past the probe link's larger XIP */
|
|
}
|
|
SECTIONS
|
|
{
|
|
/* (V10.12) the Bluetooth segment (firmware/bt/bt_seg.c, its own unit): its header first (bt_seg.c bt_head, filled by
|
|
* tools/build.py), then its code and constants, outside the app slot; written by the update loader from the
|
|
* package's bt.bin (firmware/loader/ldr_core.c), checked by the app before any call (src/bt_hw.c). First here so
|
|
* that no rule below takes its sections; its zeroed RAM goes to the pool (below), its RAM code (.ram_text) with
|
|
* the app's. No initialised data (tools/build.py). (V10.13) then the app's own code and constants kept there (src/bt.c
|
|
* BTAPP_FN / BTAPP_RO: cold, read only once the segment checked) */
|
|
.bt : { _bt_start = .; KEEP(*(.bt_head)) *bt_seg.o(.text .text.* .rodata .rodata.*)
|
|
*(.btapp.text) *(.btapp.rodata) . = ALIGN(4); _bt_end = .; } > BTSEG
|
|
/* (0.9.9-snd3) the code in tools/audio_layout.txt's order, each run of the sound at its recorded address (tools/build.py
|
|
* writes build/layout.ld: the UI cannot move the sound; "cannot move location counter backwards" = the code before a
|
|
* run grew: FELUCCA_REPIN=1), the tables (the sound's first), the merged constants (their small tables, then the
|
|
* strings), the UI's tables that filled no hole (.rodata.n.*), code not in the layout */
|
|
.text : { KEEP(*(.text.crt0)) *(.text) INCLUDE build/layout.ld *(.rodata) *(.rodata.cst*) *(.rodata.str*)
|
|
*(SORT_BY_ALIGNMENT(.rodata.n.*)) *(.text*) *(.rodata*)
|
|
. = ALIGN(4); _etext = .; } > XIP
|
|
.ram_text : { _rt_start = .; KEEP(*(.ram_text*)) . = ALIGN(4); _rt_end = .; } > RAMTEXT AT > PACKED
|
|
_rt_load = LOADADDR(.ram_text);
|
|
/* (JIANT 0.6.71) the second core's waiting loop (hal/fm1_multicore.h): in RAM, after the flash driver, inside the
|
|
* guard's RAM code window (_rt_start .. _c1t_end); its own section, as it calls the jobs (the build's check that
|
|
* .ram_text calls nothing still holds) */
|
|
.c1_text : { _c1t_start = .; KEEP(*(.c1_text*)) . = ALIGN(4); _c1t_end = .; } > RAMTEXT AT > PACKED
|
|
_c1t_load = LOADADDR(.c1_text);
|
|
/* (JIANT 0.6.78) core 0's hottest audio code (tools/build.py HOT_FNS): in RAM after the second core's loop, inside the
|
|
* same RAM code window (_rt_start .. _hot_end) */
|
|
.hot_text : {
|
|
_hot_start = .;
|
|
KEEP(*(.hot_text.lo.*)) /* (V10.8.60, tools/build.py HOT_LO, JIANT BYTE's devcpu3: the lowest, what was before
|
|
* stays where it was) */
|
|
KEEP(*(.hot_text*)) /* (tools/build.py HOT_FNS: their sections renamed in the optimised IR) */
|
|
. = ALIGN(4);
|
|
_hot_end = .;
|
|
} > RAMTEXT AT > PACKED
|
|
_hot_load = LOADADDR(.hot_text);
|
|
/* (V10.31) EUCLID's keep: the sequence a track had before EUCLID transformed it (src/ui_euclid.c eu_bk), RAM data
|
|
* in RAMTEXT's room above the RAM code (not loaded, not zeroed: valid only once eu_bk_k names a track) */
|
|
.eu_keep (NOLOAD) : { . = ALIGN(4); *(.eu_keep*) . = ALIGN(4); } > RAMTEXT
|
|
.data : { . = ALIGN(4); _data_start = .; *(.data*) *(.sdata*) . = ALIGN(4); _data_end = .; } > RAM AT > PACKED
|
|
_data_load = LOADADDR(.data);
|
|
/* (V10.12) the Bluetooth segment's RAM in the pool, but its baseband block (ble_hw_wl82.c bb, 1508 B, read and
|
|
* written by the radio's DMA) here, in the RAM every DMA reaches */
|
|
.bss (NOLOAD) : { _bss_start = .; *(EXCLUDE_FILE(*bt_seg.o) .bss*) *(EXCLUDE_FILE(*bt_seg.o) .sbss*)
|
|
*(EXCLUDE_FILE(*bt_seg.o) COMMON) *bt_seg.o(.bss.bb) . = ALIGN(4); _bss_end = .; } > RAM
|
|
.pool (NOLOAD) : { _pool_start = .; *(.pool) *(.pool.*) *bt_seg.o(.bss* .sbss* COMMON) . = ALIGN(4); _pool_end = .; } > POOL
|
|
/* (JIANT 0.6.71) the second core's stacks (hal/fm1_multicore.h): 6 KiB for the render, 1 KiB for an exception */
|
|
.c1_stacks (NOLOAD) : { . = ALIGN(32); _c1_stack_lo = .; . += 7168; _c1_stack_hi = .; } > POOL
|
|
_c1_ustack_top = _c1_stack_lo + 6144;
|
|
_c1_sstack_top = _c1_stack_hi;
|
|
.lowbuf (NOLOAD) : { _low_start = .; *(.lowbuf*) . = ALIGN(4); _low_end = .; } > LOWBUF
|
|
.noinit (NOLOAD) : { *(.noinit) *(.noinit.*) } > NOINIT /* (V10.12: .noinit.* after: none of the others moves) */
|
|
_guard0 = 0x01C76000; _ustack_lo = 0x01C76100; _ustack_top = 0x01C7A000;
|
|
_guard1 = 0x01C7A000; _sstack_lo = 0x01C7A100; _sstack_top = 0x01C7C000;
|
|
/DISCARD/ : { *(.comment) *(.note*) }
|
|
}
|