Add continuous mode to HNY2026

Implemented a new `continuous` flag in `HnyConfig` and added a `sent` register in `HNY2026` to track
whether the message has been fully transmitted. When `continuous` is `false`, the module stops
sending after one full cycle.
This commit is contained in:
2026-01-10 17:22:59 +03:00
parent 7a6c9c4f24
commit 6ae8b4fc26
4 changed files with 36 additions and 6 deletions

View File

@@ -175,8 +175,16 @@ class HNY2026Test extends AnyFlatSpec with ChiselSim {
behavior of "HNY2026"
it should s"send string '$str'" in {
simulate(new HNY2026(cfg, str)) { dut =>
it should s"send string '$str' in non countinous mode" in {
simulate(new HNY2026(cfg.copy(continuous = false), str)) { dut =>
enableWaves()
dut.clock.step((cfg.clockFreq / cfg.frameRate * cfg.dataWidth * str.length() * 2).toInt)
println("See results in the wave diagram.")
}
}
it should s"send string '$str' in countinous mode" in {
simulate(new HNY2026(cfg.copy(continuous = true), str)) { dut =>
enableWaves()
dut.clock.step((cfg.clockFreq / cfg.frameRate * cfg.dataWidth * str.length() * 2).toInt)
println("See results in the wave diagram.")