-
Notifications
You must be signed in to change notification settings - Fork 143
Optimize function layout in hps_accel project #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
INCLUDE output_format.ld | ||
ENTRY(_start) | ||
|
||
__DYNAMIC = 0; | ||
|
||
INCLUDE regions.ld | ||
|
||
|
||
SECTIONS | ||
{ | ||
.text : | ||
{ | ||
_ftext = .; | ||
*(.text.start) | ||
/* Place the ConvPerChannel4x4() and LoadInput() functions sequentially | ||
* to prevent one from evicting the other from the instruction cache. */ | ||
*/conv_accel.o(.text.*ConvPerChannel4x4*) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this file may have mixed spaces and tabs for indents, it would be good to fix that up for clarity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, but first let's decide whether this linker script should be here at all. |
||
*/blocks.o(.text.*LoadInput*) | ||
*(.text .stub .text.* .gnu.linkonce.t.*) | ||
_etext = .; | ||
} > main_ram | ||
/*} > rom */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm why are these commented out? Actually now that I think about it, it looks like this linker script is correct for Arty (where we run the whole CFU-Playground application from RAM) but won't work on HPS boards (where we run the application from flash)? I guess for HPS boards you have to uncomment these lines instead, right? Is there a way we can have a single linker script that will place things in the right regions in all cases? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This linker script is essentially copy-pasted from |
||
|
||
.rodata : | ||
{ | ||
. = ALIGN(8); | ||
_frodata = .; | ||
*(.rodata .rodata.* .gnu.linkonce.r.*) | ||
*(.rodata1) | ||
*(.srodata .srodata.*) | ||
. = ALIGN(8); | ||
_erodata = .; | ||
} > main_ram | ||
/*} > rom */ | ||
|
||
.data : AT (ADDR(.rodata) + SIZEOF (.rodata)) | ||
{ | ||
. = ALIGN(8); | ||
_fdata = .; | ||
*(.data .data.* .gnu.linkonce.d.*) | ||
*(.data1) | ||
*(.ramtext .ramtext.*) | ||
_gp = ALIGN(16); | ||
*(.sdata .sdata.* .gnu.linkonce.s.* .sdata2 .sdata2.*) | ||
_edata = ALIGN(16); /* Make sure _edata is >= _gp. */ | ||
} > main_ram | ||
/*} > sram */ | ||
|
||
.bss : AT (ADDR(.data) + SIZEOF (.data)) | ||
{ | ||
. = ALIGN(16); | ||
_fbss = .; | ||
*(.dynsbss) | ||
*(.sbss .sbss.* .gnu.linkonce.sb.*) | ||
*(.scommon) | ||
*(.dynbss) | ||
*(.bss .bss.* .gnu.linkonce.b.*) | ||
*(COMMON) | ||
. = ALIGN(8); | ||
_ebss = .; | ||
_end = .; | ||
} > main_ram | ||
/*} > sram */ | ||
} | ||
|
||
PROVIDE(_fstack = ORIGIN(main_ram) + LENGTH(main_ram) - 4); | ||
/* PROVIDE(_fstack = ORIGIN(sram) + LENGTH(sram) - 4); */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the copyright header to this file? Just grab it from one of the others. "Copyright the CFU-Playground authors" etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I no longer think that providing custom linker scripts for each project is a viable solution, so this file will probably be removed. Please see my latest comments for an alternative approach.