From c3e20f9a256412ccaf00bc160e049cb8747ec949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=9F=B9=E5=AE=B9?= Date: Thu, 20 Jun 2024 16:45:15 +0800 Subject: [PATCH] Fix gen_callback --- pygen/pygen_src/riscv_asm_program_gen.py | 4 ++-- pygen/pygen_src/riscv_callstack_gen.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pygen/pygen_src/riscv_asm_program_gen.py b/pygen/pygen_src/riscv_asm_program_gen.py index aac39ca6..7aa75bff 100644 --- a/pygen/pygen_src/riscv_asm_program_gen.py +++ b/pygen/pygen_src/riscv_asm_program_gen.py @@ -130,7 +130,7 @@ def gen_program(self): if(hart == 0 and not(rcs.support_pmp)): self.gen_test_done() # Shuffle the sub programs and insert to the instruction stream - self.insert_sub_program(self.sub_program[hart], self.instr_stream) + self.insert_sub_program(self.instr_stream) logging.info("Main/sub program generation...done") # program end self.gen_program_end(hart) @@ -229,7 +229,7 @@ def gen_callstack(self, main_program, sub_program, sub_program_name, num_sub_program): if num_sub_program != 0: callstack_gen = riscv_callstack_gen() - self.callstack_gen.init(num_sub_program + 1) + callstack_gen.init(num_sub_program + 1) if callstack_gen.randomize(): idx = 0 # Insert the jump instruction based on the call stack diff --git a/pygen/pygen_src/riscv_callstack_gen.py b/pygen/pygen_src/riscv_callstack_gen.py index 05d8ff8e..a2f6ff33 100644 --- a/pygen/pygen_src/riscv_callstack_gen.py +++ b/pygen/pygen_src/riscv_callstack_gen.py @@ -82,7 +82,7 @@ def init(self, program_cnt): self.program_cnt = program_cnt self.program_h = [0] * program_cnt for i in range(len(self.program_h)): - self.program_h[i] = riscv_program("program_{}".format(i)) + self.program_h[i] = riscv_program() # In the randomization stage, only the stack level of each program is specified. The call stack # generation process is to build the call relationship between different programs. This is