pa2.2: klib and difftest #1

Merged
xin merged 16 commits from pa2 into master 2024-03-26 03:00:50 +00:00
2 changed files with 23 additions and 1 deletions
Showing only changes of commit 64f891308e - Show all commits

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)
}