@@ -20,8 +20,9 @@ class Thread extends Module {
2020 val end_of_program = RegInit (false .B );
2121 val idle = RegInit (true .B );
2222
23- val register_a = RegInit (0 .U (16 .W ));
24- val register_b = RegInit (0 .U (16 .W ));
23+ val register_a = RegInit (2 .U (16 .W ));
24+ val register_b = RegInit (3 .U (16 .W ));
25+ val register_c = RegInit (0 .U (16 .W ));
2526
2627 val alu = Module (new Alu ())
2728 alu.io.execute := false .B ;
@@ -51,8 +52,9 @@ class Thread extends Module {
5152 when(io.operation === Operation .Add || io.operation === Operation .Sub || io.operation === Operation .Mul || io.operation === Operation .Div ) {
5253 alu.io.execute := true .B ;
5354 alu.io.operation := io.operation;
54- alu.io.rs := io.immediate_a;
55- alu.io.rt := io.immediate_b;
55+ alu.io.rs := register_a;
56+ alu.io.rt := register_b;
57+ register_a := alu.io.output
5658
5759 program_counter.io.update := true .B ;
5860 program_counter.io.branch := false .B ;
@@ -68,6 +70,9 @@ class Thread extends Module {
6870 printf(p " \n\t\t idle= ${idle}" );
6971 printf(p " \n\t\t io.idle= ${io.idle}" );
7072 printf(p " \n\t\t io.debug_output= ${io.debug_output}" );
73+ printf(p " \n\t\t a= ${register_a}" );
74+ printf(p " \n\t\t b= ${register_b}" );
75+ printf(p " \n\t\t c= ${register_c}" );
7176 printf(p " \n\n " );
7277 }
7378}
0 commit comments