nac3core: fix #84 #146

Merged
pca006132 merged 1 commits from fix_84 into master 2021-12-23 15:28:29 +08:00

This patch adds size type to code generator struct and use CSlice representation for arrays. This is required before implementing RPC.

This is not yet tested on the device.

This patch adds size type to code generator struct and use CSlice representation for arrays. This is required before implementing RPC. This is not yet tested on the device.

This is not yet tested on the device.

You can test it on 192.168.1.70, it's a Kasli 1 (riscv32ima) and ready to receive NAC3 kernels.

> This is not yet tested on the device. You can test it on 192.168.1.70, it's a Kasli 1 (riscv32ima) and ready to receive NAC3 kernels.
pca006132 force-pushed fix_84 from 418e2ff5a7 to 0902d8adf4 2021-12-23 15:27:07 +08:00 Compare

Tested with 64 bit runtime on host. It should be fine with 32 bit. (I can only forget to replace some of the 32 bits type into 64 bits not vice versa)

Tested with 64 bit runtime on host. It should be fine with 32 bit. (I can only forget to replace some of the 32 bits type into 64 bits not vice versa)
pca006132 merged commit 6e85f549f6 into master 2021-12-23 15:28:29 +08:00

This breaks ARTIQ so I have reverted it. With this patch the nac3devices demo fails with:

arr_str_ptr: PointerValue { ptr_value: Value { name: "tmparrstr", address: 0x7f302400b350, is_const: false, is_null: false, is_undef: false, llvm_value: "  %tmparrstr = alloca { double*, i32 }, align 8", llvm_type: "{ double*, i32 }*" } }
arr_str_ptr: PointerValue { ptr_value: Value { name: "tmparrstr5", address: 0x7f302408d3f0, is_const: false, is_null: false, is_undef: false, llvm_value: "  %tmparrstr5 = alloca { i32*, i32 }, align 8", llvm_type: "{ i32*, i32 }*" } }
arr_str_ptr: PointerValue { ptr_value: Value { name: "tmparrstr", address: 0x7f3010049da0, is_const: false, is_null: false, is_undef: false, llvm_value: "  %tmparrstr = alloca { i32*, i32 }, align 8", llvm_type: "{ i32*, i32 }*" } }
thread '<unnamed>' panicked at 'Found IntValue(IntValue { int_value: Value { name: "load8", address: 0x7f301808f8a0, is_const: false, is_null: false, is_undef: false, llvm_value: "  %load8 = load i32, i32* %gep7, align 4", llvm_type: "i32" } }) but expected PointerValue variant', /build/cargo-vendor-dir/inkwell-0.1.0-beta.4/src/values/enums.rs:285:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Got an unknown error: Any { .. }
thread '<unnamed>' panicked at 'Found IntValue(IntValue { int_value: Value { name: "load24", address: 0x7f302801abe0, is_const: false, is_null: false, is_undef: false, llvm_value: "  %load24 = load i32, i32* %gep23, align 4", llvm_type: "i32" } }) but expected PointerValue variant', /build/cargo-vendor-dir/inkwell-0.1.0-beta.4/src/values/enums.rs:285:13
Got an unknown error: Any { .. }
thread '<unnamed>' panicked at 'Found PointerValue(PointerValue { ptr_value: Value { name: "load3", address: 0x7f3010082790, is_const: false, is_null: false, is_undef: false, llvm_value: "  %load3 = load i32*, i32** %gep, align 8", llvm_type: "i32*" } }) but expected the IntValue variant', /build/cargo-vendor-dir/inkwell-0.1.0-beta.4/src/values/enums.rs:269:13
Got an unknown error: Any { .. }
This breaks ARTIQ so I have reverted it. With this patch the nac3devices demo fails with: ``` arr_str_ptr: PointerValue { ptr_value: Value { name: "tmparrstr", address: 0x7f302400b350, is_const: false, is_null: false, is_undef: false, llvm_value: " %tmparrstr = alloca { double*, i32 }, align 8", llvm_type: "{ double*, i32 }*" } } arr_str_ptr: PointerValue { ptr_value: Value { name: "tmparrstr5", address: 0x7f302408d3f0, is_const: false, is_null: false, is_undef: false, llvm_value: " %tmparrstr5 = alloca { i32*, i32 }, align 8", llvm_type: "{ i32*, i32 }*" } } arr_str_ptr: PointerValue { ptr_value: Value { name: "tmparrstr", address: 0x7f3010049da0, is_const: false, is_null: false, is_undef: false, llvm_value: " %tmparrstr = alloca { i32*, i32 }, align 8", llvm_type: "{ i32*, i32 }*" } } thread '<unnamed>' panicked at 'Found IntValue(IntValue { int_value: Value { name: "load8", address: 0x7f301808f8a0, is_const: false, is_null: false, is_undef: false, llvm_value: " %load8 = load i32, i32* %gep7, align 4", llvm_type: "i32" } }) but expected PointerValue variant', /build/cargo-vendor-dir/inkwell-0.1.0-beta.4/src/values/enums.rs:285:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Got an unknown error: Any { .. } thread '<unnamed>' panicked at 'Found IntValue(IntValue { int_value: Value { name: "load24", address: 0x7f302801abe0, is_const: false, is_null: false, is_undef: false, llvm_value: " %load24 = load i32, i32* %gep23, align 4", llvm_type: "i32" } }) but expected PointerValue variant', /build/cargo-vendor-dir/inkwell-0.1.0-beta.4/src/values/enums.rs:285:13 Got an unknown error: Any { .. } thread '<unnamed>' panicked at 'Found PointerValue(PointerValue { ptr_value: Value { name: "load3", address: 0x7f3010082790, is_const: false, is_null: false, is_undef: false, llvm_value: " %load3 = load i32*, i32** %gep, align 8", llvm_type: "i32*" } }) but expected the IntValue variant', /build/cargo-vendor-dir/inkwell-0.1.0-beta.4/src/values/enums.rs:269:13 Got an unknown error: Any { .. } ```
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#146
There is no content yet.