File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,18 @@ class Core extends Module {
2828 dispatcher.io.thread_requesting_opcode := thread.io.idle;
2929 dispatcher.io.thread_program_pointer := thread.io.program_pointer;
3030
31- // val read_ready_delayed = RegNext(dispatcher.io.read_requested, false.B);
32- // dispatcher.io.read_ready := read_ready_delayed;
33- dispatcher.io.read_ready := dispatcher.io.read_requested;
31+ val read_ready_delayed = RegNext (dispatcher.io.read_requested, false .B );
32+ dispatcher.io.read_ready := read_ready_delayed;
3433 dispatcher.io.read_opcode := Operation .safe(memory.io.readPorts(0 ).data(3 , 0 ))._1;
3534
3635 when(true .B ) {
3736 printf(p " \t [Core]===== " );
3837 printf(p " \n\t\t dispatcher.io.read_requested= ${dispatcher.io.read_requested}" );
38+ printf(p " \n\t\t read_ready_delayed= ${read_ready_delayed}" );
3939 printf(p " \n\t\t dispatcher.io.read_program_pointer= ${dispatcher.io.read_program_pointer}" );
4040 printf(p " \n\t\t dispatcher.io.read_opcode= ${dispatcher.io.read_opcode}" );
4141 // printf(p"\n\t\tread_ready_delayed=${read_ready_delayed}");
42+ printf(p " \n\t\t dispatcher_read_ready= ${dispatcher.io.read_ready}" );
4243 printf(p " \n\t\t debug_dispatcher_opcode= ${io.debug_dispatcher_opcode}" );
4344 printf(p " \n\t\t debug_dispatcher_program_pointer= ${io.debug_dispatcher_program_pointer}" );
4445 printf(p " \n\n " );
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ class Dispatcher extends Module {
3838 }
3939
4040 when(io.read_ready) {
41- // printf(p"\t[Dispatcher]=====");
42- // printf(p"\n\t\tMarked read not requested! \n\n");
41+ printf(p " \t [Dispatcher]===== " );
42+ printf(p " \n\t\t Read Complete ${io.read_opcode} \n\n " );
4343 opcode := io.read_opcode;
4444 opcode_loaded := true .B ;
4545 program_pointer := io.read_program_pointer;
Original file line number Diff line number Diff line change @@ -26,10 +26,8 @@ class ProgramCounter extends Module {
2626
2727 when(io.update) {
2828 when(io.branch && (nzp & io.target_nzp) =/= 0 .U ) {
29- io.program_counter := io.jump_location;
3029 program_counter := io.jump_location;
3130 }.otherwise {
32- io.program_counter := program_counter + 1 .U ;
3331 program_counter := program_counter + 1 .U ;
3432 }
3533 }
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ class Thread extends Module {
5353
5454 program_counter.io.update := true .B ;
5555 program_counter.io.branch := false .B ;
56+
57+ io.idle := false .B ;
5658 }
5759 }
5860
@@ -61,6 +63,7 @@ class Thread extends Module {
6163 printf(p " \n\t\t io.operation= ${io.operation}" );
6264 printf(p " \n\t\t program_pointer= ${program_counter.io.program_counter}" );
6365 printf(p " \n\t\t idle= ${idle}" );
66+ printf(p " \n\t\t io.idle= ${io.idle}" );
6467 printf(p " \n\t\t io.debug_output= ${io.debug_output}" );
6568 printf(p " \n\n " );
6669 }
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ class ProgramCounterTest extends AnyFlatSpec with ChiselScalatestTester {
66 " Program Counter Increment" should " work" in {
77 test(new ProgramCounter ) { dut =>
88 dut.io.update.poke(true .B );
9+
10+ dut.clock.step(1 );
11+
912 dut.io.program_counter.expect(1 .U );
1013 }
1114 }
@@ -22,6 +25,8 @@ class ProgramCounterTest extends AnyFlatSpec with ChiselScalatestTester {
2225 dut.io.jump_location.poke(8 .U );
2326 dut.io.target_nzp.poke(1 .U );
2427
28+ dut.clock.step(1 );
29+
2530 dut.io.program_counter.expect(8 .U );
2631 }
2732 }
@@ -38,6 +43,8 @@ class ProgramCounterTest extends AnyFlatSpec with ChiselScalatestTester {
3843 dut.io.jump_location.poke(8 .U );
3944 dut.io.target_nzp.poke(2 .U );
4045
46+ dut.clock.step(1 );
47+
4148 dut.io.program_counter.expect(1 .U );
4249 }
4350 }
You can’t perform that action at this time.
0 commit comments