Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
create hwdbg action enums
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaKarvandi committed Apr 28, 2024
1 parent 8a3c907 commit 99e28a1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
35 changes: 32 additions & 3 deletions src/main/scala/hwdbg/communication/interpreter/interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import circt.stage.ChiselStage

import hwdbg.configs._
import hwdbg.types._
import hwdbg.utils._
import hwdbg.constants._

object DebuggerPacketInterpreterEnums {
object State extends ChiselEnum {
Expand Down Expand Up @@ -115,13 +113,44 @@ class DebuggerPacketInterpreter(
}
is(sNewActionReceived) {

//
// -------------------------------------------------------------------------
// Now, the action needs to be dispatched
//
val inputAction = io.requestedActionOfThePacketInput

when(inputAction === HwdbgActionEnums.hwdbgActionSendVersion.id.U) {

//
// Send version
//

}.elsewhen(inputAction === HwdbgActionEnums.hwdbgActionSendPinInformation.id.U) {

//
// Send pin information
//

}.otherwise {

//
// Invalid action, going to the sDone state
//
state := sDone
}

//
// -------------------------------------------------------------------------
//

}
is(sDone) {

//
// Finish the receiving, sending communication
//
noNewDataReceiver := true.B
noNewDataSender := true.B

//
// Go to the idle state
//
Expand Down
13 changes: 8 additions & 5 deletions src/main/scala/hwdbg/types/communication_types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ class DebuggerRemotePacket() extends Bundle {

/**
* @brief
* Different action of hwdbg (SHARED WITH HYPERDBG)
* Different action of hwdbg (SHARED WITH HYPERDBG) (HWDBG_ACTION_ENUMS)
* @warning
* Used in HyperDbg
*/
object HwdbgAction {
object State extends ChiselEnum {
val hwdbgActionSendVersion, hwdbgActionSendPinInformation = Value
}
object HwdbgActionEnums extends Enumeration {

val hwdbgActionSendVersion = Value(0)
val hwdbgActionSendPinInformation = Value(1)

}

0 comments on commit 99e28a1

Please sign in to comment.