Assembler listing

General discussion about anything related to Ultibo.
rvanspaa
Posts: 24
Joined: Sat Nov 11, 2017 3:04 am

Assembler listing

Postby rvanspaa » Fri Jul 05, 2019 10:03 pm

Hi,

Is there a way to compile Ulibo such that assembly listings are produced for all modules. I would like to count the number of assembler instructions involved in servicing an interrupt.
User avatar
Ultibo
Site Admin
Posts: 2261
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Assembler listing

Postby Ultibo » Fri Jul 05, 2019 11:59 pm

rvanspaa wrote:Is there a way to compile Ulibo such that assembly listings are produced for all modules. I would like to count the number of assembler instructions involved in servicing an interrupt.

Hi rvanspaa,

There are two possible ways to get an assembly listing, FPC supports passing -a on the command line which tells it not to delete the generated assembly file (.s) for each unit being compiled. You can try adding this during a build of the Ultibo RTL to get a listing for each of the core units, while you can't add anything to the command line using the Build RTL tool you will find a __buildrtl.bat in the source directory after running Build RTL which is the actual script used to perform the build. Try adding the -a option to the CROSSOPT= part of the make rtl line and then run the batch file manually (ie not from Build RTL).

The other option is to use arm-ultibo-objdump on your compiled project to generate an assembly dump from the final code, if your project is called MyProject.lpr then the command line would be something like this:

Code: Select all

arm-ultibo-objdump -d MyProject.elf > kernel7.list

Experiment with both options and see which works best for you.
Ultibo.org | Make something amazing
https://ultibo.org
rvanspaa
Posts: 24
Joined: Sat Nov 11, 2017 3:04 am

Re: Assembler listing

Postby rvanspaa » Sat Jul 06, 2019 1:07 am

Thanks, that helps, but it looks like it's going to be a tough row to hoe. Is there somewhere I can get an overview of what's involved? I.e. which modules are called and in what order? A diagram with procedure names included would be really useful. IOW something like a flow chart.
User avatar
Ultibo
Site Admin
Posts: 2261
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Assembler listing

Postby Ultibo » Sat Jul 06, 2019 8:07 am

rvanspaa wrote:Thanks, that helps, but it looks like it's going to be a tough row to hoe. Is there somewhere I can get an overview of what's involved? I.e. which modules are called and in what order? A diagram with procedure names included would be really useful. IOW something like a flow chart.

Hi again,

The actual path isn't very long and is easy enough to follow once you know the starting point.

The exact functions called depend on the model of board in use but taking the now commonly used Raspberry Pi 3 as an example the chain of functions called would look like this (note, a search of the GitHub repo or the Ultibo wiki will quickly locate the units that these functions can be found in):

  • ARMv8IRQHandler (called directly from the ARM interrupt vector table, this function does include a reasonable number of comments to describe what it is doing)
  • ARMv8DispatchIRQ (this is one of many replaceable functions in Ultibo, on the Pi 3 it will actually call RPi3DispatchIRQ)
  • RPi3DispatchIRQ (this function is responsible for determining which interrupt occurred and on what CPU)
  • RPi3HandleIRQ (this one actually calls the registered handler to process the interrupt for the specific device)
From that point the device specific interrupt handler will be called based on which interrupt occurred, a couple of examples would be BCM2710UART0InterruptHandler for the PL011 UART or BCM2710ARMTimerInterruptHandler for the ARM timer device.

That should give you somewhere to start, feel free to ask any specific questions you run into.
Ultibo.org | Make something amazing
https://ultibo.org

Return to “Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests