Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecall hangup in _exit() #5

Open
kamiyaowl opened this issue May 1, 2019 · 0 comments
Open

ecall hangup in _exit() #5

kamiyaowl opened this issue May 1, 2019 · 0 comments

Comments

@kamiyaowl
Copy link
Owner

pc: 67132: 0x1063c
inst: 115: 0b1110011 // rv32i命令セットには含まれてない

Assert on...

        template<typename DATA, typename ADDR>
        class Alu {
            protected:
            public:
            void reset() {}
            void run(Reg<DATA>& reg, Mem<DATA, ADDR>& mem, DATA instruction) {
                uint64_t inst = static_cast<uint64_t>(instruction);
                // opで検索
                uint8_t opcode = (inst >> 0) & 0x7f;
                vector<Inst<DATA, ADDR>> filter_op;
                std::copy_if(instructions.begin(), instructions.end(), std::back_inserter(filter_op), [&opcode](const Inst<DATA, ADDR>& i) {
                    return opcode == i.opcode;
                });
                assert(filter_op.size() > 0); // ***** failure *****

assembly

riscv-objdump_1   | _exit():
riscv-objdump_1   | 00010624 <_exit> li a1,0
riscv-objdump_1   | 00010628 <_exit+0x4> li     a2,0
riscv-objdump_1   | 0001062c <_exit+0x8> li     a3,0
riscv-objdump_1   | 00010630 <_exit+0xc> li     a4,0
riscv-objdump_1   | 00010634 <_exit+0x10> li    a5,0
riscv-objdump_1   | 00010638 <_exit+0x14> li    a7,93
riscv-objdump_1   | 0001063c <_exit+0x18> ecall // ***** failure *****
riscv-objdump_1   | 00010640 <_exit+0x1c> bgez  a0,00010664 <_exit+0x40>
riscv-objdump_1   | 00010644 <_exit+0x20> addi  sp,sp,-16
riscv-objdump_1   | 00010648 <_exit+0x24> sw    s0,8(sp)
riscv-objdump_1   | 0001064c <_exit+0x28> mv    s0,a0
riscv-objdump_1   | 00010650 <_exit+0x2c> sw    ra,12(sp)
riscv-objdump_1   | 00010654 <_exit+0x30> neg   s0,s0
riscv-objdump_1   | 00010658 <_exit+0x34> jal   ra,00010668 <__errno>
riscv-objdump_1   | 0001065c <_exit+0x38> sw    s0,0(a0)
riscv-objdump_1   | 00010660 <_exit+0x3c> j     00010660 <_exit+0x3c>
riscv-objdump_1   | 00010664 <_exit+0x40> j     00010664 <_exit+0x40>
riscv-objdump_1   | __errno():
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant