> configure(npc)

ysyx_22040000 李心杨
 Linux calcite 6.6.19 #1-NixOS SMP PREEMPT_DYNAMIC Fri Mar  1 12:35:11 UTC 2024 x86_64 GNU/Linux
  18:16:48  up   3:36,  2 users,  load average: 0.28, 0.25, 0.34
This commit is contained in:
tracer-ysyx 2024-03-07 18:16:48 +08:00 committed by xinyangli
parent 833cf7b6d1
commit 64f891308e
2 changed files with 23 additions and 1 deletions

View file

@ -2,8 +2,10 @@ package npc
import chisel3._
import chisel3.util.{MuxLookup, Fill, Decoupled, Counter, Queue, Reverse}
import chisel3.util.{SRAM}
import chisel3.stage.ChiselOption
import npc.util.KeyboardSegController
import npc.util.{ KeyboardSegController, RegisterFile }
import flowpc.components.ProgramCounter
class Switch extends Module {
val io = IO(new Bundle {
@ -31,3 +33,12 @@ class Keyboard extends Module {
io.segs := seg_handler.io.segs
}
<<<<<<< Updated upstream
=======
class Flowpc extends Module {
val io = IO(new Bundle { })
val register_file = new RegisterFile(readPorts = 2);
val pc = new ProgramCounter(32);
val adder = new SRAM()
}
>>>>>>> Stashed changes

View file

@ -0,0 +1,11 @@
package flowpc.components
import chisel3._
import chisel3.util.{Valid}
class ProgramCounter (width: Int) extends Module {
val io = new Bundle {
val next_pc = Input(Flipped(Valid(UInt(width.W))))
val pc = Output(UInt(width.W))
}
io.pc := Mux(io.next_pc.valid, io.next_pc.bits, io.pc)
}