Skip to content

Commit 3aed957

Browse files
Work on adding thread to core
1 parent 70f313d commit 3aed957

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/main/scala/main/Core.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,13 @@ class Core extends Module {
4141

4242
io.debug_dispatcher_opcode := dispatcher.io.opcode;
4343
io.debug_dispatcher_program_pointer := dispatcher.io.program_pointer;
44+
45+
val thread = Module(new Thread());
46+
thread.io.dispatcher_opcode := dispatcher.io.opcode;
47+
thread.io.dispatcher_program_pointer := dispatcher.io.program_pointer;
48+
49+
thread.io.operation_ready := false.B;
50+
thread.io.operation := Operation.NoOp;
51+
thread.io.immediate_a := 0.U(8.W);
52+
thread.io.immediate_b := 0.U(8.W);
4453
}

src/main/scala/main/Thread.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import _root_.circt.stage.ChiselStage
44

55
class Thread extends Module {
66
val io = IO(new Bundle {
7+
val dispatcher_opcode = Input(Operation());
8+
val dispatcher_program_pointer = Input(UInt(8.W));
9+
710
val operation_ready = Input(Bool());
811
val operation = Input(Operation());
912
val immediate_a = Input(UInt(8.W));
@@ -28,7 +31,14 @@ class Thread extends Module {
2831
alu.io.rs := 0.U(8.W);
2932
alu.io.rt := 0.U(8.W);
3033
// val lsu = Module(new Lsu())
31-
// val program_counter = Module(new ProgramCounter())
34+
35+
val program_counter = Module(new ProgramCounter())
36+
program_counter.io.store_nzp := false.B;
37+
program_counter.io.nzp := 0.U(3.W);
38+
program_counter.io.update := false.B;
39+
program_counter.io.branch := false.B;
40+
program_counter.io.jump_location := 0.U(8.W);
41+
program_counter.io.target_nzp := 0.U(3.W);
3242

3343
io.debug_output := 0.U(8.W);
3444

0 commit comments

Comments
 (0)