[Print] Enable token compression
This commit is contained in:
parent
1073f6b759
commit
c50dd9ebfc
|
@ -1 +1 @@
|
|||
Subproject commit 86dcbfe8f2e1e664b2876d413c92b7a7bda8dde4
|
||||
Subproject commit 0dd32c50133d42b2ecea1a2c1688273ab3db2815
|
|
@ -351,6 +351,7 @@ uint64_t host_mem_offset = -0x80000000LL;
|
|||
PRINTWIDGET_0_substruct,
|
||||
PRINTWIDGET_0_print_count,
|
||||
PRINTWIDGET_0_token_bytes,
|
||||
PRINTWIDGET_0_idle_cycles_mask,
|
||||
PRINTWIDGET_0_print_offsets,
|
||||
PRINTWIDGET_0_format_strings,
|
||||
PRINTWIDGET_0_argument_counts,
|
||||
|
|
|
@ -8,8 +8,15 @@ public:
|
|||
virtual void run() {
|
||||
print_endpoint->init();
|
||||
poke(reset, 1);
|
||||
poke(enable, 0);
|
||||
step(1);
|
||||
poke(enable, 1);
|
||||
poke(reset, 0);
|
||||
step(4);
|
||||
// Test idle-cycle rollover
|
||||
poke(enable, 0);
|
||||
step(256);
|
||||
poke(enable, 1);
|
||||
run_and_collect_prints(256);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -17,6 +17,7 @@ class print_module_t: virtual simif_t
|
|||
PRINTWIDGET_0_substruct,
|
||||
PRINTWIDGET_0_print_count,
|
||||
PRINTWIDGET_0_token_bytes,
|
||||
PRINTWIDGET_0_idle_cycles_mask,
|
||||
PRINTWIDGET_0_print_offsets,
|
||||
PRINTWIDGET_0_format_strings,
|
||||
PRINTWIDGET_0_argument_counts,
|
||||
|
@ -28,9 +29,6 @@ class print_module_t: virtual simif_t
|
|||
while (!done()) {
|
||||
print_endpoint->tick();
|
||||
}
|
||||
// Add a couple extra flushes to capture tokens that are collected after done is asserted.
|
||||
print_endpoint->flush();
|
||||
print_endpoint->flush();
|
||||
print_endpoint->finish();
|
||||
};
|
||||
};
|
||||
|
|
|
@ -42,9 +42,10 @@ class PrintfModuleChild extends MultiIOModule {
|
|||
}
|
||||
|
||||
class NarrowPrintfModule extends MultiIOModule {
|
||||
val enable = IO(Input(Bool()))
|
||||
val cycle = RegInit(0.U(12.W))
|
||||
cycle := cycle + 1.U
|
||||
when(LFSR16()(0) & LFSR16()(0)) {
|
||||
printf(SynthesizePrintf("SYNTHESIZED_PRINT CYCLE: %d\n", cycle))
|
||||
when(LFSR16()(0) & LFSR16()(0) & enable) {
|
||||
printf(SynthesizePrintf("SYNTHESIZED_PRINT CYCLE: %d\n", cycle(5,0)))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue