@@ -8,7 +8,9 @@ class Core extends Module {
88
99 val debug_memory_write = Input (Bool ());
1010 val debug_memory_write_address = Input (UInt (8 .W ));
11- val debug_memory_write_data = Input (UInt (8 .W ));
11+ val debug_memory_write_data_0 = Input (UInt (8 .W ));
12+ val debug_memory_write_data_1 = Input (UInt (8 .W ));
13+ val debug_memory_write_data_2 = Input (UInt (8 .W ));
1214
1315 val debug_dispatcher_opcode = Output (Operation ());
1416 val debug_dispatcher_program_pointer = Output (UInt (8 .W ));
@@ -23,17 +25,27 @@ class Core extends Module {
2325 memory.io.readPorts(0 ).enable := dispatcher.io.read_requested;
2426 memory.io.readPorts(0 ).address := 3 .U * dispatcher.io.read_program_pointer;
2527 memory.io.readPorts(1 ).enable := dispatcher.io.read_requested;
26- memory.io.readPorts(1 ).address := 3 .U * dispatcher.io.read_program_pointer + 1 .U ;
28+ memory.io
29+ .readPorts(1 )
30+ .address := 3 .U * dispatcher.io.read_program_pointer + 1 .U ;
2731 memory.io.readPorts(2 ).enable := dispatcher.io.read_requested;
28- memory.io.readPorts(2 ).address := 3 .U * dispatcher.io.read_program_pointer + 2 .U ;
32+ memory.io
33+ .readPorts(2 )
34+ .address := 3 .U * dispatcher.io.read_program_pointer + 2 .U ;
2935
3036 memory.io.writePorts(0 ).enable := io.debug_memory_write;
31- memory.io.writePorts(0 ).address := io.debug_memory_write_address;
32- memory.io.writePorts(0 ).data := io.debug_memory_write_data;
37+ memory.io.writePorts(0 ).address := io.debug_memory_write_address * 3 .U ;
38+ memory.io.writePorts(0 ).data := io.debug_memory_write_data_0;
39+ memory.io.writePorts(1 ).enable := io.debug_memory_write;
40+ memory.io.writePorts(1 ).address := io.debug_memory_write_address * 3 .U + 1 .U ;
41+ memory.io.writePorts(1 ).data := io.debug_memory_write_data_1;
42+ memory.io.writePorts(2 ).enable := io.debug_memory_write;
43+ memory.io.writePorts(2 ).address := io.debug_memory_write_address * 3 .U + 2 .U ;
44+ memory.io.writePorts(2 ).data := io.debug_memory_write_data_2;
3345
3446 dispatcher.io.thread_requesting_opcode := thread.io.idle && io.execute;
3547 dispatcher.io.thread_program_pointer := thread.io.program_pointer;
36-
48+
3749 val read_ready_delayed = RegNext (dispatcher.io.read_requested, false .B );
3850 dispatcher.io.read_ready := read_ready_delayed;
3951 dispatcher.io.read_opcode := memory.io.readPorts(0 ).data(7 , 0 );
@@ -42,13 +54,19 @@ class Core extends Module {
4254
4355 when(true .B ) {
4456 printf(p " \t [Core]===== " );
45- printf(p " \n\t\t dispatcher.io.read_requested= ${dispatcher.io.read_requested}" );
46- printf(p " \n\t\t dispatcher.io.read_program_pointer= ${dispatcher.io.read_program_pointer}" );
57+ printf(
58+ p " \n\t\t dispatcher.io.read_requested= ${dispatcher.io.read_requested}"
59+ );
60+ printf(
61+ p " \n\t\t dispatcher.io.read_program_pointer= ${dispatcher.io.read_program_pointer}"
62+ );
4763 printf(p " \n\t\t dispatcher.io.read_opcode= ${dispatcher.io.read_opcode}" );
4864 // printf(p"\n\t\tread_ready_delayed=${read_ready_delayed}");
4965 printf(p " \n\t\t dispatcher_read_ready= ${dispatcher.io.read_ready}" );
5066 printf(p " \n\t\t debug_dispatcher_opcode= ${io.debug_dispatcher_opcode}" );
51- printf(p " \n\t\t debug_dispatcher_program_pointer= ${io.debug_dispatcher_program_pointer}" );
67+ printf(
68+ p " \n\t\t debug_dispatcher_program_pointer= ${io.debug_dispatcher_program_pointer}"
69+ );
5270 printf(p " \n\t\t execute= ${io.execute}" );
5371 printf(p " \n\n " );
5472 }
@@ -61,7 +79,10 @@ class Core extends Module {
6179 thread.io.operation := dispatcher.io.opcode;
6280 thread.io.src_register := dispatcher.io.src_register;
6381 thread.io.dst_register := dispatcher.io.dst_register;
64- thread.io.immediate := Cat (dispatcher.io.read_immediate_u, dispatcher.io.read_immediate_l);
82+ thread.io.immediate := Cat (
83+ dispatcher.io.read_immediate_u,
84+ dispatcher.io.read_immediate_l
85+ );
6586
6687 io.debug_thread_debug_output := thread.io.debug_output;
6788}
0 commit comments