Skip to content

Commit

Permalink
Log unused instructions, too (#817)
Browse files Browse the repository at this point in the history
It's useful to see which Risc-V instructions aren't used at all when
running eg sproll-evm.
  • Loading branch information
matthiasgoergens authored Jan 9, 2025
1 parent b60c6fe commit dfce3af
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ceno_zkvm/src/instructions/riscv/rv32im.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ use ceno_emul::{
};
use ecall::EcallDummy;
use ff_ext::ExtensionField;
use itertools::Itertools;
use itertools::{Itertools, izip};
use mul::{MulInstruction, MulhInstruction, MulhsuInstruction};
use shift::SraInstruction;
use slt::{SltInstruction, SltuInstruction};
use slti::SltiuInstruction;
use std::collections::{BTreeMap, BTreeSet};
use std::{
cmp::Reverse,
collections::{BTreeMap, BTreeSet},
};
use strum::IntoEnumIterator;

use super::{
Expand Down Expand Up @@ -337,14 +340,10 @@ impl<E: ExtensionField> Rv32imConfig<E> {
}
});

for (insn_kind, (_, records)) in InsnKind::iter()
.zip(all_records.iter())
.sorted_by(|a, b| Ord::cmp(&a.1.1.len(), &b.1.1.len()))
.rev()
for (insn_kind, (_, records)) in
izip!(InsnKind::iter(), &all_records).sorted_by_key(|(_, (_, a))| Reverse(a.len()))
{
if !records.is_empty() {
tracing::info!("tracer generated {:?} {} records", insn_kind, records.len());
}
tracing::info!("tracer generated {:?} {} records", insn_kind, records.len());
}

macro_rules! assign_opcode {
Expand Down

0 comments on commit dfce3af

Please sign in to comment.