Bug 1156 - Verilator compile flag testing
Summary: Verilator compile flag testing
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Sadoon Albader
Depends on:
Reported: 2023-09-10 16:57 BST by Sadoon Albader
Modified: 2023-09-10 17:53 BST (History)
2 users (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Note You need to log in before you can comment on or make changes to this bug.
Description Sadoon Albader 2023-09-10 16:57:45 BST

Comment 1 Sadoon Albader 2023-09-10 17:04:27 BST
Some testing was done with verilator's compile flags to measure if there is any performance left on the table without modifying verilator's source code.

These flags were applied as "CFLAGS" in addition to "-O3" which was already applied.

`-mcpu=native -mtune=native`

These flags were applied as verilator flags as well

`--threads-dpi all --x-initial fast`

Tests were made with `THREADS = 3` (other numbers showed worse results, thanks Andrey) and produced the following results:

`verilator_trace` branch: 83m17s to boot linux-microwatt-5.7 (to the login prompt)
`optimizations` branch: 83m53s to boot linux-microwatt-5.7 (to the login prompt)

Both tests were done on an Acer Swift 5 with an Intel i7 1260P (performance cpupower setting).

Conclusion: there is no measurable benefit to using any of these flags, and reading through verilator's manpage; it seems there are no other flags that can affect performance. We need to modify verilator's source code to have any speed ups.
Comment 2 Sadoon Albader 2023-09-10 17:08:37 BST
Relevant IRC chat logs:

- Verilator is using 31% of resources for thread synchronization, this leaves a lot of performance on the table

- Test results showing no performance benefit

- Andrey recommending `THREADS = 3`
Comment 3 Sadoon Albader 2023-09-10 17:53:54 BST