überSpark: add CASM JSON definitions for armv8-a cortex-a53 32-bit CPU HWM

This task is very similar to the following task: überSpark: add CASM JSON definitions for x86 32-bit CPU HWM

This will add next-gen tool-chain support for JSON based CASM instruction definitions for the armv8-a cortex-a53 32-bit CPU HWM. Specifically, we will be enhancing the
the überSpark manifest found here: https://github.com/uberspark/uberspark/blob/develop/src-nextgen/hwm/cpu/armv8-a/32-bit/cortex-a53/uberspark.json

The following are the proposed subtasks:

  1. Ensure your fork of uberspark.git is up to date with the upstream uberspark.git repository. The following commands can achieve this on a local checkout of your fork.

    git remote add upstream https://github.com/uberspark/uberspark.git
    git fetch -a upstream  
    git checkout develop 
    git pull upstream develop 
    git push origin develop
  2. Build and install the uberspark tool-chain as detailed here: uberspark/install.rst at develop · uberspark/uberspark · GitHub

  3. Create a feature branch on your fork off the develop branch. Name it feature-cpu-hwm-casm-armv8a-32bit-cortex-a53

  4. Revise: https://github.com/uberspark/uberspark/blob/develop/src-nextgen/hwm/cpu/armv8-a/32-bit/cortex-a53/uberspark.json to add a new JSON array node for CASM instruction definitions as below:

     "uberspark.hwm.cpu.casm_instructions" : [ 
        "casm_mnemonic" : "<casm_mnemonic>", 
        "casm_total_operands": "<casm_total_operarands>",
        "casm_implementation" : "<casm_implementation>",
        "output_assembly" : "<output_assembly>"

    Note that the there can be multiple records within this array definition each defining a unique CASM instruction. Each record will basically be constructed using the contents of the CASM instruction macros as definied in: https://github.com/uberspark/uberspark/blob/develop/src-nextgen/hwm/cpu/armv7-a/32-bit/generic/include/cpu.h

Working branches;



Hi @amitvasudevan . Just want to make sure. Is this task about armv7 or armv8? I realize I am taking the hardware model of v7 and putting it into the JSON file of v8.

Am I suppose to modify the JSON for v7 here instead? Thanks!

No, you will modify JSON for v8. The implementation is present in the v7 folder because v8 borrows a lot of functionality from v7. Hope that makes sense. Thanks!

1 Like

Hi @amitvasudevan , I just made the PR. Please have a look! Thanks!
For those without casm implementation https://github.com/uberspark/uberspark/blob/d6b153ae90511cee6730be9762ebdbb87941352c/src-nextgen/hwm/cpu/armv7-a/32-bit/generic/include/cpu.h#L309-L340
I just add _impl__ before the name e.g.,

            "casm_mnemonic" : "__casm__dmb_ish",
            "casm_total_operands" : "0",
            "output_assembly" : [
                "dmb ish"
            "casm_implementation" : [

There are also some without assembly https://github.com/uberspark/uberspark/blob/d6b153ae90511cee6730be9762ebdbb87941352c/src-nextgen/hwm/cpu/armv7-a/32-bit/generic/include/cpu.h#L297-L305
For these, I used ret as the assembly instruction.
Let me know what you think. Thanks!

Hi @zhang-zichao ,

You can leave the casm_implementation array empty in this case.

"casm_implementation" : [

Same as above, but leave output_assembly field empty as below:

"output_assembly" : [

Let me know when you have the revised PR in and I can take a look and merge :). Thanks!

Done. Please have a look. Thanks @amitvasudevan !

Merged PR upstream. Added PR and merge information to OP. Closing topic thread. Thanks @zhang-zichao !