[Print] Enable token compression

This commit is contained in:
David Biancolin 2018-12-15 16:31:55 -08:00
parent 1073f6b759
commit c50dd9ebfc
5 changed files with 13 additions and 6 deletions

@ -1 +1 @@
Subproject commit 86dcbfe8f2e1e664b2876d413c92b7a7bda8dde4
Subproject commit 0dd32c50133d42b2ecea1a2c1688273ab3db2815

View File

@ -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,

View File

@ -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);
};
};

View File

@ -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();
};
};

View File

@ -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)))
}
}