def generate(self, **kwargs): choices_mod = ChoicesModifier(self.genThread) for _ in range(10): # Generate instructions with the default choices settings # except for the paging choices for "Page size#4K # granule#S#stage 1" which was set before this generate was called # via the GenThreadInitialization below. for _ in range(20): if self.getGlobalState("AppRegisterWidth") == 32: instr = self.pickWeighted(RV32_G_instructions) else: instr = self.pickWeighted(RV_G_instructions) self.genInstruction(instr) # Modify the choices settings choices_mod.modifyOperandChoices( "Rounding mode", {"RNE": 0, "RTZ": 0, "RDN": 50, "RUP": 0, "RMM": 0, "DYN": 50}, ) choices_mod.modifyOperandChoices( "Read after write address reuse", {"No reuse": 50, "Reuse": 50} ) choices_mod.commitSet() # generate instructions for _ in range(20): if self.getGlobalState("AppRegisterWidth") == 32: instr_mix = {RV32F_map: 10, LDST32_All_map: 10} else: instr_mix = {ALU_Float_All_map: 10, LDST_All_map: 10} instr = self.pickWeighted(instr_mix) self.genInstruction(instr) # undo the choices settings - revert back to prior choices_mod.revert()
def generate(self, **kwargs): choices_mod = ChoicesModifier(self.genThread) for _ in range(10): # Generate instructions with the default choices settings # except for the paging choices for "Page size#4K # granule#S#stage 1" which was set before this generate was called # via the GenThreadInitialization below. self._gen_rv_g_instructions() # Modify the choices settings choices_mod.modifyOperandChoices( "Rounding mode", { "RNE": 0, "RTZ": 0, "RDN": 50, "RUP": 0, "RMM": 0, "DYN": 50 }, ) choices_mod.modifyOperandChoices("Read after write address reuse", { "No reuse": 50, "Reuse": 50 }) choices_mod.commitSet() # generate instructions self._gen_data_processing_and_load_store_instructions() # undo the choices settings - revert back to prior choices_mod.revert()