This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99e28a1
commit 04b5c86
Showing
3 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* @file | ||
* version.scala | ||
* @author | ||
* Sina Karvandi ([email protected]) | ||
* @brief | ||
* Versioning details | ||
* @details | ||
* @version 0.1 | ||
* @date | ||
* 2024-05-01 | ||
* | ||
* @copyright | ||
* This project is released under the GNU Public License v3. | ||
*/ | ||
package hwdbg.version | ||
|
||
import chisel3._ | ||
import chisel3.util._ | ||
|
||
/** | ||
* @brief | ||
* Version of hwdbg | ||
* @warning | ||
* will be checked with HyperDbg | ||
*/ | ||
object Version { | ||
|
||
// | ||
// Constant version info | ||
// | ||
val VERSION_MAJOR: Int = 0 | ||
val VERSION_MINOR: Int = 1 | ||
val VERSION_PATCH: Int = 0 | ||
|
||
def getEncodedVersion: Int = { | ||
(VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | VERSION_PATCH | ||
} | ||
|
||
def extractMajor(encodedVersion: Int): Int = { | ||
encodedVersion >> 16 | ||
} | ||
|
||
def extractMinor(encodedVersion: Int): Int = { | ||
(encodedVersion >> 8) & 0xff // Masking to get only the 8 bits | ||
} | ||
|
||
def extractPatch(encodedVersion: Int): Int = { | ||
encodedVersion & 0xff // Masking to get only the 8 bits | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters