mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 00:33:06 +00:00
fixes
This commit is contained in:
parent
d6983951a4
commit
29fa32465c
@ -225,6 +225,16 @@ mod tests {
|
||||
.filter(|&o| memory_trace[memory::registers::is_memop(o)].values[i] == F::ONE)
|
||||
.collect_vec()[0];
|
||||
|
||||
if mem_timestamp != last_timestamp {
|
||||
current_cpu_index += 1;
|
||||
last_timestamp = mem_timestamp;
|
||||
}
|
||||
|
||||
dbg!(i);
|
||||
dbg!(mem_timestamp);
|
||||
dbg!(current_cpu_index);
|
||||
dbg!(op);
|
||||
|
||||
cpu_trace_rows[current_cpu_index][cpu::columns::uses_memop(op)] = F::ONE;
|
||||
cpu_trace_rows[current_cpu_index][cpu::columns::CLOCK] = clock;
|
||||
cpu_trace_rows[current_cpu_index][cpu::columns::memop_is_read(op)] =
|
||||
@ -240,10 +250,6 @@ mod tests {
|
||||
memory_trace[memory::registers::value_limb(j)].values[i];
|
||||
}
|
||||
|
||||
if mem_timestamp != last_timestamp {
|
||||
current_cpu_index += 1;
|
||||
last_timestamp = mem_timestamp;
|
||||
}
|
||||
}
|
||||
trace_rows_to_poly_values(cpu_trace_rows)
|
||||
}
|
||||
@ -318,27 +324,27 @@ mod tests {
|
||||
let cpu_memory_cols: Vec<Vec<_>> = (0..NUM_MEMORY_OPS)
|
||||
.map(|op| {
|
||||
let mut cols = Column::singles([
|
||||
cpu::columns::CLOCK,
|
||||
// cpu::columns::CLOCK,
|
||||
cpu::columns::memop_is_read(op),
|
||||
cpu::columns::memop_addr_context(op),
|
||||
cpu::columns::memop_addr_segment(op),
|
||||
cpu::columns::memop_addr_virtual(op),
|
||||
// cpu::columns::memop_addr_context(op),
|
||||
// cpu::columns::memop_addr_segment(op),
|
||||
// cpu::columns::memop_addr_virtual(op),
|
||||
])
|
||||
.collect_vec();
|
||||
cols.extend(Column::singles(
|
||||
(0..8).map(|j| cpu::columns::memop_value(op, j)),
|
||||
));
|
||||
// cols.extend(Column::singles(
|
||||
// (0..8).map(|j| cpu::columns::memop_value(op, j)),
|
||||
// ));
|
||||
cols
|
||||
})
|
||||
.collect();
|
||||
let mut memory_memory_cols = vec![
|
||||
memory::registers::TIMESTAMP,
|
||||
// memory::registers::TIMESTAMP,
|
||||
memory::registers::IS_READ,
|
||||
memory::registers::ADDR_CONTEXT,
|
||||
memory::registers::ADDR_SEGMENT,
|
||||
memory::registers::ADDR_VIRTUAL,
|
||||
// memory::registers::ADDR_CONTEXT,
|
||||
// memory::registers::ADDR_SEGMENT,
|
||||
// memory::registers::ADDR_VIRTUAL,
|
||||
];
|
||||
memory_memory_cols.extend((0..8).map(memory::registers::value_limb));
|
||||
// memory_memory_cols.extend((0..8).map(memory::registers::value_limb));
|
||||
|
||||
let mut cross_table_lookups = vec![
|
||||
CrossTableLookup::new(
|
||||
|
||||
@ -50,14 +50,15 @@ pub fn generate_random_memory_ops<F: RichField, R: Rng>(
|
||||
let mut current_memory_values: HashMap<(F, F, F), [F; 8]> = HashMap::new();
|
||||
for i in 0..num_ops {
|
||||
let timestamp = F::from_canonical_usize(i);
|
||||
let mut used_indices = HashSet::new();
|
||||
// let mut used_indices = HashSet::new();
|
||||
let mut new_writes_this_cycle = HashSet::new();
|
||||
for _ in 0..2 {
|
||||
let mut channel_index = rng.gen_range(0..4);
|
||||
while used_indices.contains(&channel_index) {
|
||||
channel_index = rng.gen_range(0..4);
|
||||
}
|
||||
used_indices.insert(channel_index);
|
||||
for _ in 0..1 {
|
||||
// let mut channel_index = rng.gen_range(0..4);
|
||||
// while used_indices.contains(&channel_index) {
|
||||
// channel_index = rng.gen_range(0..4);
|
||||
// }
|
||||
// used_indices.insert(channel_index);
|
||||
let channel_index = rng.gen_range(0..4);
|
||||
|
||||
let is_read = if i == 0 { false } else { rng.gen() };
|
||||
let is_read_field = F::from_bool(is_read);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user