Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test control logic to Haskell #536

Merged
merged 4 commits into from
Sep 10, 2024
Merged

Move test control logic to Haskell #536

merged 4 commits into from
Sep 10, 2024

Conversation

martijnbastiaan
Copy link
Contributor

@martijnbastiaan martijnbastiaan commented Jun 4, 2024

This PR moves test control from TCL to Haskell. Moving this to Haskell makes sure that we can easily control the individual steps (programming, test control) and interleave it with other steps, such as starting GDB servers, and monitoring UART output. We mostly do this to make sure we can move to a software based development loop.

TODO

Future work

  • Cleanup VIO and ILA probe detection and usage code in bittide-shake/src/Clash/Shake/Vivado.hs
  • Perhaps let execPrint from vivado-hs print Vivado output to stdout directly instead of only when the relevant Tcl code has finished executing
  • Perhaps remove most functions in vivado-hs/src/Vivado/Tcl.hs and instead use execPrint or execCmd directly
  • Perhaps replace System.Clock with Data.Time(.Clock) and Data.Time.Format in bittide-shake/src/Clash/Shake/Vivado.hs to print fancier formatted test durations

martijnbastiaan and others added 2 commits September 6, 2024 11:35
A way of controlling a Vivado instance from Haskell
Also now support Vivado stdout without a newline at the end (e.g. `puts -nonewline`)
@martijnbastiaan martijnbastiaan force-pushed the vivado-wrapper branch 2 times, most recently from 17ff368 to ddafe88 Compare September 6, 2024 10:13
@martijnbastiaan martijnbastiaan force-pushed the vivado-wrapper branch 2 times, most recently from 13b920c to bea3dd3 Compare September 6, 2024 14:53
@martijnbastiaan martijnbastiaan marked this pull request as ready for review September 6, 2024 14:59
Copy link
Contributor Author

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this LGTM, great work @JvWesterveld!

I'm only missing some documentation in a couple of places, and I think Iter is a misnomer.

bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
@martijnbastiaan martijnbastiaan force-pushed the vivado-wrapper branch 5 times, most recently from 99c6532 to 87eaa21 Compare September 6, 2024 18:19
Copy link
Contributor

@JvWesterveld JvWesterveld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes LGTM. I have a few more mostly minor comments, partially concerning my own code.

vivado-hs/src/Vivado.hs Outdated Show resolved Hide resolved
vivado-hs/src/Vivado.hs Outdated Show resolved Hide resolved
bittide-instances/src/Bittide/Instances/Hitl/README.md Outdated Show resolved Hide resolved
bittide-shake/src/Clash/Shake/Vivado.hs Outdated Show resolved Hide resolved
bittide-shake/src/Clash/Shake/Vivado.hs Outdated Show resolved Hide resolved
bittide-experiments/src/Bittide/Hitl.hs Outdated Show resolved Hide resolved
bittide-shake/src/Clash/Shake/Vivado.hs Outdated Show resolved Hide resolved
bittide-shake/src/Clash/Shake/Vivado.hs Outdated Show resolved Hide resolved
.github/synthesis/all.json Outdated Show resolved Hide resolved
.github/synthesis/staging.json Show resolved Hide resolved
JvWesterveld and others added 2 commits September 10, 2024 13:35
This enables more fine-grained control of HITL test control execution from
Haskell code. It:

 * Moves test control logic from `bittide-shake/data/tcl/HardwareTest.tcl` to
   `bittide-shake/src/Clash/Shake/Vivado.hs`. Instead of letting Vivado execute
   Tcl files, it is now controlled by attaching to stdin and stdout of Vivado in
   Tcl mode through the new vivado-hs package.

 * Test definitions are no longer stored in JSON files, but using the new HitlTest
   type.
@martijnbastiaan martijnbastiaan merged commit c9507c1 into staging Sep 10, 2024
27 checks passed
@martijnbastiaan martijnbastiaan deleted the vivado-wrapper branch September 10, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants