[Libre-soc-dev] Simulator does not like labels?

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed May 19 12:26:04 BST 2021

On Wednesday, May 19, 2021, Lauri Kasanen <cand at gmx.com> wrote:

> Hi,
> Modify any test to contain a label. e.g.
> lfsx 1, 0, 0
> to
> foo: lfsx 1, 0, 0
> and the simulator traps with an illegal opcode.

yes, it will.  it copes with bare instructions only (because that's its
current job: to test bare instructions).

temporarily,  you will need to compute the offset manually if using
listings, we used gotbolt.org for a loop test, you can see it in

to "solve" this what i am going to suggest is:

* write in assembler (including with labels)
* macro-preprocess with svp64asm.py
* compile with gnu-as
* link with a bare metal stub
* use objcopy to extract the binary.

last 3 out of 5 of these steps are *already done* by the Program class.

once i am done with SVP64 sv.stfsu i will start on a command-line tool
which will take optional files containing registers to be pre-initialised,
a data memory and a binary memory.

it will output data memory and register dump so that straight diff can be

estimated 2 days.


crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

More information about the Libre-soc-dev mailing list