@@ -26,10 +26,13 @@ class Thread extends Module {
2626
2727 val alu = Module (new Alu ())
2828 alu.io.execute := false .B ;
29- alu.io.operation := AluOperation . Add ;
29+ alu.io.operation := operation ;
3030 alu.io.compare := false .B ;
31- alu.io.rs := 0 .U (8 .W );
32- alu.io.rt := 0 .U (8 .W );
31+ alu.io.rs := immediate_a;
32+ alu.io.rt := immediate_b;
33+
34+ io.debug_output := alu.io.output;
35+
3336 // val lsu = Module(new Lsu())
3437
3538 val program_counter = Module (new ProgramCounter ())
@@ -41,8 +44,6 @@ class Thread extends Module {
4144 program_counter.io.target_nzp := 0 .U (3 .W );
4245
4346 io.program_pointer := program_counter.io.program_counter;
44-
45- io.debug_output := 0 .U (8 .W );
4647
4748 io.end_of_program := end_of_program;
4849 io.idle := idle;
@@ -54,26 +55,9 @@ class Thread extends Module {
5455
5556 when(operation === Operation .Add || operation === Operation .Sub || operation === Operation .Mul || operation === Operation .Div ) {
5657 alu.io.execute := true .B ;
57-
58- switch(operation) {
59- is (Operation .Add ) {
60- alu.io.operation := AluOperation .Add ;
61- }
62- is (Operation .Sub ) {
63- alu.io.operation := AluOperation .Sub ;
64- }
65- is (Operation .Mul ) {
66- alu.io.operation := AluOperation .Mul ;
67- }
68- is (Operation .Div ) {
69- alu.io.operation := AluOperation .Div ;
70- }
71- }
7258
73- alu.io.rs := io.immediate_a;
74- alu.io.rt := io.immediate_b;
75-
76- io.debug_output := alu.io.output;
59+ // program_counter.io.update := true.B;
60+ // program_counter.io.branch := false.B;
7761 }
7862 }
7963}
0 commit comments